diff --git a/star_lock/README.md b/star_lock/README.md index c9b3d388..9f10dabf 100644 --- a/star_lock/README.md +++ b/star_lock/README.md @@ -102,7 +102,9 @@ java -jar android/google/pepk.jar --keystore=android/app/sky.jks --alias=upload ```bash flutter build appbundle --release --flavor sky -t lib/main_sky.dart ``` -然后文件在:`build/app/outputs/bundle/skyRelease/app-sky-release.aab` +```bash +cp build/app/outputs/bundle/skyRelease/app-sky-release.aab /d/Downloads/app-sky-universal-release-1.0.16+2024031302.aab +``` - 注意,这里的sky.jks和google_pek.zip和encryption_public_key.pem都是sky渠道的,和谷歌账号对应。如果需要使用其他谷歌账号,需要更换这两个文件。 @@ -124,7 +126,7 @@ dart run flutter_flavorizr -p assets:extract ``` 重新生成Generated.xcconfig以更新购建物版本号等信息 ```bash -flutter build ios --config-only +flutter build ios --config-only --flavor sky ``` 构建/编译 ```bash @@ -141,3 +143,26 @@ Xcode顶部中间设备选择器左边,Runner选择下拉,选择Edit Scheme 截图完成记得将Runner改回去,不然编译出来的sky是debug版的。 最后还是随便截图的,然后用PS裁剪成要求的分辨率上传了 + + +## 用于aab文件转apk + +安装bundletool.jar(该文件在git忽略,每个机器需要自行下载) +```bash +wget -o android/bundletool.jar https://github.com/google/bundletool/releases/download/1.15.6/bundletool-all-1.15.6.jar +``` + +将aab转为apk +```bash +java -jar android/bundletool.jar build-apks --bundle=build/app/outputs/bundle/skyRelease/app-sky-release.aab \ +--output=build/app/outputs/bundle/skyRelease/app-sky-release.aab.apks \ +--ks=android/app/sky.jks \ +--ks-pass=pass:sky2028 \ +--ks-key-alias=upload \ +--key-pass=pass:sky2028 +``` + +安装apks文件到手机 +```bash +java -jar android/bundletool.jar install-apks --apks=build/app/outputs/bundle/skyRelease/app-sky-release.aab.apks +``` diff --git a/star_lock/android/.gitignore b/star_lock/android/.gitignore index b0d3c96a..36eb2329 100644 --- a/star_lock/android/.gitignore +++ b/star_lock/android/.gitignore @@ -1,4 +1,5 @@ gradle-wrapper.jar +bundletool.jar /.gradle /captures/ /gradlew diff --git a/star_lock/android/app/build.gradle b/star_lock/android/app/build.gradle index 91a32b6c..de479b6e 100644 --- a/star_lock/android/app/build.gradle +++ b/star_lock/android/app/build.gradle @@ -29,6 +29,15 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { signingConfigs { + // 这里“debug”不是一个自定义变量,而是一个特定的关键词,凡是使用--debug模式,都会引用到这里 + // 目前看来,debug模式没办法在buildTypes里面按flavors指定编译签名,所有口味的debug模式只能用同一个签名 + debug { + storeFile file("starlock.keystore") + storePassword '123456' + keyAlias = 'starlock' + keyPassword '123456' + } + // 下面的pre、sky、xhj 都是自定义变量,自身不起任何作用,而是看哪里引用了它们 pre { storeFile file("starlock.keystore") storePassword '123456' @@ -143,12 +152,6 @@ android { productFlavors.sky.signingConfig signingConfigs.sky productFlavors.xhj.signingConfig signingConfigs.xhj } - debug { - productFlavors.dev.signingConfig signingConfigs.pre - productFlavors.pre.signingConfig signingConfigs.pre - productFlavors.sky.signingConfig signingConfigs.sky - productFlavors.xhj.signingConfig signingConfigs.xhj - } } } diff --git a/star_lock/android/app/google-services.json b/star_lock/android/app/google-services.json new file mode 100644 index 00000000..cbcbc271 --- /dev/null +++ b/star_lock/android/app/google-services.json @@ -0,0 +1,29 @@ +{ + "project_info": { + "project_number": "281500445726", + "project_id": "skychip2023-ecdff", + "storage_bucket": "skychip2023-ecdff.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:281500445726:android:ddf52ac7b7f83cf5c4d20f", + "android_client_info": { + "package_name": "com.skychip.lock" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyC-3-ABWuy9LrYyAw_KxDRto4DanQ0sq9g" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/star_lock/android/app/skychip2023-ecdff-abeb85114bda.json b/star_lock/android/app/skychip2023-ecdff-abeb85114bda.json new file mode 100644 index 00000000..fe4b3678 --- /dev/null +++ b/star_lock/android/app/skychip2023-ecdff-abeb85114bda.json @@ -0,0 +1,13 @@ +{ + "type": "service_account", + "project_id": "skychip2023-ecdff", + "private_key_id": "abeb85114bda731d15777f9ef57f1e15ca960922", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDN6gFIXozDnm92\nnFb7q1VK4OurhjsuDwrLxiCEyfx0QSUFBJHcsG3/taK0PLO/vfQiQ6U81xmW2roK\no/ojS0iMbCGOIsc/ZjElhx2Crmbj7XimrnJK6LuIkqKrHjlHbe7CQtu4dxbf9TLF\nXq3uZxU0lhg4VZmMygDgrUphica3h/uNRWlZbucWPKFUIL0VLOiM37rlFiNN33IJ\nUzptP+1D3TP8swPhUOZ/jY4pSMfn35OQ7oyQpEu8v3/oqLbJ1hSXa4DCIjteYN+M\nkVo3l/Uwhf8RO9UC03+JTO6I7iur144sMuIlhxqiCl9J7MV42tLMH/O36v7HsL6s\ng/VhWfT1AgMBAAECggEAC/4qDvX6ytXqdgULB+Nlt1O8RiQuRDN6FH44nKNLAdZd\neppWiHz6Gx+QF2FFstA0bN51vEJm6iNZHI+KXQ3gbtVJawbZhfbEvAPPkzHnKjVF\nhqe4XmaJrZ2kvcSn32Imuse8FlVRTr/wMhCenrkAQizPwlAx/kIxpORS5bVpjnzR\nRrkkfoAplVm74UrTo1bD7ER6ynenkIpDz3ETChrLebmGqCP0KYxobjQAjQ+eyHNw\nDlauaA/VSUpq2IaG7SoFdHqdiJXJO3VEQkxELA0768VpfhcLTB4gVO3bmlG/crlM\nx7VuotjCyVZ6qxwBtiyV68pcWx+ggR4qkGZtN9CsoQKBgQDtFx6JXrU6/RFnyXMk\n0Yc1tM/to0ZZwH4y/CFiOphEyVCQCT+vB1UgNX10eByyOfqgO9kR3ZCC/ZI/QUoe\nxyCcApAH4tNd6LCFxHurnw1JK2Ed+LS6twMloH8HTmqdse8sQW16ZafuoAObUif5\ngYOK0PfzaD63QBX4YZE0vzKLvQKBgQDeVlVWtuAHnLxYZDNVc/n8anHrPX1Kgv7m\ninx1mGikWkoVQHicC1/ouLJa8gQOKbARDwPbfxVNqwJR075neUoNkuhZM9wfkqEC\n0radVoTn6WwnwJCq4nz0f4+x9uKsU5hWC57RXQ2sxcf9NGubmQXakTyDqmrppq3p\nEDJtDMzFmQKBgGssTUB5kGDm7sxEswkMshsj7e4VJYMC0clIUeruY9CMVB+YHrKH\nFQLnSxuwBADI1rNB+oDp8B5Wc5qmb9Pz3ZjIS8VU0okb21fMlr7guge+VTtQJppU\nilai82khGG7KdTxDIzL16vCiYp7+h1VxJz5D8iGUmO0LSiMqL5Jxb27dAoGBAMDP\n2d4DZbD0SZnV+3aFxysRHI3Gm1r80xUWz+wjKcwtyMU5Td71Nk1ZrsKT0tR9boS8\norm9MbpTLQXNPPf7BS9UUU7aXHC89gi+t0Mm/scndHXc1xh6paZa4UCSO+z56cfk\n9+vUaMGGG3MH/LHJOHxdKz97kI/jzjmppDFRwlsxAoGAeT3r/LpNlt8y3W65bWzj\nBYiSHZfsR7jQtLEXp9IclKU76Nl6JHXdPRxhd8pMhCP6o2WIL3DN6rIuhYDHg19q\n+DBi0JSqqMLL3nnFgXOrpCJGIm7ihXvgAvyhO72EXFHtXoR8rk1G7FpiV3YXVdYr\nqs/D031oJaVZiGcDGlm0IpY=\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-l06d6@skychip2023-ecdff.iam.gserviceaccount.com", + "client_id": "100525717804471198688", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-l06d6%40skychip2023-ecdff.iam.gserviceaccount.com", + "universe_domain": "googleapis.com" +} diff --git a/star_lock/ios/Podfile.lock b/star_lock/ios/Podfile.lock index d2246c5d..06ed85d6 100644 --- a/star_lock/ios/Podfile.lock +++ b/star_lock/ios/Podfile.lock @@ -46,16 +46,21 @@ PODS: - Flutter - EMASRest (11.1.1.2) - Flutter (1.0.0) + - flutter_local_notifications (0.0.1): + - Flutter - flutter_native_contact_picker (0.0.1): - Flutter - flutter_pcm_sound (0.0.1): - Flutter - - flutter_voice_processor (1.1.1): + - flutter_voice_processor (1.1.0): - Flutter - ios-voice-processor (~> 1.1.0) - fluttertoast (0.0.2): - Flutter - Toast + - FMDB (2.7.5): + - FMDB/standard (= 2.7.5) + - FMDB/standard (2.7.5) - g711_flutter (0.0.1): - Flutter - google_maps_flutter_ios (0.0.1): @@ -93,7 +98,7 @@ PODS: - FlutterMacOS - sqflite (0.0.3): - Flutter - - FlutterMacOS + - FMDB (>= 2.7.5) - SwiftProtobuf (1.25.2) - system_settings (0.0.1): - Flutter @@ -102,6 +107,7 @@ PODS: - Flutter - video_player_avfoundation (0.0.1): - Flutter + - FlutterMacOS - webview_flutter_wkwebview (0.0.1): - Flutter @@ -120,6 +126,7 @@ DEPENDENCIES: - connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`) - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - Flutter (from `Flutter`) + - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - flutter_native_contact_picker (from `.symlinks/plugins/flutter_native_contact_picker/ios`) - flutter_pcm_sound (from `.symlinks/plugins/flutter_pcm_sound/ios`) - flutter_voice_processor (from `.symlinks/plugins/flutter_voice_processor/ios`) @@ -135,10 +142,10 @@ DEPENDENCIES: - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - - sqflite (from `.symlinks/plugins/sqflite/darwin`) + - sqflite (from `.symlinks/plugins/sqflite/ios`) - system_settings (from `.symlinks/plugins/system_settings/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`) + - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`) - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`) SPEC REPOS: @@ -153,6 +160,7 @@ SPEC REPOS: - AMap3DMap - AMapFoundation - AMapLocation + - FMDB - GoogleMaps - ios-voice-processor - Protobuf @@ -187,6 +195,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/device_info_plus/ios" Flutter: :path: Flutter + flutter_local_notifications: + :path: ".symlinks/plugins/flutter_local_notifications/ios" flutter_native_contact_picker: :path: ".symlinks/plugins/flutter_native_contact_picker/ios" flutter_pcm_sound: @@ -218,13 +228,13 @@ EXTERNAL SOURCES: shared_preferences_foundation: :path: ".symlinks/plugins/shared_preferences_foundation/darwin" sqflite: - :path: ".symlinks/plugins/sqflite/darwin" + :path: ".symlinks/plugins/sqflite/ios" system_settings: :path: ".symlinks/plugins/system_settings/ios" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" video_player_avfoundation: - :path: ".symlinks/plugins/video_player_avfoundation/ios" + :path: ".symlinks/plugins/video_player_avfoundation/darwin" webview_flutter_wkwebview: :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" @@ -251,10 +261,12 @@ SPEC CHECKSUMS: device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed EMASRest: 8df6f87836767a9415ad5cc4af739bc9d215b475 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086 flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907 flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e - flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82 + flutter_voice_processor: 53afbf59ad3feb82f4a379fea9ed8dc98495210f fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265 + FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a g711_flutter: 8f2769052d2cf3549f83d11e1c42d81d94441123 google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458 GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4 @@ -270,12 +282,12 @@ SPEC CHECKSUMS: ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 - sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec + sqflite: 50a33e1d72bd59ee092a519a35d107502757ebed SwiftProtobuf: 407a385e97fd206c4fbe880cc84123989167e0d1 system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812 - video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126 + video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579 webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4 PODFILE CHECKSUM: 8406bb0e8f1c4b5dff3955810b207d90193914a0 diff --git a/star_lock/ios/Runner.xcodeproj/project.pbxproj b/star_lock/ios/Runner.xcodeproj/project.pbxproj index 948be51b..c6fd9b6a 100644 --- a/star_lock/ios/Runner.xcodeproj/project.pbxproj +++ b/star_lock/ios/Runner.xcodeproj/project.pbxproj @@ -776,7 +776,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 4A63B2C308CB401731950EC8 /* Pods-Runner.debug-sky.xcconfig */; buildSettings = { - DEVELOPMENT_TEAM = 7D53BZAN75; + DEVELOPMENT_TEAM = NAQ5PL2DYC; PRODUCT_NAME = Runner; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -789,7 +789,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8CD96970DEA44F6CC71DEECE /* Pods-Runner.profile-sky.xcconfig */; buildSettings = { - DEVELOPMENT_TEAM = 7D53BZAN75; + DEVELOPMENT_TEAM = NAQ5PL2DYC; PRODUCT_NAME = Runner; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -802,7 +802,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 16A83D21DFB231D8453DC681 /* Pods-Runner.release-sky.xcconfig */; buildSettings = { - DEVELOPMENT_TEAM = 7D53BZAN75; + DEVELOPMENT_TEAM = NAQ5PL2DYC; PRODUCT_NAME = Runner; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -899,7 +899,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -961,7 +961,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -1163,7 +1163,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1232,7 +1232,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1307,7 +1307,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1375,7 +1375,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1444,7 +1444,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1519,7 +1519,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -1586,7 +1586,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -1636,7 +1636,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -1983,7 +1983,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2058,7 +2058,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2126,7 +2126,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2195,7 +2195,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -2270,7 +2270,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/star_lock/ios/Runner.xcodeproj/xcshareddata/xcschemes/sky.xcscheme b/star_lock/ios/Runner.xcodeproj/xcshareddata/xcschemes/sky.xcscheme index bf70b16a..b2589df9 100644 --- a/star_lock/ios/Runner.xcodeproj/xcshareddata/xcschemes/sky.xcscheme +++ b/star_lock/ios/Runner.xcodeproj/xcshareddata/xcschemes/sky.xcscheme @@ -24,7 +24,7 @@ { TranslationLoader.lanKeys!.pleaseEnter!.tr, state.nameController), keyTimeLimitWidget(), - SizedBox(height: 10.h), keyBottomWidget() ], ); @@ -137,16 +137,12 @@ class _AddFaceTypePageState extends State { action: () async { Pickers.showDatePicker(context, mode: DateMode.YMDHM, onConfirm: (p) { - setState(() { - setState(() { - state.beginTime.value = - '${p.year}-${p.month!.toString().padLeft(2, '0')}-${p.day!.toString().padLeft(2, '0')} ${p.hour!.toString().padLeft(2, '0')}:${p.minute!.toString().padLeft(2, '0')}'; - state.beginTimeTimestamp.value = - DateTime.parse(state.beginTime.value) - .millisecondsSinceEpoch - .toString(); - }); - }); + state.beginTime.value = + '${p.year}-${p.month!.toString().padLeft(2, '0')}-${p.day!.toString().padLeft(2, '0')} ${p.hour!.toString().padLeft(2, '0')}:${p.minute!.toString().padLeft(2, '0')}'; + state.beginTimeTimestamp.value = + DateTime.parse(state.beginTime.value) + .millisecondsSinceEpoch + .toString(); }); })), Obx(() => CommonItem( @@ -156,16 +152,12 @@ class _AddFaceTypePageState extends State { action: () { Pickers.showDatePicker(context, mode: DateMode.YMDHM, onConfirm: (p) { - setState(() { - setState(() { - state.endTime.value = - '${p.year}-${p.month!.toString().padLeft(2, '0')}-${p.day!.toString().padLeft(2, '0')} ${p.hour!.toString().padLeft(2, '0')}:${p.minute!.toString().padLeft(2, '0')}'; - state.endTimeTimestamp.value = - DateTime.parse(state.endTime.value) - .millisecondsSinceEpoch - .toString(); - }); - }); + state.endTime.value = + '${p.year}-${p.month!.toString().padLeft(2, '0')}-${p.day!.toString().padLeft(2, '0')} ${p.hour!.toString().padLeft(2, '0')}:${p.minute!.toString().padLeft(2, '0')}'; + state.endTimeTimestamp.value = + DateTime.parse(state.endTime.value) + .millisecondsSinceEpoch + .toString(); }); })), Container(height: 10.h), @@ -183,6 +175,13 @@ class _AddFaceTypePageState extends State { // isHaveRightWidget: true, // rightWidget: SizedBox( // width: 60.w, height: 50.h, child: _isStressFingerprint())), + CommonItem( + leftTitel: "是否是管理员", + rightTitle: "", + isTipsImg: false, + isHaveRightWidget: true, + rightWidget: SizedBox( + width: 60.w, height: 50.h, child: Obx(() => _isAdmin()))), SizedBox(height: 30.h), SubmitBtn( btnName: TranslationLoader.lanKeys!.next!.tr, @@ -305,4 +304,17 @@ class _AddFaceTypePageState extends State { ), ); } + + // 是否是管理员 + CupertinoSwitch _isAdmin() { + return CupertinoSwitch( + activeColor: CupertinoColors.activeBlue, + trackColor: CupertinoColors.systemGrey5, + thumbColor: CupertinoColors.white, + value: state.isAdministrator.value, + onChanged: (value) { + state.isAdministrator.value = value; + }, + ); + } } diff --git a/star_lock/lib/main/lockDetail/face/addFaceType/addFaceType_state.dart b/star_lock/lib/main/lockDetail/face/addFaceType/addFaceType_state.dart index 8af55b3b..412ed2d0 100644 --- a/star_lock/lib/main/lockDetail/face/addFaceType/addFaceType_state.dart +++ b/star_lock/lib/main/lockDetail/face/addFaceType/addFaceType_state.dart @@ -7,6 +7,7 @@ class AddFaceTypeState { final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入 var fromTypeTwoStaffName = "".obs; // 考勤添加人脸员工名字 final isStressFingerprint = false.obs; + final isAdministrator = false.obs; // 是否是管理员 var beginTime = "".obs; // 开始时间 var endTime = "".obs; // 结束时间 diff --git a/star_lock/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart b/star_lock/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart index d8b14f5d..1fe16714 100644 --- a/star_lock/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart +++ b/star_lock/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart @@ -91,6 +91,7 @@ class FingerprintItemData { int? faceType; List? cyclicConfig; String? featureData; + int? faceRight; FingerprintItemData( {this.fingerprintStatus, @@ -119,7 +120,8 @@ class FingerprintItemData { this.addType, this.faceType, this.cyclicConfig, - this.featureData}); + this.featureData, + this.faceRight}); FingerprintItemData.fromJson(Map json) { fingerprintStatus = json['fingerprintStatus']; @@ -149,6 +151,7 @@ class FingerprintItemData { faceType = json['faceType']; cyclicConfig = json['cyclicConfig']; featureData = json['featureData']; + faceRight = json['faceRight']; } Map toJson() { @@ -180,6 +183,7 @@ class FingerprintItemData { data['faceType'] = faceType; data['cyclicConfig'] = cyclicConfig; data['featureData'] = featureData; + data['faceRight'] = faceRight; return data; } diff --git a/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart b/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart index 2c429680..09d702d0 100644 --- a/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart +++ b/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart @@ -1,7 +1,11 @@ +import 'dart:io'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:permission_handler/permission_handler.dart'; import 'package:star_lock/flavors.dart'; import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart'; import '../../../appRouters.dart'; @@ -18,7 +22,7 @@ class MineSetPage extends StatefulWidget { State createState() => _MineSetPageState(); } -class _MineSetPageState extends State { +class _MineSetPageState extends State with WidgetsBindingObserver { final logic = Get.put(MineSetLogic()); final state = Get.find().state; @@ -26,11 +30,25 @@ class _MineSetPageState extends State { void initState() { super.initState(); + WidgetsBinding.instance.addObserver(this); + logic.userSettingsInfoRequest(); } + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + super.didChangeAppLifecycleState(state); + if (state == AppLifecycleState.resumed) { + // 应用从后台返回前台 + // 在这里执行相应的操作 + _checkNotificationPermission(); + } + } + @override Widget build(BuildContext context) { + _checkNotificationPermission(); + return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( @@ -371,8 +389,45 @@ class _MineSetPageState extends State { thumbColor: CupertinoColors.white, value: state.isPushNotification.value, onChanged: (value) { - state.isPushNotification.value = !state.isPushNotification.value; + // state.isPushNotification.value = !state.isPushNotification.value; + openAppSettings(); }, ); } + + Future _checkNotificationPermission() async { + bool notificationEnabled = false; + + if (Platform.isAndroid) { + notificationEnabled = await state.flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + AndroidFlutterLocalNotificationsPlugin>() + ?.areNotificationsEnabled() ?? + false; + } else if (Platform.isIOS) { + notificationEnabled = await state.flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + IOSFlutterLocalNotificationsPlugin>() + ?.requestPermissions( + alert: true, + badge: true, + sound: true, + ) ?? + false; + } + + if (notificationEnabled) { + print('Notifications are enabled'); + state.isPushNotification.value = true; + } else { + print('Notifications are disabled'); + state.isPushNotification.value = false; + } + } + + @override + void dispose() { + WidgetsBinding.instance.removeObserver(this); + super.dispose(); + } } diff --git a/star_lock/lib/mine/mineSet/mineSet/mineSet_state.dart b/star_lock/lib/mine/mineSet/mineSet/mineSet_state.dart index 7c738b38..1caccd3d 100644 --- a/star_lock/lib/mine/mineSet/mineSet/mineSet_state.dart +++ b/star_lock/lib/mine/mineSet/mineSet/mineSet_state.dart @@ -1,3 +1,4 @@ +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:get/get.dart'; import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart'; @@ -13,4 +14,6 @@ class MineSetState { var hideExpiredAccessFlag = 2.obs; //隐藏无效开锁 var currentLanguage = "".obs; //隐藏无效开锁 + late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = + FlutterLocalNotificationsPlugin(); } diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index 3dbcbcc1..61170d8e 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -1059,6 +1059,7 @@ class ApiProvider extends BaseProvider { String featureData, String addType, List cyclicConfig, + int faceRight, ) => post( addFaceURL.toUrl, @@ -1072,6 +1073,7 @@ class ApiProvider extends BaseProvider { 'featureData': featureData, 'addType': addType, 'cyclicConfig': cyclicConfig, + 'faceRight': faceRight })); // 校验人脸名字是否重复 @@ -1267,11 +1269,7 @@ class ApiProvider extends BaseProvider { // 移除坏锁 Future removeBrokenLockData(List lockIdList) => - post( - removeBadLockURL.toUrl, - jsonEncode({ - 'lockIds': lockIdList - })); + post(removeBadLockURL.toUrl, jsonEncode({'lockIds': lockIdList})); Future listLockByGroup(String type, String keyGroupId) => post( listLockByGroupURL.toUrl, diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index fc41aab0..99175bdf 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -1193,19 +1193,28 @@ class ApiRepository { } // 添加人脸 - Future addFaceData({ - required int lockId, - required String faceName, - required String faceNumber, - required int faceType, - required int startDate, - required int endDate, - required String featureData, - required String addType, - required List cyclicConfig, - }) async { - final res = await apiProvider.addFaceData(lockId, faceName, faceNumber, - faceType, startDate, endDate, featureData, addType, cyclicConfig); + Future addFaceData( + {required int lockId, + required String faceName, + required String faceNumber, + required int faceType, + required int startDate, + required int endDate, + required String featureData, + required String addType, + required List cyclicConfig, + required int faceRight}) async { + final res = await apiProvider.addFaceData( + lockId, + faceName, + faceNumber, + faceType, + startDate, + endDate, + featureData, + addType, + cyclicConfig, + faceRight); return AddFaceEntity.fromJson(res.body); } diff --git a/star_lock/pubspec.yaml b/star_lock/pubspec.yaml index 32c5fc88..54a0eb76 100644 --- a/star_lock/pubspec.yaml +++ b/star_lock/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.15+20240313 +version: 1.0.15+2024031501 environment: sdk: '>=2.12.0 <3.0.0' @@ -142,6 +142,7 @@ dependencies: flutter_slidable: ^3.0.1 audio_service: ^0.18.12 app_settings: ^5.1.1 + flutter_local_notifications: ^17.0.0 system_settings: ^2.0.0 dev_dependencies: