Skip to content

Commit

Permalink
Revert "Minor change"
Browse files Browse the repository at this point in the history
This reverts commit ade313a
  • Loading branch information
vvb2060 committed Nov 7, 2021
1 parent 53b15fc commit 2ea0c7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class HomeFragment : AppFragment(), HomeAdapter.Listener {
super.onCreate(savedInstanceState)

viewModel.preferStrongBox = preference.getBoolean("prefer_strongbox", true)
viewModel.includeProps = preference.getBoolean("prefer_including_props", true)
viewModel.preferIncludeProps = preference.getBoolean("prefer_including_props", true)
viewModel.load()
}

Expand Down Expand Up @@ -143,7 +143,7 @@ class HomeFragment : AppFragment(), HomeAdapter.Listener {
menu.findItem(R.id.menu_use_strongbox).isVisible = viewModel.hasStrongBox
menu.findItem(R.id.menu_use_strongbox).isChecked = viewModel.preferStrongBox
menu.findItem(R.id.menu_incluid_props).isVisible = viewModel.hasDeviceIds
menu.findItem(R.id.menu_incluid_props).isChecked = viewModel.includeProps
menu.findItem(R.id.menu_incluid_props).isChecked = viewModel.preferIncludeProps
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
Expand All @@ -159,7 +159,7 @@ class HomeFragment : AppFragment(), HomeAdapter.Listener {
R.id.menu_incluid_props -> {
val status = !item.isChecked
item.isChecked = status
viewModel.includeProps = status
viewModel.preferIncludeProps = status
viewModel.load()
preference.edit { putBoolean("prefer_including_props", status) }
true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class HomeViewModel(context: Context) : ViewModel() {

val hasDeviceIds = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S &&
context.packageManager.hasSystemFeature("android.software.device_id_attestation")
var includeProps = true
var preferIncludeProps = true

@Throws(GeneralSecurityException::class)
private fun generateKey(alias: String, useStrongBox: Boolean, includeProps: Boolean) {
Expand Down Expand Up @@ -112,7 +112,7 @@ class HomeViewModel(context: Context) : ViewModel() {

withContext(Dispatchers.IO) {
val useStrongBox = hasStrongBox && preferStrongBox
val incloudProps = hasDeviceIds && includeProps
val includeProps = hasDeviceIds && preferIncludeProps
val result = try {
val alias = "Key_${useStrongBox}_$includeProps"
val attestationResult = doAttestation(alias, useStrongBox, includeProps)
Expand Down

0 comments on commit 2ea0c7e

Please sign in to comment.