Skip to content
Merged
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
26 changes: 15 additions & 11 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<trusted-key id="0CC641C3A62453AB390066C4A41F13C999945293" group="commons-logging" name="commons-logging" version="1.2"/>
<trusted-key id="0D35D3F60078655126908E8AF3D1600878E85A3D" group="io.netty"/>
<trusted-key id="0E225917414670F4442C250DFD533C07C264648F">
<trusting group="androidx.core"/>
<trusting group="androidx.databinding"/>
<trusting group="^com[.]android($|([.].*))" regex="true"/>
</trusted-key>
Expand Down Expand Up @@ -575,6 +576,11 @@
<sha256 value="e1bd22bbcf5cee3a992dedb7d2d3c3b31c9f761c01e56d00ea443c8aaa981182" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="androidx.core" name="core" version="1.18.0">
<artifact name="core-1.18.0.aar">
<sha256 value="311d83ac67d394076ec21d12ed2d10a44b59cb2929b7dce00e5a90a93842e37d" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="androidx.core" name="core" version="1.6.0">
<artifact name="core-1.6.0.aar">
<sha256 value="875dbec888c91b05521575fd180cc08824d2c4d12b10b0261b4f9d6825214ef1" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -8168,17 +8174,15 @@
<sha256 value="034ef1f9997502e97c93473e440aa3956e88e83571bd0e680e160821b6569766" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.diffplug.spotless" name="spotless-lib" version="4.5.0">
<artifact name="spotless-lib-4.5.0.jar">
<sha256 value="98cd9fe64b6398da7a90f2fd906ef0abc1a0e6d66f519fe6af08a585d7bb6da9"
origin="Generated by Gradle" />
</artifact>
<artifact name="spotless-lib-4.5.0.module">
<sha256 value="02536d21a82b75a5a639a3cd4160a0839a1a9c35f2dc4c0ff45241b4769f5d35"
origin="Generated by Gradle" />
</artifact>
</component>
<component group="com.diffplug.spotless" name="spotless-lib-extra" version="3.0.2">
<component group="com.diffplug.spotless" name="spotless-lib" version="4.5.0">
<artifact name="spotless-lib-4.5.0.jar">
<sha256 value="98cd9fe64b6398da7a90f2fd906ef0abc1a0e6d66f519fe6af08a585d7bb6da9" origin="Generated by Gradle"/>
</artifact>
<artifact name="spotless-lib-4.5.0.module">
<sha256 value="02536d21a82b75a5a639a3cd4160a0839a1a9c35f2dc4c0ff45241b4769f5d35" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.diffplug.spotless" name="spotless-lib-extra" version="3.0.2">
<artifact name="spotless-lib-extra-3.0.2.jar">
<sha256 value="b0e77746d633d445e78489ac3d08ad2ea1b3537c4d064e4abe46cc42d62303eb" origin="Generated by Gradle"/>
</artifact>
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ dependencies {
implementation 'androidx.annotation:annotation:1.9.1'
compileOnly 'com.google.code.findbugs:annotations:3.0.1'

implementation "androidx.core:core-ktx:1.17.0"
implementation "androidx.core:core-ktx:1.18.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'com.google.guava:guava:33.5.0-jre'

Expand Down Expand Up @@ -143,7 +143,7 @@ android {
}

defaultConfig {
minSdkVersion 21
minSdkVersion 23

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArgument "TEST_SERVER_URL", "${NC_TEST_SERVER_BASEURL}"
Expand Down
5 changes: 1 addition & 4 deletions library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
TLS client certificate when context is not able to start an Activity. -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<application
android:usesCleartextTraffic="true"
tools:targetApi="m">

<application android:usesCleartextTraffic="true">
<activity
android:name=".common.network.SelectClientCertificateHelperActivity"
android:exported="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,35 +510,33 @@ private static int createDecisionId(@NonNull AKMDecision decision) {
}

private void startActivityNotification(@NonNull Intent intent, int decisionId, @NonNull String message) {
int flags = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
flags |= PendingIntent.FLAG_IMMUTABLE;
}
final PendingIntent call = PendingIntent.getActivity(context, 0, intent, flags);
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel(
NOTIFICATION_CHANNEL_ID,
context.getString(R.string.notification_channel_name),
NotificationManager.IMPORTANCE_DEFAULT);
notificationManager.createNotificationChannel(channel);
}
final Notification notification = new NotificationCompat
.Builder(context, NOTIFICATION_CHANNEL_ID)
.setContentTitle(context.getString(R.string.notification_title_select_client_cert))
.setContentText(message)
.setTicker(message)
.setSmallIcon(android.R.drawable.ic_lock_lock)
.setWhen(System.currentTimeMillis())
.setContentIntent(call)
.setAutoCancel(true)
.build();

if (ActivityCompat.checkSelfPermission(context, POST_NOTIFICATIONS) == PERMISSION_GRANTED) {
notificationManager.notify(NOTIFICATION_ID + decisionId, notification);
} else {
Log_OC.w(TAG, "Cannot send notification due to missing permission.");
}
int flags = 0;
flags |= PendingIntent.FLAG_IMMUTABLE;
final PendingIntent call = PendingIntent.getActivity(context, 0, intent, flags);
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel(
NOTIFICATION_CHANNEL_ID,
context.getString(R.string.notification_channel_name),
NotificationManager.IMPORTANCE_DEFAULT);
notificationManager.createNotificationChannel(channel);
}
final Notification notification = new NotificationCompat
.Builder(context, NOTIFICATION_CHANNEL_ID)
.setContentTitle(context.getString(R.string.notification_title_select_client_cert))
.setContentText(message)
.setTicker(message)
.setSmallIcon(android.R.drawable.ic_lock_lock)
.setWhen(System.currentTimeMillis())
.setContentIntent(call)
.setAutoCancel(true)
.build();

if (ActivityCompat.checkSelfPermission(context, POST_NOTIFICATIONS) == PERMISSION_GRANTED) {
notificationManager.notify(NOTIFICATION_ID + decisionId, notification);
} else {
Log_OC.w(TAG, "Cannot send notification due to missing permission.");
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion sample_client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
}

defaultConfig {
minSdkVersion 21
minSdkVersion 23
targetSdkVersion 36

multiDexEnabled = true
Expand Down
Loading