Skip to content
This repository has been archived by the owner on Jan 25, 2025. It is now read-only.

Revamped Keyspace settings to match Android 13 AOSP settings #53

Merged
merged 5 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/src/main/kotlin/cloud/keyspace/android/Settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class Settings : AppCompatActivity() {

val configData = getSharedPreferences (applicationContext.packageName + "_configuration_data", MODE_PRIVATE)

val backButton: ImageView = findViewById(R.id.backButton)
backButton.setOnClickListener { onBackPressed() }

val keyspaceAccountPicture: ImageView = findViewById(R.id.keyspaceAccountPicture)
keyspaceAccountPicture.setImageDrawable(MiscUtilities(applicationContext).generateProfilePicture(configData.getString("userEmail", null)!!))

Expand Down Expand Up @@ -59,14 +62,14 @@ class Settings : AppCompatActivity() {
val strongBoxIcon: ImageView = findViewById(R.id.strongBoxTypeIcon)

if (applicationContext.packageManager.hasSystemFeature(PackageManager.FEATURE_STRONGBOX_KEYSTORE)) { // Check if strongbox / hardware keystore exists
strongBoxText.text = "Keyspace is encrypting your keys and tokens using tamper-resistant Strongbox hardware on your phone."
strongBoxText.text = "Keys are encrypted using tamper-resistant Strongbox hardware."
strongBoxIcon.setImageDrawable(getDrawable(R.drawable.ic_baseline_chip_24))
} else {
if (applicationContext.packageManager.hasSystemFeature(PackageManager.FEATURE_HARDWARE_KEYSTORE)) {
strongBoxText.text = "Your phone doesn't contain Strongbox hardware. Using Hardware Abstraction Layer (HAL) based Keystore."
strongBoxText.text = "Keys are encrypted using Hardware Abstraction Layer (HAL) Keystore."
strongBoxIcon.setImageDrawable(getDrawable(R.drawable.ic_baseline_code_24))
} else {
strongBoxText.text = "Your phone doesn't contain strongbox hardware. Using container-based Keystore."
strongBoxText.text = "Keys are encrypted using container-based Keystore."
strongBoxIcon.setImageDrawable(getDrawable(R.drawable.ic_baseline_insert_drive_file_24))
}
}
Expand Down
59 changes: 38 additions & 21 deletions app/src/main/res/layout/developer_options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,25 @@
android:layout_height="match_parent"
android:paddingBottom="50dp"
android:orientation="vertical"
android:paddingTop="105dp">
android:paddingTop="15dp">

<ImageView
android:id="@+id/backButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
app:srcCompat="@drawable/ic_baseline_arrow_back_24"
app:tint="?android:attr/textColorPrimary" />

<TextView
android:id="@+id/developerOptionsActivityLabelTop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginBottom="20dp"
android:layout_marginTop="70dp"
android:text="Developer options"
android:textSize="32sp" />
android:textSize="35sp" />

<LinearLayout
android:id="@+id/blake2bSettings"
Expand All @@ -54,16 +63,25 @@
android:orientation="vertical">

<TextView
android:id="@+id/blake2bLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:duplicateParentState="true"
android:paddingStart="5dp"
android:paddingBottom="10dp"
android:text="BLAKE2B tester"
android:paddingTop="25dp"
android:paddingBottom="20dp"
android:text="Cryptography testers"
android:textColor="?attr/colorAccent"
android:textStyle="bold" />

<TextView
android:layout_width="match_parent"
android:duplicateParentState="true"
android:layout_height="wrap_content"
android:paddingVertical="3.5dp"
android:textSize="20sp"
android:paddingHorizontal="5dp"
android:text="Test BLAKE2B" />

<TextView
android:id="@+id/blake2bDescriptionText"
android:layout_width="match_parent"
Expand Down Expand Up @@ -102,6 +120,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BLAKE2B hash"
android:layout_marginTop="10dp"
app:icon="@drawable/ic_baseline_root_24" />

</LinearLayout>
Expand Down Expand Up @@ -143,15 +162,13 @@
android:orientation="vertical">

<TextView
android:id="@+id/Argon2iLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:duplicateParentState="true"
android:paddingStart="5dp"
android:paddingBottom="10dp"
android:text="Argon2i tester"
android:textColor="?attr/colorAccent"
android:textStyle="bold" />
android:layout_height="wrap_content"
android:paddingVertical="3.5dp"
android:textSize="20sp"
android:paddingHorizontal="5dp"
android:text="Test Argon2i" />

<TextView
android:id="@+id/argon2DescriptionText"
Expand Down Expand Up @@ -240,6 +257,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Argon2i hash"
android:layout_marginTop="10dp"
app:icon="@drawable/ic_baseline_root_24" />

</LinearLayout>
Expand Down Expand Up @@ -280,15 +298,13 @@
android:orientation="vertical">

<TextView
android:id="@+id/bip39Label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:duplicateParentState="true"
android:paddingStart="5dp"
android:paddingBottom="10dp"
android:text="BIP39 tester"
android:textColor="?attr/colorAccent"
android:textStyle="bold" />
android:layout_height="wrap_content"
android:paddingVertical="3.5dp"
android:textSize="20sp"
android:paddingHorizontal="5dp"
android:text="Test BIP39" />

<TextView
android:id="@+id/bip39DescriptionText"
Expand Down Expand Up @@ -338,6 +354,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:text="Generate words"
android:layout_marginTop="10dp"
app:icon="@drawable/ic_baseline_checklist_24" />


Expand Down
Loading