Skip to content

Commit 05cb3ad

Browse files
committed
raise minimum API level to 33 (Android 13)
Android 13 is the oldest release with security support and also the oldest release supported by our App Store.
1 parent b22b356 commit 05cb3ad

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ android {
4747

4848
defaultConfig {
4949
applicationId = "app.attestation.auditor"
50-
minSdk = 31
50+
minSdk = 33
5151
targetSdk = 35
5252
versionCode = 89
5353
versionName = versionCode.toString()

app/src/main/java/app/attestation/auditor/AttestationProtocol.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,15 +1295,6 @@ static Certificate[] getCertificateChain(final KeyStore keyStore, final String a
12951295
return result;
12961296
}
12971297

1298-
@SuppressWarnings("deprecation")
1299-
static ApplicationInfo getApplicationInfo(final PackageManager pm, final String packageName,
1300-
final int flags) throws PackageManager.NameNotFoundException {
1301-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
1302-
return pm.getApplicationInfo(packageName, flags);
1303-
}
1304-
return pm.getApplicationInfo(packageName, PackageManager.ApplicationInfoFlags.of(flags));
1305-
}
1306-
13071298
static AttestationResult generateSerialized(final Context context, final byte[] challengeMessage,
13081299
String index, final String statePrefix) throws GeneralSecurityException, IOException {
13091300
if (challengeMessage.length < CHALLENGE_MESSAGE_LENGTH) {
@@ -1406,7 +1397,7 @@ static AttestationResult generateSerialized(final Context context, final byte[]
14061397
if (activeAdmins != null) {
14071398
for (final ComponentName name : activeAdmins) {
14081399
try {
1409-
final ApplicationInfo info = getApplicationInfo(pm, name.getPackageName(), 0);
1400+
final ApplicationInfo info = pm.getApplicationInfo(name.getPackageName(), PackageManager.ApplicationInfoFlags.of(0));
14101401
if ((info.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
14111402
deviceAdminNonSystem = true;
14121403
}

app/src/main/java/app/attestation/auditor/RemoteVerifyJob.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ static void schedule(final Context context, int interval) {
120120
.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
121121
.setEstimatedNetworkBytes(ESTIMATED_DOWNLOAD_BYTES, ESTIMATED_UPLOAD_BYTES);
122122
builder.setExpedited(true);
123-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
124-
builder.setPriority(JobInfo.PRIORITY_MAX);
125-
}
123+
builder.setPriority(JobInfo.PRIORITY_MAX);
126124
if (scheduler.schedule(builder.build()) == JobScheduler.RESULT_FAILURE) {
127125
throw new RuntimeException("job schedule failed");
128126
}

0 commit comments

Comments
 (0)