diff --git a/.idea/modules.xml b/.idea/modules.xml
index 1ce653d..35fa646 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -4,7 +4,7 @@
-
+
diff --git a/android/build.gradle b/android/build.gradle
index 49caf41..19bf452 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -1,15 +1,15 @@
-group 'cloud.dragonx.plugin.flutter.dji'
-version '1.0-SNAPSHOT'
+group "cloud.dragonx.plugin.flutter.dji"
+version "1.0-SNAPSHOT"
buildscript {
- ext.kotlin_version = '1.5.31'
+ ext.kotlin_version = "1.6.20"
repositories {
google()
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:7.0.2'
+ classpath "com.android.tools.build:gradle:7.0.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
}
@@ -22,13 +22,13 @@ rootProject.allprojects {
}
}
-apply plugin: 'com.android.library'
-apply plugin: 'kotlin-android'
-apply plugin: 'kotlinx-serialization'
+apply plugin: "com.android.library"
+apply plugin: "kotlin-android"
+apply plugin: "kotlinx-serialization"
android {
compileSdkVersion 31
-// useLibrary 'org.apache.http.legacy'
+ useLibrary "org.apache.http.legacy"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
@@ -36,25 +36,25 @@ android {
}
kotlinOptions {
- jvmTarget = '1.8'
+ jvmTarget = "1.8"
}
sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
+ main.java.srcDirs += "src/main/kotlin"
}
defaultConfig {
- minSdkVersion 24
- targetSdkVersion 30
+ minSdkVersion 19
+ targetSdkVersion 31
+
multiDexEnabled true
-// ndk {
-// abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'mips', 'mips64', 'arm64-v8a'
-// }
- }
-// dexOptions {
-// javaMaxHeapSize "4g"
-// }
+ ndk {
+ // On x86 devices that run Android API 23 or above, if the application is targeted with API 23 or
+ // above, FFmpeg lib might lead to runtime crashes or warnings.
+ abiFilters 'armeabi-v7a', 'arm64-v8a'
+ }
+ }
packagingOptions {
doNotStrip "*/*/libdjivideo.so"
@@ -77,60 +77,70 @@ android {
doNotStrip "*/*/libAMapSDK_MAP_v6_9_2.so"
doNotStrip "*/*/libDJIMOP.so"
doNotStrip "*/*/libDJISDKLOGJNI.so"
- exclude 'META-INF/rxjava.properties'
- exclude 'assets/location_map_gps_locked.png'
- exclude 'assets/location_map_gps_3d.png'
+
+ pickFirst "lib/*/libstlport_shared.so"
+ pickFirst "lib/*/libRoadLineRebuildAPI.so"
+ pickFirst "lib/*/libGNaviUtils.so"
+ pickFirst "lib/*/libGNaviMapex.so"
+ pickFirst "lib/*/libGNaviData.so"
+ pickFirst "lib/*/libGNaviMap.so"
+ pickFirst "lib/*/libGNaviSearch.so"
+ pickFirst "lib/*/libDJIFlySafeCore.so"
+ pickFirst "lib/*/libdjifs_jni.so"
+ pickFirst "lib/*/libsfjni.so"
+ exclude "META-INF/proguard/okhttp3.pro"
+ exclude "META-INF/rxjava.properties"
+ exclude "assets/location_map_gps_locked.png"
+ exclude "assets/location_map_gps_3d.png"
}
}
dependencies {
- implementation 'androidx.multidex:multidex:2.0.1'
-
- implementation 'androidx.core:core-ktx:1.6.0'
- implementation 'androidx.appcompat:appcompat:1.3.1'
- implementation 'com.google.android.material:material:1.4.0'
- implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
-// testImplementation 'junit:junit:4.+'
- androidTestImplementation 'androidx.test.ext:junit:1.1.3'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
-
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
- implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0'
-
- implementation('com.dji:dji-sdk:4.16.1', {
- /**
- * Uncomment the "library-anti-distortion" if your app does not need Anti Distortion for Mavic 2 Pro and Mavic 2 Zoom.
- * Uncomment the "fly-safe-database" if you need database for release, or we will download it when DJISDKManager.getInstance().registerApp
- * is called.
- * Both will greatly reducing the size of the APK.
- */
- exclude module: 'library-anti-distortion'
- //exclude module: 'fly-safe-database'
+ implementation ("com.dji:dji-sdk:4.16.1", {
+ exclude module: "library-anti-distortion"
+ exclude module: "fly-safe-database"
+ })
+ implementation ("com.dji:dji-uxsdk:4.16", {
+ exclude module: "dji-sdk"
+ exclude group: "com.amap.api"
})
- compileOnly 'com.dji:dji-sdk-provided:4.16.1'
+ compileOnly ("com.dji:dji-sdk-provided:4.16.1")
// https://stackoverflow.com/questions/58281124/layout-constraintbottom-totopof-not-found
- implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
-
- implementation 'androidx.appcompat:appcompat:1.3.1'
- implementation 'androidx.core:core:1.6.0'
- implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
- implementation 'androidx.recyclerview:recyclerview:1.2.1'
- implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
- implementation 'androidx.annotation:annotation:1.2.0'
- implementation 'com.jakewharton:butterknife:10.0.0'
- annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
- implementation "androidx.core:core-ktx:1.6.0"
- implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
- implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0"
- implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0"
-
- implementation 'androidx.lifecycle:lifecycle-common-java8:2.3.1'
- implementation 'androidx.lifecycle:lifecycle-runtime:2.3.1'
- implementation 'androidx.lifecycle:lifecycle-process:2.3.1'
- implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
-
-// implementation 'androidx.test:runner:1.4.0@aar'
-
+ implementation "androidx.constraintlayout:constraintlayout:2.1.4"
+
+ implementation "androidx.multidex:multidex:2.0.1"
+ implementation "androidx.appcompat:appcompat:1.4.2"
+ implementation "com.google.android.material:material:1.6.1"
+ implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0"
+ implementation "androidx.annotation:annotation:1.3.0"
+
+ // Kotlin Coroutines
+ implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
+ implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2"
+
+ // Ktx
+ implementation "androidx.activity:activity-ktx:1.4.0"
+ implementation "androidx.core:core-ktx:1.8.0"
+ implementation "androidx.fragment:fragment-ktx:1.4.1"
+ implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.1"
+ implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1"
+ implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.1"
+ implementation "androidx.lifecycle:lifecycle-process:2.4.1"
+
+ // Lifecycle, LiveData, ViewModel
+ implementation "androidx.recyclerview:recyclerview:1.2.1"
+ implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
+ implementation "androidx.lifecycle:lifecycle-common-java8:2.4.1"
+
+ // ButterKnife
+ implementation "com.jakewharton:butterknife:10.0.0"
+ annotationProcessor "com.jakewharton:butterknife-compiler:10.0.0"
+
+ // Junit
+ testImplementation "junit:junit:4+"
+ androidTestImplementation "androidx.test.ext:junit:1.1.3"
+ androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
+
+ implementation "com.squareup:otto:1.3.8"
}
diff --git a/android/proguard-rules.pro b/android/proguard-rules.pro
deleted file mode 100644
index f31e1a1..0000000
--- a/android/proguard-rules.pro
+++ /dev/null
@@ -1,90 +0,0 @@
--keepattributes Exceptions,InnerClasses,*Annotation*,Signature,EnclosingMethod
-
--dontoptimize
--dontwarn okio.**
--dontwarn org.bouncycastle.**
--dontwarn dji.**
--dontwarn com.dji.**
--dontwarn sun.**
--dontwarn java.**
--dontwarn com.amap.api.**
--dontwarn com.here.**
--dontwarn com.mapbox.**
--dontwarn okhttp3.**
--dontwarn retrofit2.**
-
--keepclassmembers enum * {
- public static ;
-}
-
--keepnames class * implements java.io.Serializable
--keepclassmembers class * implements java.io.Serializable {
- static final long serialVersionUID;
- private static final java.io.ObjectStreamField[] serialPersistentFields;
- !static !transient ;
- private void writeObject(java.io.ObjectOutputStream);
- private void readObject(java.io.ObjectInputStream);
- java.lang.Object writeReplace();
- java.lang.Object readResolve();
-}
--keep class * extends android.os.Parcelable {
- public static final android.os.Parcelable$Creator *;
-}
-
--keep,allowshrinking class * extends dji.publics.DJIUI.** {
- public ;
-}
-
--keep class net.sqlcipher.** { *; }
-
--keep class net.sqlcipher.database.* { *; }
-
--keepclassmembers class dji.* { *; }
-
--keep class com.dji.** { *; }
-
--keep class com.google.** { *; }
-
--keep class org.bouncycastle.** { *; }
-
--keep,allowshrinking class org.** { *; }
-
--keep class com.squareup.wire.** { *; }
-
--keep class com.secneo.** { *; }
-
--keep class org.greenrobot.eventbus.**{*;}
-
--keep class it.sauronsoftware.ftp4j.**{*;}
-
--keepclasseswithmembers,allowshrinking class * {
- native ;
-}
-
--keepclassmembers class * extends android.app.Service
--keepclassmembers public class * extends android.view.View {
- void set*(***);
- *** get*();
-}
--keepclassmembers class * extends android.app.Activity {
- public void *(android.view.View);
-}
--keep class androidx.** { *; }
--keep class android.media.** { *; }
--keep class okio.** { *; }
--keep class com.lmax.disruptor.** { *; }
--keep class com.qx.wz.dj.rtcm.* { *; }
-
--dontwarn com.mapbox.services.android.location.LostLocationEngine
--dontwarn com.mapbox.services.android.location.MockLocationEngine
--keepclassmembers class android.arch.** { *; }
--keep class android.arch.** { *; }
--dontwarn android.arch.**
-
--keep class org.apache.commons.** {*;}
-
-
-#<------------ utmiss config start------------>
--keep class dji.sdk.utmiss.** { *; }
--keep class utmisslib.** { *; }
-#<------------ utmiss config end------------>
\ No newline at end of file
diff --git a/android/src/main/kotlin/cloud/dragonx/plugin/flutter/dji/DjiPlugin.kt b/android/src/main/kotlin/cloud/dragonx/plugin/flutter/dji/DjiPlugin.kt
index 10fd91e..97358aa 100644
--- a/android/src/main/kotlin/cloud/dragonx/plugin/flutter/dji/DjiPlugin.kt
+++ b/android/src/main/kotlin/cloud/dragonx/plugin/flutter/dji/DjiPlugin.kt
@@ -21,7 +21,6 @@ import dji.common.util.CommonCallbacks
import dji.sdk.base.BaseComponent
import dji.sdk.base.BaseProduct
import dji.sdk.base.BaseProduct.ComponentKey
-import dji.sdk.camera.VideoFeeder
import dji.sdk.flightcontroller.FlightController
import dji.sdk.media.DownloadListener
import dji.sdk.media.MediaFile
@@ -37,6 +36,7 @@ import dji.sdk.products.Aircraft
import dji.sdk.sdkmanager.DJISDKInitEvent
import dji.sdk.sdkmanager.DJISDKManager
import dji.sdk.sdkmanager.DJISDKManager.SDKManagerCallback
+import dji.sdk.camera.VideoFeeder
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.embedding.engine.plugins.activity.ActivityAware
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
@@ -48,8 +48,7 @@ import kotlinx.serialization.json.Json
import java.io.File
import java.nio.ByteBuffer
-
- /** DjiPlugin */
+/** DjiPlugin */
class DjiPlugin: FlutterPlugin, Messages.DjiHostApi, ActivityAware {
/// The MethodChannel that will the communication between Flutter and native Android
@@ -70,13 +69,21 @@ class DjiPlugin: FlutterPlugin, Messages.DjiHostApi, ActivityAware {
private var drone: Aircraft? = null
private var droneCurrentLocation: LocationCoordinate3D? = null // Note: this is different from DJI SDK iOS where CLLocation.coordinate is used (LocationCoordinate3D in dji-android is the same as CLLocation.coordinate in dji-ios).
private var mediaFileList: MutableList = ArrayList()
+
private var videoDataListener: VideoFeeder.VideoDataListener? = null
+// private lateinit var sourceListener: VideoFeeder.PhysicalSourceListener
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
Messages.DjiHostApi.setup(flutterPluginBinding.binaryMessenger, this)
fltDjiFlutterApi = Messages.DjiFlutterApi(flutterPluginBinding.binaryMessenger)
this.djiPluginContext = flutterPluginBinding.applicationContext
+
+ // Preparing the Video Feed Listener
+ // Note: this must come here, and not inside the videoFeedStart method, because otherwise it would trigger a "class not found" exception.
+ videoDataListener = VideoFeeder.VideoDataListener { bytes, _ ->
+ _fltSendVideo(bytes)
+ }
}
override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
@@ -750,20 +757,30 @@ class DjiPlugin: FlutterPlugin, Messages.DjiHostApi, ActivityAware {
/** Video Feed Methods **/
override fun videoFeedStart() {
- if (videoDataListener == null) {
- videoDataListener = VideoFeeder.VideoDataListener { bytes, _ ->
- _fltSendVideo(bytes)
- }
- }
+// sourceListener = VideoFeeder.PhysicalSourceListener { videoFeed, newPhysicalSource ->
+// if (videoFeed === VideoFeeder.getInstance().primaryVideoFeed) {
+// Log.d(TAG, "Video Feed - Primary Source: $newPhysicalSource")
+// }
+// }
+// VideoFeeder.getInstance().addPhysicalSourceListener(sourceListener)
+
+// if (videoDataListener == null) {
+// videoDataListener = VideoFeeder.VideoDataListener { bytes, _ ->
+// _fltSendVideo(bytes)
+// }
+// }
+
videoDataListener?.let {
VideoFeeder.getInstance()?.primaryVideoFeed?.addVideoDataListener(it)
}
}
override fun videoFeedStop() {
- videoDataListener?.let {
- VideoFeeder.getInstance()?.primaryVideoFeed?.removeVideoDataListener(it)
- }
+// videoDataListener?.let {
+// VideoFeeder.getInstance()?.primaryVideoFeed?.removeVideoDataListener(it)
+// }
+
+ VideoFeeder.getInstance()?.primaryVideoFeed?.listeners?.clear()
}
}
diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
index 006307e..6a47ad8 100644
--- a/example/android/app/build.gradle
+++ b/example/android/app/build.gradle
@@ -1,28 +1,28 @@
def localProperties = new Properties()
-def localPropertiesFile = rootProject.file('local.properties')
+def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
- localPropertiesFile.withReader('UTF-8') { reader ->
+ localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}
-def flutterRoot = localProperties.getProperty('flutter.sdk')
+def flutterRoot = localProperties.getProperty("flutter.sdk")
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
-def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
+def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
- flutterVersionCode = '1'
+ flutterVersionCode = "1"
}
-def flutterVersionName = localProperties.getProperty('flutter.versionName')
+def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
- flutterVersionName = '1.0'
+ flutterVersionName = "1.0"
}
-apply plugin: 'com.android.application'
-apply plugin: 'kotlin-android'
+apply plugin: "com.android.application"
+apply plugin: "kotlin-android"
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
@@ -34,25 +34,28 @@ android {
}
kotlinOptions {
- jvmTarget = '1.8'
+ jvmTarget = "1.8"
}
sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
+ main.java.srcDirs += "src/main/kotlin"
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "cloud.dragonx.plugin.flutter.djiExample"
minSdkVersion 24
- targetSdkVersion 30
+ targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
-// ndk {
-// abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'mips', 'mips64', 'arm64-v8a'
-// }
+
+ ndk {
+ // On x86 devices that run Android API 23 or above, if the application is targeted with API 23 or
+ // above, FFmpeg lib might lead to runtime crashes or warnings.
+ abiFilters 'armeabi-v7a', 'arm64-v8a'
+ }
}
buildTypes {
@@ -61,88 +64,33 @@ android {
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
-// minifyEnabled true
-// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ // minifyEnabled true
+ // proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
debug {
-// shrinkResources false
-// minifyEnabled false
-// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ shrinkResources false
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
-// dexOptions {
-// javaMaxHeapSize "4g"
-// }
-
packagingOptions {
-// doNotStrip "*/*/libdjivideo.so"
-// doNotStrip "*/*/libSDKRelativeJNI.so"
-// doNotStrip "*/*/libFlyForbid.so"
-// doNotStrip "*/*/libduml_vision_bokeh.so"
-// doNotStrip "*/*/libyuv2.so"
-// doNotStrip "*/*/libGroudStation.so"
-// doNotStrip "*/*/libFRCorkscrew.so"
-// doNotStrip "*/*/libUpgradeVerify.so"
-// doNotStrip "*/*/libFR.so"
-// doNotStrip "*/*/libDJIFlySafeCore.so"
-// doNotStrip "*/*/libdjifs_jni.so"
-// doNotStrip "*/*/libsfjni.so"
-// doNotStrip "*/*/libDJICommonJNI.so"
-// doNotStrip "*/*/libDJICSDKCommon.so"
-// doNotStrip "*/*/libDJIUpgradeCore.so"
-// doNotStrip "*/*/libDJIUpgradeJNI.so"
-// doNotStrip "*/*/libDJIWaypointV2Core.so"
-// doNotStrip "*/*/libAMapSDK_MAP_v6_9_2.so"
-// doNotStrip "*/*/libDJIMOP.so"
-// doNotStrip "*/*/libDJISDKLOGJNI.so"
-//
-// exclude 'assets/location_map_gps_locked.png'
-// exclude 'assets/location_map_gps_3d.png'
-
- // Had to add "pickFirst" or "exclude" here to avoid a build error:
- //Execution failed for task ':app:mergeDebugJavaResource'.
- //> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
- // > 2 files found with path 'META-INF/rxjava.properties' from inputs:
- //- /Users/oren/.gradle/caches/transforms-3/25303cc1e13b2fa5d8e405bd55bb2138/transformed/jetified-dji-sdk-4.16.1/jars/classes.jar
- //- /Users/oren/.gradle/caches/transforms-3/25303cc1e13b2fa5d8e405bd55bb2138/transformed/jetified-dji-sdk-4.16.1/jars/libs/dji-rxjava-1.1.3.jar
- //Adding a packagingOptions block may help, please refer to
- //https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html for more information
- //pickFirst 'META-INF/rxjava.properties'
- exclude 'META-INF/rxjava.properties'
+ exclude "META-INF/rxjava.properties"
}
}
flutter {
- source '../..'
+ source "../.."
}
dependencies {
- implementation 'androidx.multidex:multidex:2.0.1'
-
- implementation 'androidx.core:core-ktx:1.6.0'
- implementation 'androidx.appcompat:appcompat:1.3.1'
- implementation 'com.google.android.material:material:1.4.0'
- implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
-// testImplementation 'junit:junit:4.+'
- androidTestImplementation 'androidx.test.ext:junit:1.1.3'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
-
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
- implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0'
-
-// implementation('com.dji:dji-sdk:4.16.1', {
-// /**
-// * Uncomment the "library-anti-distortion" if your app does not need Anti Distortion for Mavic 2 Pro and Mavic 2 Zoom.
-// * Uncomment the "fly-safe-database" if you need database for release, or we will download it when DJISDKManager.getInstance().registerApp
-// * is called.
-// * Both will greatly reducing the size of the APK.
-// */
-// exclude module: 'library-anti-distortion'
-// //exclude module: 'fly-safe-database'
-// })
-// compileOnly 'com.dji:dji-sdk-provided:4.16.1'
-//
-// // https://stackoverflow.com/questions/58281124/layout-constraintbottom-totopof-not-found
-// implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
+ implementation "androidx.multidex:multidex:2.0.1"
+ implementation "androidx.core:core-ktx:1.8.0"
+ implementation "androidx.appcompat:appcompat:1.4.2"
+ implementation "com.google.android.material:material:1.6.1"
+ implementation "androidx.constraintlayout:constraintlayout:2.1.4"
+ implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0"
+
+ androidTestImplementation "androidx.test.ext:junit:1.1.3"
+ androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
}
diff --git a/example/android/app/proguard-rules.pro b/example/android/app/proguard-rules.pro
index 1e9e79e..179ba86 100644
--- a/example/android/app/proguard-rules.pro
+++ b/example/android/app/proguard-rules.pro
@@ -1,6 +1,7 @@
-keepattributes Exceptions,InnerClasses,*Annotation*,Signature,EnclosingMethod
-dontoptimize
+-dontpreverify
-dontwarn okio.**
-dontwarn org.bouncycastle.**
-dontwarn dji.**
@@ -51,6 +52,8 @@
-keep class com.squareup.wire.** { *; }
+-keep class sun.misc.Unsafe { *; }
+
-keep class com.secneo.** { *; }
-keep class org.greenrobot.eventbus.**{*;}
@@ -61,6 +64,12 @@
native ;
}
+-keep class * implements com.google.gson.TypeAdapterFactory
+-keep class * implements com.google.gson.JsonSerializer
+-keep class * implements com.google.gson.JsonDeserializer
+
+-keep class androidx.appcompat.widget.SearchView { *; }
+
-keepclassmembers class * extends android.app.Service
-keepclassmembers public class * extends android.view.View {
void set*(***);
@@ -77,6 +86,29 @@
-dontwarn com.mapbox.services.android.location.LostLocationEngine
-dontwarn com.mapbox.services.android.location.MockLocationEngine
+-keepclassmembers class * implements android.arch.lifecycle.LifecycleObserver {
+ (...);
+}
+# ViewModel's empty constructor is considered to be unused by proguard
+-keepclassmembers class * extends android.arch.lifecycle.ViewModel {
+ (...);
+}
+# keep Lifecycle State and Event enums values
+-keepclassmembers class android.arch.lifecycle.Lifecycle$State { *; }
+-keepclassmembers class android.arch.lifecycle.Lifecycle$Event { *; }
+# keep methods annotated with @OnLifecycleEvent even if they seem to be unused
+# (Mostly for LiveData.LifecycleBoundObserver.onStateChange(), but who knows)
+-keepclassmembers class * {
+ @android.arch.lifecycle.OnLifecycleEvent *;
+}
+
+-keepclassmembers class * implements android.arch.lifecycle.LifecycleObserver {
+ (...);
+}
+
+-keep class * implements android.arch.lifecycle.LifecycleObserver {
+ (...);
+}
-keepclassmembers class android.arch.** { *; }
-keep class android.arch.** { *; }
-dontwarn android.arch.**
diff --git a/example/android/build.gradle b/example/android/build.gradle
index 40b343e..7430aef 100644
--- a/example/android/build.gradle
+++ b/example/android/build.gradle
@@ -1,12 +1,12 @@
buildscript {
- ext.kotlin_version = '1.5.31'
+ ext.kotlin_version = "1.6.20"
repositories {
google()
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:7.0.2'
+ classpath "com.android.tools.build:gradle:7.0.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@@ -18,10 +18,10 @@ allprojects {
}
}
-rootProject.buildDir = '../build'
+rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
- project.evaluationDependsOn(':app')
+ project.evaluationDependsOn(":app")
}
task clean(type: Delete) {
diff --git a/pubspec.lock b/pubspec.lock
index 2e3c1f1..f9d19ba 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -70,7 +70,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
- version: "1.15.0"
+ version: "1.16.0"
convert:
dependency: transitive
description:
@@ -91,7 +91,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
- version: "1.2.0"
+ version: "1.3.0"
file:
dependency: transitive
description:
@@ -129,7 +129,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
- version: "0.1.3"
+ version: "0.1.4"
meta:
dependency: transitive
description:
@@ -150,7 +150,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
- version: "1.8.0"
+ version: "1.8.1"
pigeon:
dependency: "direct dev"
description:
@@ -176,7 +176,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
- version: "1.8.1"
+ version: "1.8.2"
stack_trace:
dependency: transitive
description:
@@ -211,7 +211,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
- version: "0.4.8"
+ version: "0.4.9"
typed_data:
dependency: transitive
description:
@@ -225,7 +225,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
- version: "2.1.1"
+ version: "2.1.2"
watcher:
dependency: transitive
description:
@@ -241,5 +241,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
- dart: ">=2.14.0 <3.0.0"
+ dart: ">=2.17.0-0 <3.0.0"
flutter: ">=1.20.0"