Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial generic device support #236

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
110 changes: 2 additions & 108 deletions app/src/main/java/app/attestation/auditor/AttestationActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,108 +140,6 @@ private enum Stage {
}
});

private static final boolean isSupportedAuditee = ImmutableSet.of(
"ALP-L29",
"AUM-L29",
"Aquaris X2 Pro",
"BBF100-1",
"BBF100-6",
"BKL-L04",
"BKL-L09",
"CLT-L29",
"COL-L29",
"DUB-LX3",
"CPH1831",
"CPH1903",
"CPH1909",
"EML-L09",
"EXODUS 1",
"G8341",
"G8342",
"G8441",
"GM1913",
"H3113",
"H3123",
"H4113",
"H8216",
"H8314",
"H8324",
"HTC 2Q55100",
"JKM-LX3",
"LLD-L31",
"LG-Q710AL",
"LM-Q720",
"LYA-L29",
"Mi A2",
"Mi A2 Lite",
"MI 9",
"moto g(7)",
"motorola one vision",
"Nokia 3.1",
"Nokia 6.1",
"Nokia 6.1 Plus",
"Nokia 7.1",
"Nokia 7 plus",
"ONEPLUS A6003",
"ONEPLUS A6013",
"Pixel 2",
"Pixel 2 XL",
"Pixel 3",
"Pixel 3 XL",
"Pixel 3a",
"Pixel 3a XL",
"Pixel 4",
"Pixel 4 XL",
"Pixel 4a",
"Pixel 4a (5G)",
"Pixel 5",
"Pixel 5a",
"Pixel 6",
"Pixel 6 Pro",
"Pixel 6a",
"Pixel 7",
"Pixel 7 Pro",
"Pixel 7a",
"Pixel Tablet",
"Pixel Fold",
"Pixel 8",
"Pixel 8 Pro",
"POCOPHONE F1",
"POT-LX3",
"REVVL 2",
"RMX1941",
"SM-A705FN",
"SM-G960F",
"SM-G960U",
"SM-G960U1",
"SM-G960W",
"SM-G9600",
"SM-G965F",
"SM-G965U",
"SM-G965U1",
"SM-G965W",
"SM-G970F",
"SM-G975F",
"SM-J260A",
"SM-J260F",
"SM-J260T1",
"SM-J337A",
"SM-J337AZ",
"SM-J337T",
"SM-J720F",
"SM-J737T1",
"SM-M205F",
"SM-N960F",
"SM-N960U",
"SM-N970F",
"SM-N970U",
"SM-N975U",
"SM-S367VL",
"SM-T510",
"SM-T835",
"SNE-LX1",
"vivo 1807").contains(Build.MODEL);

private static int getFirstApiLevel() {
return Integer.parseInt(SystemProperties.get("ro.product.first_api_level",
Integer.toString(Build.VERSION.SDK_INT)));
Expand All @@ -263,10 +161,6 @@ protected void onCreate(Bundle savedInstanceState) {
snackbar = Snackbar.make(rootView, "", Snackbar.LENGTH_LONG);

binding.content.auditee.setOnClickListener((final View view) -> {
if (!isSupportedAuditee) {
snackbar.setText(R.string.unsupported_auditee).show();
return;
}
stage = Stage.Auditee;
startQrScanner();
});
Expand Down Expand Up @@ -513,7 +407,7 @@ public void onActivityResult(final int requestCode, final int resultCode, final
@Override
public boolean onCreateOptionsMenu(final Menu menu) {
getMenuInflater().inflate(R.menu.menu_attestation, menu);
menu.findItem(R.id.action_clear_auditee).setEnabled(isSupportedAuditee);
menu.findItem(R.id.action_clear_auditee).setEnabled(true);
canSubmitSample = potentialSupportedAuditee() && !BuildConfig.DEBUG;
menu.findItem(R.id.action_submit_sample).setEnabled(canSubmitSample);
return true;
Expand All @@ -523,7 +417,7 @@ public boolean onCreateOptionsMenu(final Menu menu) {
public boolean onPrepareOptionsMenu(final Menu menu) {
final boolean isRemoteVerifyEnabled = RemoteVerifyJob.isEnabled(this);
menu.findItem(R.id.action_enable_remote_verify)
.setEnabled(isSupportedAuditee && !isRemoteVerifyEnabled);
.setEnabled(!isRemoteVerifyEnabled);
menu.findItem(R.id.action_disable_remote_verify).setEnabled(isRemoteVerifyEnabled);
menu.findItem(R.id.action_submit_sample).setEnabled(canSubmitSample &&
!SubmitSampleJob.isScheduled(this));
Expand Down
Loading