From 1273a71797f75f99e106887411de41bc8a838093 Mon Sep 17 00:00:00 2001 From: leeyi Date: Sun, 25 Aug 2024 13:18:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=94=AF=E6=8C=81=E2=80=9C=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=88=B0gradle=E5=88=B08.7=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + android/build.gradle | 3 +- example/lib/main.dart | 25 +++++---- example/pubspec.lock | 89 +++++++++++++++++++++++++------- example/pubspec.yaml | 4 +- pubspec.lock | 115 ++++++++++++++++++++++++++++++------------ pubspec.yaml | 2 +- 7 files changed, 170 insertions(+), 69 deletions(-) diff --git a/.gitignore b/.gitignore index e9dc58d..28293c4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ .pub/ build/ +.flutter-plugins-dependencies diff --git a/android/build.gradle b/android/build.gradle index c5ea4e4..d8d00d2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:8.5.2' } } @@ -25,6 +25,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { + namespace "com.example.r_upgrade" compileSdkVersion 33 defaultConfig { diff --git a/example/lib/main.dart b/example/lib/main.dart index 7204815..61ba579 100755 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,7 +1,6 @@ import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:r_upgrade/r_upgrade.dart'; @@ -128,7 +127,7 @@ class _MyAppState extends State { title: Text('get version from app store(WeChat)'), trailing: iosVersion != null ? Text(iosVersion!, - style: Theme.of(context).textTheme.subtitle2!.copyWith( + style: Theme.of(context).textTheme.titleSmall!.copyWith( color: Colors.grey, )) : null, @@ -150,7 +149,7 @@ class _MyAppState extends State { ListTile( title: Text( S.of(context).Notification_Related, - style: Theme.of(context).textTheme.headline6!.copyWith( + style: Theme.of(context).textTheme.titleLarge!.copyWith( fontWeight: FontWeight.w600, ), ), @@ -232,7 +231,7 @@ class _MyAppState extends State { ListTile( title: Text( S.of(context).Install_Related, - style: Theme.of(context).textTheme.headline6!.copyWith( + style: Theme.of(context).textTheme.titleLarge!.copyWith( fontWeight: FontWeight.w600, ), ), @@ -269,15 +268,15 @@ class _MyAppState extends State { ListTile( title: Text( S.of(context).Install_Type_Silent_Tip, - style: Theme.of(context).textTheme.subtitle2?.copyWith( - color: Theme.of(context).errorColor, + style: Theme.of(context).textTheme.titleSmall?.copyWith( + color: Theme.of(context).colorScheme.error, ), ), ), ListTile( title: Text( S.of(context).Update_the_related, - style: Theme.of(context).textTheme.headline6!.copyWith( + style: Theme.of(context).textTheme.titleLarge!.copyWith( fontWeight: FontWeight.w600, ), ), @@ -323,7 +322,7 @@ class _MyAppState extends State { }, trailing: androidVersion != null ? Text(androidVersion!, - style: Theme.of(context).textTheme.subtitle2!.copyWith( + style: Theme.of(context).textTheme.titleSmall!.copyWith( color: Colors.grey, )) : null, @@ -440,7 +439,7 @@ class _MyAppState extends State { ListTile( title: Text( S.of(context).Hot_update_related, - style: Theme.of(context).textTheme.headline6!.copyWith( + style: Theme.of(context).textTheme.titleLarge!.copyWith( fontWeight: FontWeight.w600, ), ), @@ -513,7 +512,7 @@ class _MyAppState extends State { ListTile( title: Text( S.of(context).Incremental_updating, - style: Theme.of(context).textTheme.headline6!.copyWith( + style: Theme.of(context).textTheme.titleLarge!.copyWith( fontWeight: FontWeight.w600, ), ), @@ -579,7 +578,7 @@ class _MyAppState extends State { ListTile( title: Text( S.of(context).History_related, - style: Theme.of(context).textTheme.headline6!.copyWith( + style: Theme.of(context).textTheme.titleLarge!.copyWith( fontWeight: FontWeight.w600, ), ), @@ -589,7 +588,7 @@ class _MyAppState extends State { trailing: lastId != null ? Text( lastId.toString(), - style: Theme.of(context).textTheme.subtitle2!.copyWith( + style: Theme.of(context).textTheme.titleSmall!.copyWith( color: Colors.grey, ), ) @@ -626,7 +625,7 @@ class _MyAppState extends State { ), trailing: lastStatus != null ? Text(getStatus(lastStatus), - style: Theme.of(context).textTheme.subtitle2!.copyWith( + style: Theme.of(context).textTheme.titleSmall!.copyWith( color: Colors.grey, )) : null, diff --git a/example/pubspec.lock b/example/pubspec.lock index 93318d2..2f8c926 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,27 +5,31 @@ packages: dependency: transitive description: name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.flutter-io.cn" source: hosted - version: "2.9.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" @@ -33,20 +37,23 @@ packages: dependency: transitive description: name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.flutter-io.cn" source: hosted - version: "1.16.0" + version: "1.18.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.3" + version: "1.0.8" fake_async: dependency: transitive description: name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" @@ -69,44 +76,73 @@ packages: dependency: "direct main" description: name: intl + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.19.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + url: "https://pub.flutter-io.cn" + source: hosted + version: "10.0.5" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.5" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" url: "https://pub.flutter-io.cn" source: hosted - version: "0.17.0" + version: "3.0.1" matcher: dependency: transitive description: name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.12" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.5" + version: "0.11.1" meta: dependency: transitive description: name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.0" + version: "1.15.0" path: dependency: transitive description: name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.2" + version: "1.9.0" r_upgrade: dependency: "direct dev" description: path: ".." relative: true source: path - version: "0.4.1" + version: "0.4.2" sky_engine: dependency: transitive description: flutter @@ -116,34 +152,39 @@ packages: dependency: transitive description: name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.flutter-io.cn" source: hosted - version: "1.9.0" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.flutter-io.cn" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" @@ -151,16 +192,26 @@ packages: dependency: transitive description: name: test_api + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.flutter-io.cn" source: hosted - version: "0.4.12" + version: "0.7.2" vector_math: dependency: transitive description: name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.2" + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + url: "https://pub.flutter-io.cn" + source: hosted + version: "14.2.5" sdks: - dart: ">=2.17.0-0 <3.0.0" - flutter: ">=1.12.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 5dab782..edd16e3 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -3,7 +3,7 @@ description: Demonstrates how to use the r_upgrade plugin. publish_to: 'none' version: 1.0.0+1 environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.17.0 <=5.0.0" dependencies: flutter: @@ -12,7 +12,7 @@ dependencies: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.2 + cupertino_icons: ^1.0.8 intl: dev_dependencies: flutter_test: diff --git a/pubspec.lock b/pubspec.lock index d72c8ab..96dc925 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,42 +5,48 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.9.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.flutter-io.cn" source: hosted - version: "1.16.0" + version: "1.18.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.1" flutter: @@ -53,34 +59,62 @@ packages: description: flutter source: sdk version: "0.0.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + url: "https://pub.flutter-io.cn" + source: hosted + version: "10.0.5" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.5" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.12" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.5" + version: "0.11.1" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.0" + version: "1.15.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.8.2" + version: "1.9.0" sky_engine: dependency: transitive description: flutter @@ -90,51 +124,66 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.9.0" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + url: "https://pub.flutter-io.cn" source: hosted - version: "0.4.12" + version: "0.7.2" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.2" + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + url: "https://pub.flutter-io.cn" + source: hosted + version: "14.2.5" sdks: - dart: ">=2.17.0-0 <3.0.0" - flutter: ">=1.12.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index 63957e8..5830282 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.4.2 homepage: https://github.com/rhymelph/r_upgrade environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.17.0 <=5.0.0" flutter: ">=1.12.0" dependencies: From 311a10ccaff3c11451cac13fcb44fee979a366cd Mon Sep 17 00:00:00 2001 From: leeyi Date: Wed, 11 Sep 2024 22:17:55 +0800 Subject: [PATCH 2/3] =?UTF-8?q?##=200.4.3=20*=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=AF=B9=20READ=5FEXTERNAL=5FSTORAGE=20=E5=92=8C=20WRITE=5FEXT?= =?UTF-8?q?ERNAL=5FSTORAGE=20=E6=9D=83=E9=99=90=E7=9A=84=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=EF=BC=88=20Android=2010=20=E5=92=8C=20Android=2011=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E8=AF=B7=E6=B1=82=E8=BF=99=E4=BA=9B=E6=9D=83?= =?UTF-8?q?=E9=99=90=EF=BC=89=20*=20Android=2012=20=E5=8F=8A=E4=BB=A5?= =?UTF-8?q?=E4=B8=8A=E7=89=88=E6=9C=AC=EF=BC=8C=E8=AF=B7=E6=B1=82=20POST?= =?UTF-8?q?=5FNOTIFICATIONS=20=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ .../r_upgrade/common/DownloadPermissions.java | 26 +++++++------------ example/pubspec.lock | 2 +- pubspec.yaml | 2 +- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5c0639..52c58ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.4.3 +* 移除对 READ_EXTERNAL_STORAGE 和 WRITE_EXTERNAL_STORAGE 权限的请求( Android 10 和 Android 11,不再请求这些权限) +* Android 12 及以上版本,请求 POST_NOTIFICATIONS 权限 ## 0.4.2 * fix issues(#76) support android 13. ## 0.4.1 diff --git a/android/src/main/java/com/example/r_upgrade/common/DownloadPermissions.java b/android/src/main/java/com/example/r_upgrade/common/DownloadPermissions.java index dfaaae4..76d438c 100644 --- a/android/src/main/java/com/example/r_upgrade/common/DownloadPermissions.java +++ b/android/src/main/java/com/example/r_upgrade/common/DownloadPermissions.java @@ -5,6 +5,7 @@ import android.content.pm.PackageManager; import android.os.Build; +import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; import androidx.annotation.VisibleForTesting; import androidx.core.app.ActivityCompat; @@ -33,8 +34,9 @@ public void requestPermissions( if (Build.VERSION.SDK_INT >= 33) { if (ongoing) { callback.onResult("downloadPermission", "Notification permission request ongoing"); + return; } - if (notificationVisibility != 2&&!hasNotificationPermission(activity)) { + if (notificationVisibility != 2 && !hasNotificationPermission(activity)) { permissionsRegistry.addListener( new StorageRequestPermissionsListener(new ResultCallback() { @Override @@ -52,9 +54,13 @@ public void onResult(String errorCode, String errorDescription) { // Permissions already exist. Call the callback with success. callback.onResult(null, null); } - } else if (Build.VERSION.SDK_INT < 30 && (!hasReadStoragePermission(activity) || !hasWritePermission(activity))) { + } else if (Build.VERSION.SDK_INT >= 29 && Build.VERSION.SDK_INT < 33) { + // For Android 10 and Android 11, we don't request storage permissions + callback.onResult(null, null); + } else { if (ongoing) { callback.onResult("downloadPermission", "Read/Write External Storage permission request ongoing"); + return; } permissionsRegistry.addListener( new StorageRequestPermissionsListener(new ResultCallback() { @@ -69,9 +75,6 @@ public void onResult(String errorCode, String errorDescription) { activity, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, STORAGE_REQUEST_ID); - } else { - // Permissions already exist. Call the callback with success. - callback.onResult(null, null); } } @@ -81,16 +84,6 @@ private boolean hasNotificationPermission(Activity activity) { == PackageManager.PERMISSION_GRANTED; } - private boolean hasReadStoragePermission(Activity activity) { - return ContextCompat.checkSelfPermission(activity, Manifest.permission.READ_EXTERNAL_STORAGE) - == PackageManager.PERMISSION_GRANTED; - } - - private boolean hasWritePermission(Activity activity) { - return ContextCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) - == PackageManager.PERMISSION_GRANTED; - } - @VisibleForTesting public static final class StorageRequestPermissionsListener implements PluginRegistry.RequestPermissionsResultListener { @@ -100,7 +93,6 @@ public static final class StorageRequestPermissionsListener // we've responded before and bail out of handling the callback manually if this is a repeat // call. boolean alreadyCalled = false; - final ResultCallback callback; @VisibleForTesting @@ -136,4 +128,4 @@ public boolean onRequestPermissionsResult(int id, String[] permissions, int[] gr } } } -} +} \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index 2f8c926..eb88574 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -142,7 +142,7 @@ packages: path: ".." relative: true source: path - version: "0.4.2" + version: "0.4.3" sky_engine: dependency: transitive description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 5830282..7aaeb5b 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.4.2 +version: 0.4.3 homepage: https://github.com/rhymelph/r_upgrade environment: From 2ea0e4f5a1d08d4740bfe5e6c60554c3789365b8 Mon Sep 17 00:00:00 2001 From: leeyi Date: Wed, 11 Sep 2024 22:31:31 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix=20=E5=9C=A8Android=2010=20=E7=9C=9F?= =?UTF-8?q?=E6=9C=BA=EF=BC=88api=2029)=20=E5=92=8C=20Android=209.1.0.301(C?= =?UTF-8?q?OOE162R2P2)=20=E7=9C=9F=E6=9C=BA=EF=BC=88api=2028)=E4=B8=8A?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=BF=87=E4=B8=8B=E8=BD=BD=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52c58ba..b538acc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 0.4.3 * 移除对 READ_EXTERNAL_STORAGE 和 WRITE_EXTERNAL_STORAGE 权限的请求( Android 10 和 Android 11,不再请求这些权限) * Android 12 及以上版本,请求 POST_NOTIFICATIONS 权限 +* 支持“升级到gradle到8.7” ## 0.4.2 * fix issues(#76) support android 13. ## 0.4.1