This document outlines the changes made to support Android 35 (API level 35) and upgrade to FlyBuy SDK 2.15.x in the development app.
The upgrade to Android 35 required several key changes to maintain compatibility with modern Android development practices and security requirements.
File: development-app/android/build.gradle
- Updated
compileSdkVersionfrom 34 to 35 - Updated
targetSdkVersionfrom 34 to 35 - Updated
flybuyVersionfrom "2.14.3" to "2.15.0"
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 26
compileSdkVersion = 35 // Updated from 34
targetSdkVersion = 35 // Updated from 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
flybuyVersion = "2.15.0" // Updated from "2.14.3"
}File: development-app/android/app/build.gradle
Added several optimizations and compatibility features:
-
Vector Drawable Support
// Support for vector drawables in older API levels vectorDrawables.useSupportLibrary = true
-
Java 17 Compatibility
compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 coreLibraryDesugaringEnabled true } kotlinOptions { jvmTarget = '17' }
-
R8 Optimizations for Release Builds
buildTypes { release { // Enable R8 optimizations shrinkResources enableProguardInReleaseBuilds } }
-
Packaging Optimizations
packagingOptions { pickFirst '**/libc++_shared.so' pickFirst '**/libjsc.so' }
-
Core Library Desugaring
dependencies { // Core library desugaring for Java 8+ language features coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' }
File: development-app/android/gradle.properties
Added performance and optimization flags:
# Enable R8 full mode for better optimization with target SDK 35
android.enableR8.fullMode=true
# Enable support for the new resource processing in Android Gradle Plugin
android.enableResourceOptimizations=trueFile: development-app/android/app/src/main/AndroidManifest.xml
-
Updated Permissions for Android 12+ (API 31+)
<!-- Notification permission for Android 13+ (API 33+) --> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <!-- Foreground service permission for Android 14+ (API 34+) --> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" /> <!-- For Android 12+ (API 31+) Bluetooth permissions --> <uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" /> <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" /> <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
-
Data Backup and Extraction Rules
<application android:dataExtractionRules="@xml/data_extraction_rules" android:fullBackupContent="@xml/backup_rules" tools:replace="android:dataExtractionRules,android:fullBackupContent">
File: development-app/android/app/src/main/res/xml/backup_rules.xml (New)
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<!-- Exclude sensitive data from backup -->
<exclude domain="sharedpref" path="FlybuyPrefs" />
<exclude domain="database" path="flybuy.db" />
</full-backup-content>File: development-app/android/app/src/main/res/xml/data_extraction_rules.xml (New)
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<!-- Exclude sensitive data from cloud backup -->
<exclude domain="sharedpref" path="FlybuyPrefs" />
<exclude domain="database" path="flybuy.db" />
</cloud-backup>
<device-transfer>
<!-- Allow all data for device transfer -->
<include domain="file" path="." />
<exclude domain="sharedpref" path="FlybuyPrefs" />
</device-transfer>
</data-extraction-rules>File: development-app/android/app/proguard-rules.pro
Added comprehensive rules for Android 35 compatibility:
-
FlyBuy SDK Protection
# Keep Flybuy SDK classes -keep class com.radiusnetworks.flybuy.** { *; } -dontwarn com.radiusnetworks.flybuy.** -
React Native Bridge Methods
# Keep native method names for React Native bridges -keepclassmembers class * { @com.facebook.react.bridge.ReactMethod <methods>; } -
Android 14+ Compatibility
# Keep location and notification related classes for Android 14+ compatibility -keep class androidx.core.app.NotificationCompat** { *; } -keep class androidx.work.** { *; }
- Added granular foreground service permissions required by Android 14+
- Updated Bluetooth permissions for Android 12+ compatibility
- Added notification permissions for Android 13+
- Implemented data extraction rules to protect sensitive FlyBuy data
- Added backup rules to exclude sensitive preferences and databases
- Enabled R8 full mode for better code optimization and security
- Java 17 compatibility for modern language features
- Core library desugaring for backward compatibility
- Resource optimization flags for build performance
- Updated to latest SDK versions (35)
- FlyBuy SDK updated to 2.15.0
- Enhanced ProGuard rules for better optimization
- No code changes required in React Native JavaScript layer
- Android native modules automatically benefit from improved security
- Build times may improve due to R8 optimizations
- Enhanced security with proper data backup exclusions
- Better performance through optimized builds
- Compliance with latest Android privacy requirements
- Android 35 (API level 35) builds successfully
- All FlyBuy SDK features work correctly
- ProGuard rules don't break functionality
- Permissions properly requested at runtime
- Clean builds complete without errors
- R8 optimizations work correctly
- All dependencies resolve properly