Password list get's loaded in the background

- User has to repeat his passphrase
- Passwords can now be toggled
- Error message on wrong passphrase on decryption
This commit is contained in:
2020-07-12 19:51:30 +02:00
parent 1bb1b55452
commit 2efdce87a8
96 changed files with 166 additions and 168 deletions

View File

@@ -12,7 +12,8 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity android:name=".ViewActivity"></activity> <activity android:name=".GeneratorActivity"></activity>
<activity android:name=".ViewActivity" />
<activity android:name=".PassphraseActivity" /> <activity android:name=".PassphraseActivity" />
<activity <activity
android:name=".CreateActivity" android:name=".CreateActivity"

View File

@@ -10,6 +10,8 @@ import android.os.Bundle
import android.print.PrintAttributes import android.print.PrintAttributes
import android.print.PrintJob import android.print.PrintJob
import android.print.PrintManager import android.print.PrintManager
import android.text.method.HideReturnsTransformationMethod
import android.text.method.PasswordTransformationMethod
import android.util.Base64 import android.util.Base64
import android.util.Log import android.util.Log
import android.view.ContextThemeWrapper import android.view.ContextThemeWrapper
@@ -27,11 +29,12 @@ import com.google.zxing.integration.android.IntentResult
import com.journeyapps.barcodescanner.BarcodeEncoder import com.journeyapps.barcodescanner.BarcodeEncoder
import dev.turingcomplete.kotlinonetimepassword.GoogleAuthenticator import dev.turingcomplete.kotlinonetimepassword.GoogleAuthenticator
import kotlinx.android.synthetic.main.activity_create.* import kotlinx.android.synthetic.main.activity_create.*
import kotlinx.android.synthetic.main.dialogpassphrase.*
import kotlinx.android.synthetic.main.dialogpassphrase.view.* import kotlinx.android.synthetic.main.dialogpassphrase.view.*
import kotlinx.coroutines.* import kotlinx.coroutines.*
import java.io.ByteArrayOutputStream import java.io.ByteArrayOutputStream
import java.lang.IllegalArgumentException
import java.util.* import java.util.*
import kotlin.collections.ArrayList
class CreateActivity : AppCompatActivity() { class CreateActivity : AppCompatActivity() {
private var schema: QRSchema? = null private var schema: QRSchema? = null
@@ -43,6 +46,8 @@ class CreateActivity : AppCompatActivity() {
private var fa_uri: Uri? = null private var fa_uri: Uri? = null
private var known_passwords = ArrayList<String>()
/** /**
* Gets triggered when the user clicks on printing button (top left) and renders the paper to * Gets triggered when the user clicks on printing button (top left) and renders the paper to
* print. * print.
@@ -130,17 +135,7 @@ class CreateActivity : AppCompatActivity() {
} }
fun passwordKnown(password: String): Boolean { fun passwordKnown(password: String): Boolean {
val known_passwords = String(this.resources.openRawResource( return this.known_passwords.contains(password)
this.resources.getIdentifier("passwordlist", "raw", this.packageName)
).readBytes())
val known_passwords_array = runBlocking {
known_passwords.split("\n")
}
Log.i("Create Activity", "Size of passwords: ${known_passwords_array.size}")
return known_passwords_array.contains(password)
} }
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
@@ -158,6 +153,15 @@ class CreateActivity : AppCompatActivity() {
setSupportActionBar(findViewById(R.id.toolbar)) setSupportActionBar(findViewById(R.id.toolbar))
// Split word list in the background (this process can take a few seconds to complete)
GlobalScope.async {
val known_passwords_ = String(resources.openRawResource(
resources.getIdentifier("passwordlist", "raw", packageName)
).readBytes())
known_passwords = known_passwords_.split("\n") as ArrayList<String>
}
setContentView(R.layout.activity_create) setContentView(R.layout.activity_create)
back.setOnClickListener { back.setOnClickListener {
Log.i("CREATE", "Back got clicked!") Log.i("CREATE", "Back got clicked!")
@@ -186,6 +190,12 @@ class CreateActivity : AppCompatActivity() {
showError("Weak passphrase", "Passphrase has to be at least 8 characters long.") showError("Weak passphrase", "Passphrase has to be at least 8 characters long.")
return@OnClickListener return@OnClickListener
} }
if (passphrase != editTextLayout.passphrase2_input.text.toString()) {
// Make a new alert, telling the user that his passphrase doesn't match the repeat field.
dialogInterface.cancel()
showError("Passphrase mismatch", "Both passphrases do not match.")
return@OnClickListener
}
// Check if password is found in our offline password list // Check if password is found in our offline password list
if(passwordKnown(passphrase)) { if(passwordKnown(passphrase)) {
@@ -207,6 +217,16 @@ class CreateActivity : AppCompatActivity() {
} }
password_hide.setOnClickListener {
if (password_input.transformationMethod == HideReturnsTransformationMethod.getInstance()) {
password_input.transformationMethod = PasswordTransformationMethod.getInstance()
password_hide.setImageResource(R.drawable.ic_visibility_on)
} else {
password_input.transformationMethod = HideReturnsTransformationMethod.getInstance()
password_hide.setImageResource(R.drawable.ic_visibility_off)
}
}
fa_input.isFocusable = false fa_input.isFocusable = false
@@ -242,6 +262,12 @@ class CreateActivity : AppCompatActivity() {
if (result.contents.startsWith("otpauth://totp/")) { if (result.contents.startsWith("otpauth://totp/")) {
fa_progress.visibility = View.VISIBLE fa_progress.visibility = View.VISIBLE
fa_uri = Uri.parse(result.contents) fa_uri = Uri.parse(result.contents)
if (fa_uri?.getQueryParameter("secret").toString() == "" || fa_uri?.getQueryParameter("secret") == null) {
showError("Corrupt 2FA", "The scanned 2FA secret doesn't contain a secret!")
return
}
val fa_generator = GoogleAuthenticator(base32secret = fa_uri?.getQueryParameter("secret").toString()) val fa_generator = GoogleAuthenticator(base32secret = fa_uri?.getQueryParameter("secret").toString())
this.schema!!.custom.put("2fa", fa_uri?.getQueryParameter("secret").toString()) this.schema!!.custom.put("2fa", fa_uri?.getQueryParameter("secret").toString())
@@ -253,7 +279,12 @@ class CreateActivity : AppCompatActivity() {
// TODO: There is a bug. When the user changes his current app, this coroutine stops. // TODO: There is a bug. When the user changes his current app, this coroutine stops.
fa_coroutine = GlobalScope.launch(Dispatchers.Main) { fa_coroutine = GlobalScope.launch(Dispatchers.Main) {
while (true) { while (true) {
try {
fa_input.setText(fa_generator.generate()) fa_input.setText(fa_generator.generate())
} catch (error: IllegalArgumentException) {
showError("Corrupt 2FA", "The scanned 2FA secret is corrupt and therefore no codes can be generated.")
return@launch
}
var seconds_remaining = CryptoOperations().getRemainingTOTPTime() var seconds_remaining = CryptoOperations().getRemainingTOTPTime()
Log.i("2FA Generator", "Remaining: $seconds_remaining") Log.i("2FA Generator", "Remaining: $seconds_remaining")
@@ -275,6 +306,8 @@ class CreateActivity : AppCompatActivity() {
} }
fa_label.text = "${fa_uri?.path?.replace("/", "")} (${fa_uri?.getQueryParameter("issuer")})" fa_label.text = "${fa_uri?.path?.replace("/", "")} (${fa_uri?.getQueryParameter("issuer")})"
} else {
showError("No 2FA", "The scanned QR-Code has the wrong format.")
} }
} }
} }

View File

@@ -0,0 +1,11 @@
package com.github.mondei1.offpass
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
class GeneratorActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_generator)
}
}

View File

@@ -4,9 +4,12 @@ import android.content.Intent
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle import android.os.Bundle
import android.text.Editable import android.text.Editable
import android.view.View
import kotlinx.android.synthetic.main.activity_passphrase.* import kotlinx.android.synthetic.main.activity_passphrase.*
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import javax.crypto.BadPaddingException
import kotlin.reflect.typeOf
class PassphraseActivity : AppCompatActivity() { class PassphraseActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
@@ -22,9 +25,20 @@ class PassphraseActivity : AppCompatActivity() {
decrypt_button.setOnClickListener { decrypt_button.setOnClickListener {
decrypt_button.text = "Decrypting ..." decrypt_button.text = "Decrypting ..."
var _continue = true;
runBlocking { runBlocking {
try {
qrSchema.decrypt(raw, passphrase_input.text.toString()) qrSchema.decrypt(raw, passphrase_input.text.toString())
} catch (err: BadPaddingException) {
failed.visibility = View.VISIBLE
decrypt_button.text = "Decrypt"
_continue = false
return@runBlocking
} }
}
if(!_continue) return@setOnClickListener
val intent: Intent = Intent(this, ViewActivity::class.java) val intent: Intent = Intent(this, ViewActivity::class.java)
intent.putExtra("decrypted_raw",qrSchema.decrypted_raw) intent.putExtra("decrypted_raw",qrSchema.decrypted_raw)

View File

@@ -8,21 +8,33 @@ import android.content.res.ColorStateList
import android.graphics.Color import android.graphics.Color
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.text.method.HideReturnsTransformationMethod
import android.text.method.PasswordTransformationMethod
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import android.view.WindowManager import android.view.WindowManager
import android.widget.TextView import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import dev.turingcomplete.kotlinonetimepassword.GoogleAuthenticator import dev.turingcomplete.kotlinonetimepassword.GoogleAuthenticator
import kotlinx.android.synthetic.main.activity_create.*
import kotlinx.android.synthetic.main.activity_view.* import kotlinx.android.synthetic.main.activity_view.*
import kotlinx.coroutines.Dispatchers import kotlinx.android.synthetic.main.activity_view.back
import kotlinx.coroutines.GlobalScope import kotlinx.android.synthetic.main.activity_view.email_input
import kotlinx.coroutines.delay import kotlinx.android.synthetic.main.activity_view.fa_input
import kotlinx.coroutines.launch import kotlinx.android.synthetic.main.activity_view.fa_label
import kotlinx.android.synthetic.main.activity_view.fa_progress
import kotlinx.android.synthetic.main.activity_view.password_hide
import kotlinx.android.synthetic.main.activity_view.password_input
import kotlinx.android.synthetic.main.activity_view.title_label
import kotlinx.android.synthetic.main.activity_view.url_input
import kotlinx.android.synthetic.main.activity_view.username_input
import kotlinx.coroutines.*
class ViewActivity : AppCompatActivity() { class ViewActivity : AppCompatActivity() {
var fa_coroutine: Job? = null
override fun onBackPressed() { override fun onBackPressed() {
val i = Intent(this, MainActivity::class.java) val i = Intent(this, MainActivity::class.java)
i.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP i.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
@@ -46,13 +58,25 @@ class ViewActivity : AppCompatActivity() {
i.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP i.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
startActivity(i) startActivity(i)
} }
password_hide.setOnClickListener {
if (password_input.transformationMethod == HideReturnsTransformationMethod.getInstance()) {
password_input.transformationMethod = PasswordTransformationMethod.getInstance()
password_input.text = "123456"
password_hide.setImageResource(R.drawable.ic_visibility_on)
} else {
password_input.transformationMethod = HideReturnsTransformationMethod.getInstance()
password_input.text = qrSchema.password
password_hide.setImageResource(R.drawable.ic_visibility_off)
}
}
qrSchema.decrypted_raw = intent.getStringExtra("decrypted_raw")!! qrSchema.decrypted_raw = intent.getStringExtra("decrypted_raw")!!
qrSchema.parse(this) qrSchema.parse(this)
title_label.text = qrSchema.title title_label.text = qrSchema.title
username_input.setText(qrSchema.username, TextView.BufferType.EDITABLE) username_input.setText(qrSchema.username, TextView.BufferType.EDITABLE)
password_input.setText(qrSchema.password, TextView.BufferType.EDITABLE) password_input.setText("123456", TextView.BufferType.EDITABLE)
email_input.setText(qrSchema.email, TextView.BufferType.EDITABLE) email_input.setText(qrSchema.email, TextView.BufferType.EDITABLE)
url_input.setText(qrSchema.website_url, TextView.BufferType.EDITABLE) url_input.setText(qrSchema.website_url, TextView.BufferType.EDITABLE)
@@ -62,7 +86,7 @@ class ViewActivity : AppCompatActivity() {
fa_label.text = "${fa_uri.path?.replace("/", "")} (${fa_uri.getQueryParameter("issuer")})" fa_label.text = "${fa_uri.path?.replace("/", "")} (${fa_uri.getQueryParameter("issuer")})"
fa_progress.visibility = View.VISIBLE fa_progress.visibility = View.VISIBLE
GlobalScope.launch(Dispatchers.Main) { fa_coroutine = GlobalScope.launch(Dispatchers.Main) {
while (true) { while (true) {
fa_input.setText(fa_generator.generate()) fa_input.setText(fa_generator.generate())
@@ -88,4 +112,9 @@ class ViewActivity : AppCompatActivity() {
fa_layout.visibility = View.GONE fa_layout.visibility = View.GONE
} }
} }
override fun onStop() {
super.onStop()
fa_coroutine?.cancel(CancellationException("Activity is stopping"))
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 788 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 788 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 788 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,10 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/>
</vector>

View File

@@ -1,10 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M10.59,9.17L5.41,4 4,5.41l5.17,5.17 1.42,-1.41zM14.5,4l2.04,2.04L4,18.59 5.41,20 17.96,7.46 20,9.5L20,4h-5.5zM14.83,13.41l-1.41,1.41 3.13,3.13L14.5,20L20,20v-5.5l-2.04,2.04 -3.13,-3.13z"/>
</vector>

View File

@@ -1,10 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="@color/colorPrimaryDark">
<path
android:fillColor="@android:color/white"
android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
</vector>

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -131,13 +131,13 @@
<EditText <EditText
android:id="@+id/password_input" android:id="@+id/password_input"
android:layout_width="288dp" android:layout_width="263dp"
android:layout_height="68dp" android:layout_height="67dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:background="@color/colorPrimary" android:background="@color/colorPrimary"
android:ems="10" android:ems="10"
android:fontFamily="sans-serif-black" android:fontFamily="sans-serif-black"
android:hint="You shouldn't see that" android:hint="Secure password"
android:inputType="textPassword" android:inputType="textPassword"
android:singleLine="true" android:singleLine="true"
android:textSize="28sp" android:textSize="28sp"
@@ -235,19 +235,21 @@
app:layout_constraintStart_toEndOf="@+id/password_input" app:layout_constraintStart_toEndOf="@+id/password_input"
app:layout_constraintTop_toTopOf="@+id/password_input" app:layout_constraintTop_toTopOf="@+id/password_input"
app:layout_constraintVertical_bias="0.48000002" app:layout_constraintVertical_bias="0.48000002"
app:srcCompat="@drawable/baseline_visibility_black_36" /> app:srcCompat="@drawable/ic_visibility_on" />
<ImageButton <ImageButton
android:id="@+id/password_random" android:id="@+id/password_random"
android:layout_width="31dp" android:layout_width="wrap_content"
android:layout_height="38dp" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginEnd="15dp"
android:background="@color/colorPrimary" android:background="@color/colorPrimary"
android:tint="#000000" android:tint="#000000"
app:layout_constraintBottom_toBottomOf="@+id/password_input" app:layout_constraintBottom_toBottomOf="@+id/password_input"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/password_hide" app:layout_constraintStart_toEndOf="@+id/password_hide"
app:layout_constraintTop_toTopOf="@+id/password_input" app:layout_constraintTop_toTopOf="@+id/password_input"
app:srcCompat="@drawable/baseline_sd_storage_24" /> app:srcCompat="@drawable/ic_autorenew" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".GeneratorActivity">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -9,8 +9,8 @@
<EditText <EditText
android:id="@+id/passphrase_input" android:id="@+id/passphrase_input"
android:layout_width="234dp" android:layout_width="286dp"
android:layout_height="wrap_content" android:layout_height="61dp"
android:layout_marginStart="88dp" android:layout_marginStart="88dp"
android:layout_marginEnd="89dp" android:layout_marginEnd="89dp"
android:backgroundTint="#757575" android:backgroundTint="#757575"
@@ -27,8 +27,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintVertical_bias="0.513" />
<Button <Button
android:id="@+id/decrypt_button" android:id="@+id/decrypt_button"
@@ -36,7 +35,7 @@
android:layout_width="152dp" android:layout_width="152dp"
android:layout_height="59dp" android:layout_height="59dp"
android:layout_marginStart="161dp" android:layout_marginStart="161dp"
android:layout_marginTop="72dp" android:layout_marginTop="48dp"
android:layout_marginEnd="162dp" android:layout_marginEnd="162dp"
android:background="#00FFFFFF" android:background="#00FFFFFF"
android:backgroundTint="#001C1C1C" android:backgroundTint="#001C1C1C"
@@ -45,6 +44,7 @@
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:textSize="18sp" android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.484"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/passphrase_input" /> app:layout_constraintTop_toBottomOf="@+id/passphrase_input" />
@@ -62,4 +62,20 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/failed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="180dp"
android:layout_marginEnd="180dp"
android:layout_marginBottom="40dp"
android:fontFamily="sans-serif-black"
android:text="Wrong Passphrase"
android:textColor="#E53935"
android:textSize="18sp"
android:visibility="invisible"
app:layout_constraintBottom_toTopOf="@+id/passphrase_input"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -100,11 +100,12 @@
android:layout_height="68dp" android:layout_height="68dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:background="@color/colorPrimary" android:background="@color/colorPrimary"
android:ems="10"
android:fontFamily="sans-serif-black" android:fontFamily="sans-serif-black"
android:gravity="center_vertical"
android:inputType="textPassword" android:inputType="textPassword"
android:singleLine="true" android:singleLine="true"
android:textSize="28sp" android:textColor="@color/colorPrimaryDark"
android:textSize="42sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/password_label" /> app:layout_constraintTop_toBottomOf="@+id/password_label" />
@@ -162,13 +163,13 @@
android:id="@+id/password_hide" android:id="@+id/password_hide"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="60dp" android:layout_marginStart="28dp"
android:background="@color/colorPrimary" android:background="@color/colorPrimary"
app:layout_constraintBottom_toBottomOf="@+id/password_input" app:layout_constraintBottom_toBottomOf="@+id/password_input"
app:layout_constraintStart_toEndOf="@+id/password_input" app:layout_constraintStart_toEndOf="@+id/password_input"
app:layout_constraintTop_toTopOf="@+id/password_input" app:layout_constraintTop_toTopOf="@+id/password_input"
app:layout_constraintVertical_bias="0.437" app:layout_constraintVertical_bias="0.45"
app:srcCompat="@drawable/baseline_visibility_black_36" /> app:srcCompat="@drawable/ic_visibility_on" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

View File

@@ -1,64 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/colorPrimaryDark"
app:title="Create">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/back"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="47dp"
android:layout_height="50dp"
android:layout_marginEnd="6dp"
android:drawableTop="@drawable/baseline_arrow_forward_white_36"
android:text=""
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/settings"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="56dp"
android:layout_height="50dp"
android:layout_marginEnd="52dp"
android:drawableTop="@drawable/baseline_settings_white_36"
android:scaleX="1"
android:scaleY="1"
android:text=""
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/settings2"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="56dp"
android:layout_height="50dp"
android:layout_marginEnd="108dp"
android:drawableTop="@drawable/baseline_sd_storage_24"
android:scaleX="1"
android:scaleY="1"
android:text=""
android:textColor="#000000"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/print_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Create"
android:textColor="@color/colorPrimary"
android:textSize="24sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.Toolbar>

View File

@@ -11,11 +11,22 @@
android:id="@+id/passphrase_input" android:id="@+id/passphrase_input"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:inputType="textPassword"
android:backgroundTint="@color/colorPrimary" android:backgroundTint="@color/colorPrimary"
android:textColorHint="@color/colorPrimary" android:textColorHint="@color/colorPrimary"
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:hint="Enter passphrase"/> android:hint="Enter passphrase"/>
<EditText
android:id="@+id/passphrase2_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:backgroundTint="@color/colorPrimary"
android:textColorHint="@color/colorPrimary"
android:textColor="@color/colorPrimary"
android:hint="Repeat passphrase"/>
<EditText <EditText
android:id="@+id/hint_input" android:id="@+id/hint_input"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -1,3 +1 @@
<resources> <resources></resources>
<string name="hello_world">Hello Round World!</string>
</resources>

View File

@@ -4,12 +4,10 @@
Because the window insets on round devices are larger than 15dp, this padding only applies Because the window insets on round devices are larger than 15dp, this padding only applies
to square screens. to square screens.
--> -->
<dimen name="box_inset_layout_padding">0dp</dimen>
<!-- <!--
This padding applies to both square and round screens. The total padding between the buttons This padding applies to both square and round screens. The total padding between the buttons
and the window insets is box_inset_layout_padding (above variable) on square screens and and the window insets is box_inset_layout_padding (above variable) on square screens and
inner_frame_layout_padding (below variable) on round screens. inner_frame_layout_padding (below variable) on round screens.
--> -->
<dimen name="inner_frame_layout_padding">5dp</dimen>
</resources> </resources>

View File

@@ -1,7 +1,5 @@
<resources> <resources>
<string name="app_name">OffPass</string> <string name="app_name">OffPass</string>
<string name="qr_schema_support">1</string>
<string name="title_activity_create">CreateActivity</string>
<!-- <!--
This string is used for square devices and overridden by hello_world in This string is used for square devices and overridden by hello_world in
values-round/strings.xml for round devices. values-round/strings.xml for round devices.