From 7b78e35ff65390cf04cca342660bb1589e6bdec9 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 16 Jul 2024 10:59:06 +0200 Subject: [PATCH 01/12] android: Update Gradle plugin --- src/frontends/android/build.gradle | 2 +- src/frontends/android/gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontends/android/build.gradle b/src/frontends/android/build.gradle index 2b505ba48..3fa6c71da 100644 --- a/src/frontends/android/build.gradle +++ b/src/frontends/android/build.gradle @@ -4,7 +4,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:8.2.0' + classpath 'com.android.tools.build:gradle:8.5.1' } } diff --git a/src/frontends/android/gradle/wrapper/gradle-wrapper.properties b/src/frontends/android/gradle/wrapper/gradle-wrapper.properties index d219d263c..8c8c77e3f 100644 --- a/src/frontends/android/gradle/wrapper/gradle-wrapper.properties +++ b/src/frontends/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip From 8a14c20ec74bb57aa22d5126d012c57e15912b76 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 16 Jul 2024 16:36:36 +0200 Subject: [PATCH 02/12] android: Update dependencies --- src/frontends/android/app/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontends/android/app/build.gradle b/src/frontends/android/app/build.gradle index c9443ff49..7932b69a5 100644 --- a/src/frontends/android/app/build.gradle +++ b/src/frontends/android/app/build.gradle @@ -45,10 +45,10 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.lifecycle:lifecycle-process:2.7.0' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'androidx.lifecycle:lifecycle-process:2.8.3' implementation 'androidx.preference:preference:1.2.1' - implementation 'com.google.android.material:material:1.10.0' + implementation 'com.google.android.material:material:1.12.0' testImplementation 'junit:junit:4.13.2' testImplementation 'org.assertj:assertj-core:3.24.2' testImplementation 'org.mockito:mockito-core:5.8.0' From 81041b55d2e522849e77447735eaf6fbcc5c39e0 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 5 Aug 2024 11:16:39 +0200 Subject: [PATCH 03/12] android: Fix crash when opening list of apps for new profiles Fixes: 150dc5ab6401 ("android: Make selected apps read-only") --- .../org/strongswan/android/ui/VpnProfileDetailActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java index 4a6aac45f..d33a16d07 100644 --- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java +++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java @@ -380,7 +380,7 @@ public class VpnProfileDetailActivity extends AppCompatActivity { Intent intent = new Intent(VpnProfileDetailActivity.this, SelectedApplicationsActivity.class); intent.putExtra(VpnProfileDataSource.KEY_SELECTED_APPS_LIST, new ArrayList<>(mSelectedApps)); - intent.putExtra(VpnProfileDataSource.KEY_READ_ONLY, mProfile.isReadOnly()); + intent.putExtra(VpnProfileDataSource.KEY_READ_ONLY, mProfile != null && mProfile.isReadOnly()); mSelectApplications.launch(intent); } }); From 4f2e65f3d0825e6dd0869167303edcb9d1c4f3c9 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 5 Aug 2024 14:39:17 +0200 Subject: [PATCH 04/12] android: Fix label for name field in managed profiles The field is not actually optional. --- .../src/main/res/values-de/strings_managed_configuration.xml | 2 +- .../src/main/res/values-pl/strings_managed_configuration.xml | 2 +- .../src/main/res/values-ru/strings_managed_configuration.xml | 2 +- .../src/main/res/values-uk/strings_managed_configuration.xml | 2 +- .../main/res/values-zh-rCN/strings_managed_configuration.xml | 2 +- .../main/res/values-zh-rTW/strings_managed_configuration.xml | 2 +- .../app/src/main/res/values/strings_managed_configuration.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/frontends/android/app/src/main/res/values-de/strings_managed_configuration.xml b/src/frontends/android/app/src/main/res/values-de/strings_managed_configuration.xml index 6a58f62ad..b64f5461c 100644 --- a/src/frontends/android/app/src/main/res/values-de/strings_managed_configuration.xml +++ b/src/frontends/android/app/src/main/res/values-de/strings_managed_configuration.xml @@ -39,7 +39,7 @@ Unique identifier Unique identifier of the VPN profile. Version 4 UUIDs (random-generated) are recommended - @string/profile_name_label + @string/profile_name_label_simple @string/profile_name_hint @string/profile_vpn_type_label The type of client authentication used by the VPN profile diff --git a/src/frontends/android/app/src/main/res/values-pl/strings_managed_configuration.xml b/src/frontends/android/app/src/main/res/values-pl/strings_managed_configuration.xml index 6a58f62ad..b64f5461c 100644 --- a/src/frontends/android/app/src/main/res/values-pl/strings_managed_configuration.xml +++ b/src/frontends/android/app/src/main/res/values-pl/strings_managed_configuration.xml @@ -39,7 +39,7 @@ Unique identifier Unique identifier of the VPN profile. Version 4 UUIDs (random-generated) are recommended - @string/profile_name_label + @string/profile_name_label_simple @string/profile_name_hint @string/profile_vpn_type_label The type of client authentication used by the VPN profile diff --git a/src/frontends/android/app/src/main/res/values-ru/strings_managed_configuration.xml b/src/frontends/android/app/src/main/res/values-ru/strings_managed_configuration.xml index 6a58f62ad..b64f5461c 100644 --- a/src/frontends/android/app/src/main/res/values-ru/strings_managed_configuration.xml +++ b/src/frontends/android/app/src/main/res/values-ru/strings_managed_configuration.xml @@ -39,7 +39,7 @@ Unique identifier Unique identifier of the VPN profile. Version 4 UUIDs (random-generated) are recommended - @string/profile_name_label + @string/profile_name_label_simple @string/profile_name_hint @string/profile_vpn_type_label The type of client authentication used by the VPN profile diff --git a/src/frontends/android/app/src/main/res/values-uk/strings_managed_configuration.xml b/src/frontends/android/app/src/main/res/values-uk/strings_managed_configuration.xml index 6a58f62ad..b64f5461c 100644 --- a/src/frontends/android/app/src/main/res/values-uk/strings_managed_configuration.xml +++ b/src/frontends/android/app/src/main/res/values-uk/strings_managed_configuration.xml @@ -39,7 +39,7 @@ Unique identifier Unique identifier of the VPN profile. Version 4 UUIDs (random-generated) are recommended - @string/profile_name_label + @string/profile_name_label_simple @string/profile_name_hint @string/profile_vpn_type_label The type of client authentication used by the VPN profile diff --git a/src/frontends/android/app/src/main/res/values-zh-rCN/strings_managed_configuration.xml b/src/frontends/android/app/src/main/res/values-zh-rCN/strings_managed_configuration.xml index 6a58f62ad..b64f5461c 100644 --- a/src/frontends/android/app/src/main/res/values-zh-rCN/strings_managed_configuration.xml +++ b/src/frontends/android/app/src/main/res/values-zh-rCN/strings_managed_configuration.xml @@ -39,7 +39,7 @@ Unique identifier Unique identifier of the VPN profile. Version 4 UUIDs (random-generated) are recommended - @string/profile_name_label + @string/profile_name_label_simple @string/profile_name_hint @string/profile_vpn_type_label The type of client authentication used by the VPN profile diff --git a/src/frontends/android/app/src/main/res/values-zh-rTW/strings_managed_configuration.xml b/src/frontends/android/app/src/main/res/values-zh-rTW/strings_managed_configuration.xml index 6a58f62ad..b64f5461c 100644 --- a/src/frontends/android/app/src/main/res/values-zh-rTW/strings_managed_configuration.xml +++ b/src/frontends/android/app/src/main/res/values-zh-rTW/strings_managed_configuration.xml @@ -39,7 +39,7 @@ Unique identifier Unique identifier of the VPN profile. Version 4 UUIDs (random-generated) are recommended - @string/profile_name_label + @string/profile_name_label_simple @string/profile_name_hint @string/profile_vpn_type_label The type of client authentication used by the VPN profile diff --git a/src/frontends/android/app/src/main/res/values/strings_managed_configuration.xml b/src/frontends/android/app/src/main/res/values/strings_managed_configuration.xml index 6a58f62ad..b64f5461c 100644 --- a/src/frontends/android/app/src/main/res/values/strings_managed_configuration.xml +++ b/src/frontends/android/app/src/main/res/values/strings_managed_configuration.xml @@ -39,7 +39,7 @@ Unique identifier Unique identifier of the VPN profile. Version 4 UUIDs (random-generated) are recommended - @string/profile_name_label + @string/profile_name_label_simple @string/profile_name_hint @string/profile_vpn_type_label The type of client authentication used by the VPN profile From 9c4ceced1c64c57fb5243c730318fffd1139e4bd Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 30 Jul 2024 15:18:22 +0200 Subject: [PATCH 05/12] android: Declare foreground service type for VpnService instance Required for Android 14 (34). Since no other type fits we use specialUse, which also requires a new permission and a description for why we use it. --- src/frontends/android/app/src/main/AndroidManifest.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/frontends/android/app/src/main/AndroidManifest.xml b/src/frontends/android/app/src/main/AndroidManifest.xml index ec4bf65cf..e102b70d9 100644 --- a/src/frontends/android/app/src/main/AndroidManifest.xml +++ b/src/frontends/android/app/src/main/AndroidManifest.xml @@ -22,6 +22,7 @@ + @@ -176,10 +177,14 @@ + Date: Mon, 5 Aug 2024 10:35:05 +0200 Subject: [PATCH 06/12] android: Explicitly mark receiver as not exported during registration --- .../java/org/strongswan/android/logic/Scheduler.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/logic/Scheduler.java b/src/frontends/android/app/src/main/java/org/strongswan/android/logic/Scheduler.java index 7ad181bc1..7288b287a 100644 --- a/src/frontends/android/app/src/main/java/org/strongswan/android/logic/Scheduler.java +++ b/src/frontends/android/app/src/main/java/org/strongswan/android/logic/Scheduler.java @@ -16,6 +16,7 @@ package org.strongswan.android.logic; +import android.annotation.SuppressLint; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; @@ -37,6 +38,7 @@ public class Scheduler extends BroadcastReceiver private final AlarmManager mManager; private final PriorityQueue mJobs; + @SuppressLint("UnspecifiedRegisterReceiverFlag") public Scheduler(Context context) { mContext = context; @@ -45,7 +47,14 @@ public class Scheduler extends BroadcastReceiver IntentFilter filter = new IntentFilter(); filter.addAction(EXECUTE_JOB); - mContext.registerReceiver(this, filter); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) + { + mContext.registerReceiver(this, filter, Context.RECEIVER_NOT_EXPORTED); + } + else + { + mContext.registerReceiver(this, filter); + } } /** From 3286f75ffed1ef5f4b5a49d10f5080c551357729 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 5 Aug 2024 10:47:10 +0200 Subject: [PATCH 07/12] android: Use PendingIntent-version of startActivityAndCollapse() The other version has been deprecated and throws an exception when targeting Android 14+. --- .../strongswan/android/ui/VpnTileService.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnTileService.java b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnTileService.java index c49f4ba75..ac8c49ade 100644 --- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnTileService.java +++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnTileService.java @@ -16,7 +16,9 @@ package org.strongswan.android.ui; +import android.annotation.SuppressLint; import android.annotation.TargetApi; +import android.app.PendingIntent; import android.app.Service; import android.content.ComponentName; import android.content.Context; @@ -127,6 +129,7 @@ public class VpnTileService extends TileService implements VpnStateService.VpnSt return mDataSource != null ? mDataSource.getVpnProfile(uuid) : null; } + @SuppressLint("StartActivityAndCollapseDeprecated") @Override public void onClick() { @@ -177,7 +180,14 @@ public class VpnTileService extends TileService implements VpnStateService.VpnSt if (profile.getVpnType().has(VpnType.VpnTypeFeature.USER_PASS) && profile.getPassword() == null) { /* the user will have to enter the password, so collapse the drawer */ - startActivityAndCollapse(intent); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) + { + startActivityAndCollapse(PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE)); + } + else + { + startActivityAndCollapse(intent); + } } else { @@ -188,7 +198,14 @@ public class VpnTileService extends TileService implements VpnStateService.VpnSt } Intent intent = new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivityAndCollapse(intent); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) + { + startActivityAndCollapse(PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE)); + } + else + { + startActivityAndCollapse(intent); + } } @Override From 51f746161d9da2383d698d95dd2b10f69dee9970 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 5 Aug 2024 11:02:49 +0200 Subject: [PATCH 08/12] android: Add workaround for a bug preventing background service starts from TileService When targeting Android 14, we get a "Background activity launch blocked!" exception when trying to start the connection in the background (closing the drawer works). Which is apparently a bug: https://issuetracker.google.com/issues/305035828 The workaround here is kinda ugly. In particular, because it's not possible anymore since a few versions to open a dialog that allows users to directly grant the required permission to the app. We can only open the generic settings dialog where users have to search for the app and grant the permission themselves (we could add a dialog with an explanation similar to the one for the power whitelist if necessary). Hopefully this gets fixed at some point (the current beta of Android 15 still has the same bug, though). --- src/frontends/android/app/src/main/AndroidManifest.xml | 1 + .../java/org/strongswan/android/ui/VpnTileService.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/frontends/android/app/src/main/AndroidManifest.xml b/src/frontends/android/app/src/main/AndroidManifest.xml index e102b70d9..a5e6aabc2 100644 --- a/src/frontends/android/app/src/main/AndroidManifest.xml +++ b/src/frontends/android/app/src/main/AndroidManifest.xml @@ -26,6 +26,7 @@ + diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnTileService.java b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnTileService.java index ac8c49ade..05c3e2da9 100644 --- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnTileService.java +++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnTileService.java @@ -28,6 +28,7 @@ import android.content.SharedPreferences; import android.graphics.drawable.Icon; import android.os.Build; import android.os.IBinder; +import android.provider.Settings; import android.service.quicksettings.Tile; import android.service.quicksettings.TileService; @@ -191,6 +192,15 @@ public class VpnTileService extends TileService implements VpnStateService.VpnSt } else { + /* a bug in Android 14+ requires us to request this permission in + * order to start the activity from this "background" service */ + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && !Settings.canDrawOverlays(this)) + { + Intent permIntent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION); + permIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivityAndCollapse(PendingIntent.getActivity(this, 0, permIntent, PendingIntent.FLAG_IMMUTABLE)); + return; + } startActivity(intent); } return; From 01c81ca15f889c8882f0d743d8b5f1bb3d0af75c Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 5 Aug 2024 11:51:40 +0200 Subject: [PATCH 09/12] android: Replace deprecated Observer/Observable with PropertyChangeListener etc. Kinda misusing the interface as there is no specific property, but otherwise seems like a 1:1 replacement. --- .../logic/TrustedCertificateManager.java | 39 ++++++++++++++++--- .../ui/TrustedCertificateListFragment.java | 8 ++-- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/logic/TrustedCertificateManager.java b/src/frontends/android/app/src/main/java/org/strongswan/android/logic/TrustedCertificateManager.java index 257f407ff..c60419005 100644 --- a/src/frontends/android/app/src/main/java/org/strongswan/android/logic/TrustedCertificateManager.java +++ b/src/frontends/android/app/src/main/java/org/strongswan/android/logic/TrustedCertificateManager.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2015 Tobias Brunner + * Copyright (C) 2012-2024 Tobias Brunner * Copyright (C) 2012 Giuliano Grassi * Copyright (C) 2012 Ralf Sager * @@ -20,6 +20,8 @@ package org.strongswan.android.logic; import android.util.Log; +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.cert.Certificate; @@ -27,10 +29,9 @@ import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Enumeration; import java.util.Hashtable; -import java.util.Observable; import java.util.concurrent.locks.ReentrantReadWriteLock; -public class TrustedCertificateManager extends Observable +public class TrustedCertificateManager { private static final String TAG = TrustedCertificateManager.class.getSimpleName(); private final ReentrantReadWriteLock mLock = new ReentrantReadWriteLock(); @@ -38,6 +39,7 @@ public class TrustedCertificateManager extends Observable private volatile boolean mReload; private boolean mLoaded; private final ArrayList mKeyStores = new ArrayList(); + private PropertyChangeSupport mObservers = new PropertyChangeSupport(this); public enum TrustedCertificateSource { @@ -98,6 +100,35 @@ public class TrustedCertificateManager extends Observable return Singleton.mInstance; } + /** + * Add an observer for changes to the trusted certificate store. There will + * be a "storeChanged" property "change" when anything in the store changed. + * + * @param observer observer to add + */ + public void addObserver(PropertyChangeListener observer) + { + mObservers.addPropertyChangeListener(observer); + } + + /** + * Remove an observer for changes to the trusted certificate store. + * + * @param observer observer to remove + */ + public void deleteObserver(PropertyChangeListener observer) + { + mObservers.removePropertyChangeListener(observer); + } + + /** + * Use a fake property with a forced change to notify observers. + */ + private void notifyObservers() + { + mObservers.firePropertyChange("storeChanged", false, true); + } + /** * Invalidates the current load state so that the next call to load() * will force a reload of the cached CA certificates. @@ -110,7 +141,6 @@ public class TrustedCertificateManager extends Observable { Log.d(TAG, "Force reload of cached CA certificates on next load"); this.mReload = true; - this.setChanged(); this.notifyObservers(); return this; } @@ -152,7 +182,6 @@ public class TrustedCertificateManager extends Observable this.mCACerts = certs; if (!this.mLoaded) { - this.setChanged(); this.notifyObservers(); this.mLoaded = true; } diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/TrustedCertificateListFragment.java b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/TrustedCertificateListFragment.java index 3b5730773..1ceba87f7 100644 --- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/TrustedCertificateListFragment.java +++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/TrustedCertificateListFragment.java @@ -33,14 +33,14 @@ import org.strongswan.android.logic.TrustedCertificateManager.TrustedCertificate import org.strongswan.android.security.TrustedCertificateEntry; import org.strongswan.android.ui.adapter.TrustedCertificateAdapter; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Collections; import java.util.Hashtable; import java.util.List; import java.util.Map.Entry; -import java.util.Observable; -import java.util.Observer; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -249,12 +249,12 @@ public class TrustedCertificateListFragment extends ListFragment implements Load } } - private class TrustedCertificateManagerObserver implements Observer + private class TrustedCertificateManagerObserver implements PropertyChangeListener { private ForceLoadContentObserver mContentObserver = new ForceLoadContentObserver(); @Override - public void update(Observable observable, Object data) + public void propertyChange(PropertyChangeEvent evt) { mContentObserver.onChange(false); } From 880e2739856e2c921fb4a41414041fe955b1ab97 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 5 Aug 2024 14:16:51 +0200 Subject: [PATCH 10/12] android: Avoid using deprecated ViewCompat methods --- .../ui/widget/TextInputLayoutHelper.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/widget/TextInputLayoutHelper.java b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/widget/TextInputLayoutHelper.java index 59394db16..522d0b1a0 100644 --- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/widget/TextInputLayoutHelper.java +++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/widget/TextInputLayoutHelper.java @@ -16,6 +16,8 @@ package org.strongswan.android.ui.widget; +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; import android.content.Context; import android.content.res.TypedArray; import android.text.Editable; @@ -33,8 +35,6 @@ import com.google.android.material.textfield.TextInputLayout; import org.strongswan.android.R; import androidx.annotation.Nullable; -import androidx.core.view.ViewCompat; -import androidx.core.view.ViewPropertyAnimatorListenerAdapter; /** * Layout that extends {@link TextInputLayout} with a helper text @@ -113,8 +113,8 @@ public class TextInputLayoutHelper extends TextInputLayout showHelper(hasFocus); } }); - ViewCompat.setPaddingRelative(mHelperContainer, ViewCompat.getPaddingStart(text), - 0, ViewCompat.getPaddingEnd(text), text.getPaddingBottom()); + mHelperContainer.setPaddingRelative(text.getPaddingStart(), 0, + text.getPaddingEnd(), text.getPaddingBottom()); } } } @@ -158,27 +158,27 @@ public class TextInputLayoutHelper extends TextInputLayout } if (show) { - ViewCompat.animate(mHelperContainer) + mHelperContainer.animate() .alpha(1f) .setDuration(200) - .setListener(new ViewPropertyAnimatorListenerAdapter() { + .setListener(new AnimatorListenerAdapter() { @Override - public void onAnimationStart(View view) + public void onAnimationStart(Animator animation) { - view.setVisibility(View.VISIBLE); + mHelperContainer.setVisibility(View.VISIBLE); } }).start(); } else { - ViewCompat.animate(mHelperContainer) + mHelperContainer.animate() .alpha(0f) .setDuration(200) - .setListener(new ViewPropertyAnimatorListenerAdapter() { + .setListener(new AnimatorListenerAdapter() { @Override - public void onAnimationEnd(View view) + public void onAnimationEnd(Animator animation) { - view.setVisibility(View.INVISIBLE); + mHelperContainer.setVisibility(View.INVISIBLE); } }).start(); } From 6064209872491ad2adbde80a386aeea1bfa82c06 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 5 Aug 2024 14:31:32 +0200 Subject: [PATCH 11/12] android: Increase targetSdkVersion to 34 (Android 14) --- src/frontends/android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontends/android/app/build.gradle b/src/frontends/android/app/build.gradle index 7932b69a5..a467a1988 100644 --- a/src/frontends/android/app/build.gradle +++ b/src/frontends/android/app/build.gradle @@ -7,7 +7,7 @@ android { applicationId "org.strongswan.android" compileSdk 34 minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 82 versionName "2.5.1" From fe1c9dedb76755a512f34b220724e4bb8bf50340 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 5 Aug 2024 14:52:30 +0200 Subject: [PATCH 12/12] android: New release after updating target SDK and fixing some compatibility issues --- src/frontends/android/app/build.gradle | 4 ++-- .../app/src/main/play/release-notes/de-DE/default.txt | 6 ++++++ .../app/src/main/play/release-notes/en-US/default.txt | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/frontends/android/app/build.gradle b/src/frontends/android/app/build.gradle index a467a1988..cab3a6c6d 100644 --- a/src/frontends/android/app/build.gradle +++ b/src/frontends/android/app/build.gradle @@ -9,8 +9,8 @@ android { minSdkVersion 21 targetSdkVersion 34 - versionCode 82 - versionName "2.5.1" + versionCode 84 + versionName "2.5.2" externalNativeBuild { ndkBuild { diff --git a/src/frontends/android/app/src/main/play/release-notes/de-DE/default.txt b/src/frontends/android/app/src/main/play/release-notes/de-DE/default.txt index bbaa93aed..5521e02a9 100644 --- a/src/frontends/android/app/src/main/play/release-notes/de-DE/default.txt +++ b/src/frontends/android/app/src/main/play/release-notes/de-DE/default.txt @@ -1,3 +1,9 @@ +# 2.5.2 # + +- Ziel-SDK auf Android 14 erhöht +- Wegen eines Bugs in Android 14 ist eine zusätzliche Permission ist nötig, um von der Status-Kachel eine Verbindung im Hintergrund zu starten +- Fixt einen Crash beim Öffnen der Liste installierter Apps in neuen Profilen + # 2.5.1 # - Fix für existierende Verknüpfungen und Automatisierung via Intents diff --git a/src/frontends/android/app/src/main/play/release-notes/en-US/default.txt b/src/frontends/android/app/src/main/play/release-notes/en-US/default.txt index b5179fea9..0dc823127 100644 --- a/src/frontends/android/app/src/main/play/release-notes/en-US/default.txt +++ b/src/frontends/android/app/src/main/play/release-notes/en-US/default.txt @@ -1,3 +1,9 @@ +# 2.5.2 # + +- Increased target SDK to Android 14 +- Due to a bug in Android 14, a new permission is necessary to start a profile in the background from the status tile +- Fix crash when listing installed apps for new profiles + # 2.5.1 # - Fix for existing shortcuts and automation via Intents