diff --git a/firebase.json b/firebase.json index 663adbf..9ec3a90 100644 --- a/firebase.json +++ b/firebase.json @@ -1 +1 @@ -{"flutter":{"platforms":{"android":{"default":{"projectId":"nowwallpaper","appId":"1:318284530945:android:c7dd2abf520a9840250700","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"nowwallpaper","appId":"1:318284530945:ios:754fb4ceebd09514250700","uploadDebugSymbols":true,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"nowwallpaper","configurations":{"android":"1:318284530945:android:c7dd2abf520a9840250700","ios":"1:318284530945:ios:754fb4ceebd09514250700"}}}}}} \ No newline at end of file +{"flutter":{"platforms":{"android":{"default":{"projectId":"nowwallpaper","appId":"1:318284530945:android:c7dd2abf520a9840250700","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"nowwallpaper","appId":"1:318284530945:ios:7bacbc490f39d820250700","uploadDebugSymbols":true,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"nowwallpaper","configurations":{"android":"1:318284530945:android:c7dd2abf520a9840250700","ios":"1:318284530945:ios:7bacbc490f39d820250700"}}}}}} \ No newline at end of file diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index ee5173e..3a233b3 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -202,7 +202,7 @@ 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 39CCEDF39CF579238AE308F0 /* [CP] Embed Pods Frameworks */, 405E88F0300BCE9602B4DA07 /* [CP] Copy Pods Resources */, - A619BA3878CFD24C03A25DF3 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */, + 456CF4E894A8BC296C35D84E /* FlutterFire: "flutterfire upload-crashlytics-symbols" */, ); buildRules = ( ); @@ -347,6 +347,24 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 456CF4E894A8BC296C35D84E /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "FlutterFire: \"flutterfire upload-crashlytics-symbols\""; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\n#!/bin/bash\nPATH=${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin\nflutterfire upload-crashlytics-symbols --upload-symbols-script-path=$PODS_ROOT/FirebaseCrashlytics/upload-symbols --platform=ios --apple-project-path=${SRCROOT} --env-platform-name=${PLATFORM_NAME} --env-configuration=${CONFIGURATION} --env-project-dir=${PROJECT_DIR} --env-built-products-dir=${BUILT_PRODUCTS_DIR} --env-dwarf-dsym-folder-path=${DWARF_DSYM_FOLDER_PATH} --env-dwarf-dsym-file-name=${DWARF_DSYM_FILE_NAME} --env-infoplist-path=${INFOPLIST_PATH} --default-config=default\n"; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -384,24 +402,6 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - A619BA3878CFD24C03A25DF3 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "FlutterFire: \"flutterfire upload-crashlytics-symbols\""; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\n#!/bin/bash\nPATH=${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin\nflutterfire upload-crashlytics-symbols --upload-symbols-script-path=$PODS_ROOT/FirebaseCrashlytics/upload-symbols --platform=ios --apple-project-path=${SRCROOT} --env-platform-name=${PLATFORM_NAME} --env-configuration=${CONFIGURATION} --env-project-dir=${PROJECT_DIR} --env-built-products-dir=${BUILT_PRODUCTS_DIR} --env-dwarf-dsym-folder-path=${DWARF_DSYM_FOLDER_PATH} --env-dwarf-dsym-file-name=${DWARF_DSYM_FILE_NAME} --env-infoplist-path=${INFOPLIST_PATH} --default-config=default\n"; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -511,16 +511,19 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = SXL2QAUF62; + DEVELOPMENT_TEAM = T93S37G27F; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.now.wallpaper; + PRODUCT_BUNDLE_IDENTIFIER = com.lux.now.wallpaper; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -696,16 +699,19 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = SXL2QAUF62; + DEVELOPMENT_TEAM = T93S37G27F; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.now.wallpaper; + PRODUCT_BUNDLE_IDENTIFIER = com.lux.now.wallpaper; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -719,16 +725,19 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = SXL2QAUF62; + DEVELOPMENT_TEAM = T93S37G27F; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.now.wallpaper; + PRODUCT_BUNDLE_IDENTIFIER = com.lux.now.wallpaper; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist index 942b0f4..d5ca093 100644 --- a/ios/Runner/GoogleService-Info.plist +++ b/ios/Runner/GoogleService-Info.plist @@ -9,7 +9,7 @@ PLIST_VERSION 1 BUNDLE_ID - com.now.wallpaper + com.lux.now.wallpaper PROJECT_ID nowwallpaper STORAGE_BUCKET @@ -25,6 +25,6 @@ IS_SIGNIN_ENABLED GOOGLE_APP_ID - 1:318284530945:ios:754fb4ceebd09514250700 + 1:318284530945:ios:7bacbc490f39d820250700 \ No newline at end of file diff --git a/lib/common/utils/permission_util.dart b/lib/common/utils/permission_util.dart index 5ba79ce..8e665e3 100644 --- a/lib/common/utils/permission_util.dart +++ b/lib/common/utils/permission_util.dart @@ -27,7 +27,7 @@ class PermissionUtil { switch (permissionStatus) { // 拒绝状态 case PermissionStatus.denied: - _showFailedDialog(newPermissionList); + showFailedDialog(newPermissionList); return false; // 允许状态 case PermissionStatus.granted: @@ -37,7 +37,7 @@ class PermissionUtil { // 永久拒绝 活动限制 case PermissionStatus.restricted: case PermissionStatus.permanentlyDenied: - _showFailedDialog(newPermissionList, isPermanentlyDenied: true); + showFailedDialog(newPermissionList, isPermanentlyDenied: true); break; } } else { @@ -79,10 +79,10 @@ class PermissionUtil { // 如果有一个拒绝那么就失败了 } else if (status.isDenied || status2.isDenied) { - _showFailedDialog( + showFailedDialog( [Permission.locationWhenInUse, Permission.locationAlways]); } else { - _showFailedDialog( + showFailedDialog( [Permission.locationWhenInUse, Permission.locationAlways], isPermanentlyDenied: true, ); @@ -105,7 +105,7 @@ class PermissionUtil { } /// 权限拒绝后弹窗 - static _showFailedDialog(List permissionList, {bool isPermanentlyDenied = false}) async { + static showFailedDialog(List permissionList, {bool isPermanentlyDenied = false}) async { Get.dialog( barrierDismissible: false, RemindDialog( @@ -137,7 +137,7 @@ class PermissionUtil { } } String explain = ''; - if (failedPermission == Permission.storage) { + if (failedPermission == Permission.storage || failedPermission == Permission.photosAddOnly) { explain = 'To save wallpapers to gallery, we need this permission'; } return explain; diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart index 7a22a82..5902c12 100644 --- a/lib/firebase_options.dart +++ b/lib/firebase_options.dart @@ -59,11 +59,11 @@ class DefaultFirebaseOptions { static const FirebaseOptions ios = FirebaseOptions( apiKey: 'AIzaSyBAVP2-PNvC07OPHepWpCCb6QzVTRk1cMM', - appId: '1:318284530945:ios:754fb4ceebd09514250700', + appId: '1:318284530945:ios:7bacbc490f39d820250700', messagingSenderId: '318284530945', projectId: 'nowwallpaper', storageBucket: 'nowwallpaper.appspot.com', - iosBundleId: 'com.now.wallpaper', + iosBundleId: 'com.lux.now.wallpaper', ); } \ No newline at end of file diff --git a/lib/modules/wallpaper_det/wallpaper_det_controller.dart b/lib/modules/wallpaper_det/wallpaper_det_controller.dart index 39dc733..0a5ebfb 100644 --- a/lib/modules/wallpaper_det/wallpaper_det_controller.dart +++ b/lib/modules/wallpaper_det/wallpaper_det_controller.dart @@ -74,8 +74,7 @@ class WallpaperDetController extends GetxController { // Android 10以下版本,需要申请存储权限 int sdkVersion = await DeviceInfoUtil.getAndroidSystemVersion(); if (sdkVersion < 29) { - bool status = await PermissionUtil.checkPermission([Permission.storage]); - canSave = status; + canSave = await PermissionUtil.checkPermission([Permission.storage]); } } if (canSave) { @@ -147,7 +146,7 @@ class WallpaperDetController extends GetxController { await imageFile.writeAsBytes(pngBytes); filePath = imagePath; - final result = await ImageGallerySaver.saveImage(pngBytes); + final result = await ImageGallerySaver.saveImage(pngBytes, quality: 100); if (result['isSuccess']) { toast('Saved to album'); } else { diff --git a/pubspec.yaml b/pubspec.yaml index b6730cb..96ef478 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -136,8 +136,6 @@ flutter: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg - assets/images/ - - assets/images/2.0x/ - - assets/images/3.0x/ - assets/icon/ - assets/json/