General Update
Updated necessary dependencies (libraries, AGP, Gradle) and build and property files to the latest version, due the lack of updates since some years. Prepares support for modern Android platforms > 28
The new dependencies require to install the latest Android Studio build, i.e. side-by-side via JetBrains Toolbox (suggested), via a package manager (apt, brew, winget, etc.), or manually.
For the version dependencies mentioned below Android Studio Narwhal Feature Drop 2025.1.2 Nightly is highly recommended. Also, the JVM used inside Android Studio and Gradle scripts should be aligned (use AGP migration helper or project settings), i.e. by using the bundled JVM of IntelliJ.
Some errors must be fixed on first project import using Android Studio Narwhal Feature Drop. DO NOT USE OLD ANDROID STUDIO BUILDS due incompatibilities and end of life policy (critical CVS's may not be fixed).
A side-by-side installation and a optional branch - during migration and testing - can help.
Selected Changes:
- Updated AGP to from 3.4.2 to 8.10.0
- Updated Gradle from 5.2.1-all to 8.14-all
- Updated minSdk from 14 to 16 (required)
- Updated
build.gradleand different sections:pluginsinstead apply,namespaceinstead package name,lintinstead of lintOptions, equal sign to assign properties - Updated
buildFeaturesandsourceSets(required for newbuildConfigand to supportaidlin the future; otherwise .aidl files are ignored) - Updated old alpha and beta dependencies in
build.gradleto their release variants - Updated outdated
android.arch.work:work-runtime:1.0.1withandroidx.work:work-runtime:2.0.1 - Enabled
multiDexand desugaring (backports modern Java 7+ core functions and selected API's to old devices during build time) inbuild.gradleandAppclass - Removed deprecated
mavenCentral(); addedgradlePluginPortal() - Replaced
switchblocks with non-constant resource values with if-else if-else(enforced with newer build tools) - Replaced 3 private color resources due Theme change (now in
colors.xml) - Fixed minus with dash in
strings.xml - Added required
exportattribute to selected activity definitions inAndroidManifest.xml - Added default
CookieHandler(not set on all old systems) to App class - Replaced
TargetApiannotations with newerRequiresApiannotation; addedDiscouragedPrivateApiin CompatUtils - Minor Cleancode: unused imports, dead code
Environment Android Studio Narwhal Feature Drop 2025.1.2 Nightly Build #AI-251.25410.109.2512.13515449, built on May 19, 2025 Runtime version: 21.0.6+-13391695-b895.109 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. (built-in) OS: Windows 11 64-bit (de) / Build 24H2
Second commit ( Conscrypt)
Conscrypt is a Java port of the OpenSSL library maintained by Google.
See https://conscrypt.org/ or https://github.com/google/conscrypt for more details.
It replaces the default JSSE (Java Secure Socket Extension) provider on old Android versions prior to Android Q (API 29, where Conscrypt often became the default) or for specific needs.
Using Conscrypt provides modern TLS features without requiring Google Play Services, which is beneficial for broader device compatibility. The GMS implementation of ProviderInstaller also requires a minimum SDK version of 25-33, where Conscrypt is backward compatible with SDK 16 (suggested is in between SDK 19+ due many unfixed security threads).
The implementation specifically targets versions older than N_MR1 (Android 7.1.1, API 25) where older TLS implementations might lack support for modern protocols or ciphers required by some servers (e.g., TLS 1.3, certain cipher suites).
- Independent of Google Play Services (i.e. supports devices with custom roms, devices with pure AOSP implementations without Google services)
- Can be updated via Gradle dependency to the latest version, per build
- Backward compatible with older Android versions (minSdk 16, suggested is minSdk 19+)
- Supports modern TLS 1.3 features, cipher suites, protocols, and algorithms
- Optimized for Android: Uses BoringSSL, the same cryptographic library used in Chrome
- Can be used with
SSLContextbased APIs likeHttpsUrlConnection, or external frameworks like OkHttp 3.x
Notes:
- Does not update web views, or other APIs outside of the current process
- Does not update
SSLCertificateSocketFactory -
Conscryptwill not update any outdated certificates (i.e. expired or revoked CAs). Certificates (i.e. PEM files) can be provided as assets and handled by a custom trust manager (follow up commit).
Let's Encrypt backport support needs intensive testing due SNI support was fully implemented starting with KitKat (API 19). Normally Conscrypt falls back to its own SNI implementation if running on older platforms. Just remove the NetUtils.installLetsEncryptCaIfNeeded(this); in App#onCreate() to disable the custom CA support or change the version check inside NetUtils#installLetsEncryptCaIfNeeded(Context) to support only devices starting with SDK 19 (Kitkat) and prior SDK 25 (Nougat MR1):
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1) {
...
}