diff --git a/CHANGELOG.md b/CHANGELOG.md index eb7a269..1f15202 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 0.3.7+3 +* fixed Are you missing a call to unregisterReceiver(). ## 0.3.7+2 * fixed android 31 notification problem. ## 0.3.7+1 diff --git a/android/src/main/java/com/example/r_upgrade/RUpgradePlugin.java b/android/src/main/java/com/example/r_upgrade/RUpgradePlugin.java index 433de25..5072f0a 100644 --- a/android/src/main/java/com/example/r_upgrade/RUpgradePlugin.java +++ b/android/src/main/java/com/example/r_upgrade/RUpgradePlugin.java @@ -35,8 +35,12 @@ public RUpgradePlugin() { } private RUpgradePlugin(Activity activity, BinaryMessenger messenger, StoragePermissions.PermissionsRegistry permissionsRegistry) { + initPlugin(activity, messenger, permissionsRegistry); + } + + private void initPlugin(Activity activity, BinaryMessenger messenger, StoragePermissions.PermissionsRegistry permissionsRegistry) { _channel = new MethodChannel(messenger, PLUGIN_METHOD_NAME); - upgradeManager = new UpgradeManager(activity, _channel,new StoragePermissions(),permissionsRegistry); + upgradeManager = new UpgradeManager(activity, _channel, new StoragePermissions(), permissionsRegistry); _channel.setMethodCallHandler(new RUpgradeMethodCallHandler(upgradeManager)); } @@ -44,6 +48,7 @@ private RUpgradePlugin(Activity activity, BinaryMessenger messenger, StoragePerm * Plugin registration. */ public static void registerWith(final Registrar registrar) { + new RUpgradePlugin(registrar.activity(), registrar.messenger(), new StoragePermissions.PermissionsRegistry() { @Override public void addListener(PluginRegistry.RequestPermissionsResultListener handler) { @@ -68,13 +73,12 @@ public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { @Override public void onAttachedToActivity(@NonNull final ActivityPluginBinding binding) { - new RUpgradePlugin(binding.getActivity(), flutterPluginBinding.getBinaryMessenger(), new StoragePermissions.PermissionsRegistry() { + initPlugin(binding.getActivity(), flutterPluginBinding.getBinaryMessenger(), new StoragePermissions.PermissionsRegistry() { @Override public void addListener(PluginRegistry.RequestPermissionsResultListener handler) { binding.addRequestPermissionsResultListener(handler); } }); - } @Override @@ -93,6 +97,7 @@ public void onDetachedFromActivity() { flutterPluginBinding.getApplicationContext().stopService(intent); if (upgradeManager != null) { upgradeManager.dispose(); + upgradeManager = null; } if (_channel != null) { _channel.setMethodCallHandler(null); diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 5d6a922..887334c 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -6,7 +6,6 @@ additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> - diff --git a/example/android/build.gradle b/example/android/build.gradle index 3100ad2..714549c 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.6.10' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' + classpath 'com.android.tools.build:gradle:4.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 296b146..bc6a58a 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/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-5.6.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/example/pubspec.lock b/example/pubspec.lock index 0d98544..b01d0e2 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,56 +5,56 @@ packages: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.8.2" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.0" characters: dependency: transitive description: name: characters - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.1" clock: dependency: transitive description: name: clock - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.15.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.1.3" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.0" flutter: @@ -76,28 +76,35 @@ packages: dependency: "direct main" description: name: intl - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.17.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dev" + source: hosted + version: "0.1.3" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.7.0" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.8.0" r_upgrade: @@ -106,7 +113,7 @@ packages: path: ".." relative: true source: path - version: "0.3.7+2" + version: "0.3.7+3" sky_engine: dependency: transitive description: flutter @@ -116,56 +123,56 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.8.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted - version: "0.4.3" + version: "0.4.8" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.1" sdks: diff --git a/pubspec.lock b/pubspec.lock index eb765bb..397443c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,49 +5,49 @@ packages: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.8.2" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.0" characters: dependency: transitive description: name: characters - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.1" clock: dependency: transitive description: name: clock - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.15.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.0" flutter: @@ -64,21 +64,28 @@ packages: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dev" + source: hosted + version: "0.1.3" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.7.0" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.8.0" sky_engine: @@ -90,56 +97,56 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.8.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted - version: "0.4.3" + version: "0.4.8" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dev" source: hosted version: "2.1.1" sdks: diff --git a/pubspec.yaml b/pubspec.yaml index 02ef748..07fbf5d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: r_upgrade description: A plugin for upgrade and install application ,Support Android and IOS. -version: 0.3.7+2 +version: 0.3.7+3 homepage: https://github.com/rhymelph/r_upgrade environment: