diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2131843f..c5fcc10b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,6 +60,8 @@ variables: .setup_fastlane_android: extends: .build_rule before_script: + - export PUB_HOSTED_URL=https://pub.flutter-io.cn + - export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn - ls -li - export NEXT_VERSION="$(cat app_new.version)" # - flutter pub get @@ -74,6 +76,8 @@ variables: .setup_fastlane_ios: extends: .build_rule before_script: + - export PUB_HOSTED_URL=https://pub.flutter-io.cn + - export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn - ls -li - export NEXT_VERSION="$(cat app_new.version)" # - flutter pub get @@ -98,7 +102,6 @@ generate_git_tag: stage: generate_tag_or_version extends: .generate_tag_rule before_script: - - bash pre_build.sh xhj - bash pre_build.sh sky - project_url=$(echo $CI_PROJECT_URL | sed 's/http:\/\///') - echo "project_url:$project_url" @@ -155,16 +158,10 @@ create-release: - export StarLock_VERSION=${CI_COMMIT_TAG#*-} - echo "Uploading StarLock-${StarLock_VERSION} packages to ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${StarLock_VERSION}/StarLock-${StarLock_VERSION}-*" - - 'curl -i --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/app/outputs/flutter-apk/starlock-xhj-release-${CI_COMMIT_TAG}.apk - "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${StarLock_VERSION}/starlock-xhj-release-${CI_COMMIT_TAG}.apk"' - - 'curl -i --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/app/outputs/flutter-apk/starlock-xhj_bundle-release-${CI_COMMIT_TAG}.aab - "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${StarLock_VERSION}/starlock-xhj_bundle-release-${CI_COMMIT_TAG}.aab"' - 'curl -i --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/app/outputs/flutter-apk/starlock-sky-release-${CI_COMMIT_TAG}.apk "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${StarLock_VERSION}/starlock-sky-release-${CI_COMMIT_TAG}.apk"' - 'curl -i --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/app/outputs/flutter-apk/starlock-sky-release-${CI_COMMIT_TAG}.aab "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${StarLock_VERSION}/starlock-sky-release-${CI_COMMIT_TAG}.aab"' - - 'curl -i --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/app/outputs/flutter-ipa/starlock-xhj-release-${CI_COMMIT_TAG}.ipa - "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${StarLock_VERSION}/starlock-xhj-release-${CI_COMMIT_TAG}.ipa"' - 'curl -i --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build/app/outputs/flutter-ipa/starlock-sky-release-${CI_COMMIT_TAG}.ipa "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${StarLock_VERSION}/starlock-sky-release-${CI_COMMIT_TAG}.ipa"' release: @@ -174,21 +171,12 @@ create-release: ref: '$CI_COMMIT_TAG' assets: links: - - name: 'xhj apk binary package' - url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${CI_COMMIT_TAG}/starlock-xhj-release-${CI_COMMIT_TAG}.apk' - link_type: 'package' - - name: 'xhj bundle binary package' - url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${CI_COMMIT_TAG}/starlock-xhj_bundle-release-${CI_COMMIT_TAG}.aab' - link_type: 'package' - name: 'sky apk binary package' url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${CI_COMMIT_TAG}/starlock-sky-release-${CI_COMMIT_TAG}.apk' link_type: 'package' - name: 'sky bundle binary package' url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${CI_COMMIT_TAG}/starlock-sky-release-${CI_COMMIT_TAG}.aab' link_type: 'package' - - name: 'xhj ipa binary package' - url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${CI_COMMIT_TAG}/starlock-xhj-release-${CI_COMMIT_TAG}.ipa' - link_type: 'package' - name: 'sky ipa binary package' url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${CI_COMMIT_TAG}/starlock-sky-release-${CI_COMMIT_TAG}.ipa' link_type: 'package' diff --git a/android/build.sh b/android/build.sh index 40a15413..ae42354d 100755 --- a/android/build.sh +++ b/android/build.sh @@ -13,21 +13,16 @@ regex='^v[0-9]+\.[0-9]+\.[0-9]+_sky$' if [[ "${ENV_BUILD_BRANCH}" == "canary_release_sky" ]]; then echo "===build canary_release: ${NEXT_VERSION}" export ENV_BUILD_TAG=${NEXT_VERSION} - bundle exec fastlane release_apk flavor:xhj --verbose bundle exec fastlane release_apk flavor:sky --verbose elif [[ $ENV_BUILD_TAG =~ $regex ]]; then echo "===build release===$ENV_BUILD_TAG" - bundle exec fastlane release_apk flavor:xhj --verbose bundle exec fastlane release_apk flavor:sky --verbose - bundle exec fastlane release_bundle flavor:xhj_bundle --verbose bundle exec fastlane release_bundle flavor:sky --verbose elif [[ "${ENV_BUILD_BRANCH}" == "develop_sky" ]]; then echo "===build dev===${NEXT_VERSION}" - bundle exec fastlane beta flavor:xhj env:dev --verbose bundle exec fastlane beta flavor:sky env:dev --verbose elif [[ "${ENV_BUILD_BRANCH}" == "release_sky" || "${ENV_BUILD_BRANCH}" == "feat_devops_sky" ]] ; then echo "===build pre===${NEXT_VERSION}" - bundle exec fastlane beta flavor:xhj env:pre --verbose bundle exec fastlane beta flavor:sky env:pre --verbose fi exit 0 \ No newline at end of file diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index a99f62f0..bd6d5449 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -44,10 +44,6 @@ platform :android do print_header '🏁 Before All' print_log $current_branch print_log $current_tag - print_log $path_file_preview_apk_default - print_log $path_file_release_apk_default - print_log $path_file_preview_apk_copy - print_log $path_file_release_apk_copy Dir.chdir "../.." do sh('pwd') end @@ -55,11 +51,9 @@ platform :android do desc "Submit a new Beta Build to Pgy Beta" lane :beta do |options| - flavor = options[:flavor] env = options[:env] - UI.user_error!("flavor is required") unless flavor UI.user_error!("env is required") unless env - print_log "build #{flavor} on #{env}" + print_log "build sky on #{env}" build_number = Time.now.strftime("%Y%m%d%H") print_log "BuildNo #{build_number}" build_version = $next_version @@ -70,10 +64,10 @@ platform :android do remove_zone_pre_build(zone:"com") Dir.chdir "../.." do sh("flutter","pub","get") - sh("flutter", "build", "apk", "--no-tree-shake-icons", "--release", "--flavor", "#{flavor}_#{env}", "-t", "lib/main_#{flavor}_#{env}.dart", "--build-number=#{build_number}", "--build-name=#{build_version}") + sh("flutter", "build", "apk", "--no-tree-shake-icons", "--release", "--flavor", "sky_#{env}", "-t", "lib/main_sky_#{env}.dart", "--build-number=#{build_number}", "--build-name=#{build_version}") end - old_file_path = File.join($path_apk_output_dir, "app-#{flavor}_#{env}-release.apk") - new_file_path = File.join($path_apk_output_dir, "starlock-#{flavor}-preview-#{build_version}.apk") + old_file_path = File.join($path_apk_output_dir, "app-sky_#{env}-release.apk") + new_file_path = File.join($path_apk_output_dir, "starlock-sky-preview-#{build_version}.apk") File.rename(old_file_path, new_file_path) logs = changelog_from_git_commits( pretty: '- %s (%cn)', @@ -85,9 +79,7 @@ platform :android do desc "Build & upload a new version to Gitlab Release" lane :release_apk do |options| - flavor = options[:flavor] - UI.user_error!("flavor is required") unless flavor - print_log "build flavor for: #{flavor}" + print_log "build sky" build_number = Time.now.strftime("%Y%m%d%H") print_log "BuildNo #{build_number}" build_version = $current_tag.match(/^v(\d+\.\d+\.\d+)/).captures[0] @@ -98,18 +90,16 @@ platform :android do remove_zone_pre_build(zone:"com") Dir.chdir "../.." do sh("flutter","pub","get") - sh("flutter", "build", "apk", "--no-tree-shake-icons", "--release", "--flavor", "#{flavor}", "-t", "lib/main_#{flavor}_lite.dart", "--build-number=#{build_number}", "--build-name=#{build_version}") + sh("flutter", "build", "apk", "--no-tree-shake-icons", "--release", "--flavor", "sky", "-t", "lib/main_sky_lite.dart", "--build-number=#{build_number}", "--build-name=#{build_version}") end - old_apk_file_path = File.join($path_apk_output_dir, "app-#{flavor}-release.apk") - new_apk_file_path = File.join($path_apk_output_dir, "starlock-#{flavor}-release-"+$current_tag+".apk") + old_apk_file_path = File.join($path_apk_output_dir, "app-sky-release.apk") + new_apk_file_path = File.join($path_apk_output_dir, "starlock-sky-release-"+$current_tag+".apk") File.rename(old_apk_file_path, new_apk_file_path) end desc "Build & upload a new version to Gitlab Release" lane :release_bundle do |options| - flavor = options[:flavor] - UI.user_error!("flavor is required") unless flavor - print_log "build flavor for: #{flavor}" + print_log "build sky" build_number = Time.now.strftime("%Y%m%d%H") print_log "BuildNo #{build_number}" build_version = $current_tag.match(/^v(\d+\.\d+\.\d+)/).captures[0] @@ -120,10 +110,10 @@ platform :android do remove_zone_pre_build(zone:"cn") Dir.chdir "../.." do sh("flutter","pub","get") - sh("flutter", "build", "appbundle", "--no-tree-shake-icons", "--release", "--flavor", "#{flavor}", "-t", "lib/main_#{flavor}_lite.dart", "--build-number=#{build_number}", "--build-name=#{build_version}") + sh("flutter", "build", "appbundle", "--no-tree-shake-icons", "--release", "--flavor", "sky", "-t", "lib/main_sky_lite.dart", "--build-number=#{build_number}", "--build-name=#{build_version}") end - old_bundle_file_path = File.join($path_bundle_output_dir , "/#{flavor}Release/app-#{flavor}-release.aab") - new_bundle_file_path = File.join($path_bundle_output_dir , "/#{flavor}Release/starlock-#{flavor}-release-"+$current_tag+".aab") + old_bundle_file_path = File.join($path_bundle_output_dir , "/skyRelease/app-sky-release.aab") + new_bundle_file_path = File.join($path_bundle_output_dir , "/skyRelease/starlock-sky-release-"+$current_tag+".aab") File.rename(old_bundle_file_path, new_bundle_file_path) sh('cp',new_bundle_file_path,$path_apk_output_dir) end diff --git a/ios/build.sh b/ios/build.sh index 2c46b1f1..2010a2cb 100755 --- a/ios/build.sh +++ b/ios/build.sh @@ -14,19 +14,15 @@ regex='^v[0-9]+\.[0-9]+\.[0-9]+_sky$' if [[ "${ENV_BUILD_BRANCH}" == "canary_release_sky" ]]; then echo "===build canary_release: ${NEXT_VERSION}" export ENV_BUILD_TAG=${NEXT_VERSION} - bundle exec fastlane release_ipa flavor:xhj --verbose bundle exec fastlane release_ipa flavor:sky --verbose elif [[ $ENV_BUILD_TAG =~ $regex ]]; then echo "===build release===$ENV_BUILD_TAG" - bundle exec fastlane release_ipa flavor:xhj --verbose bundle exec fastlane release_ipa flavor:sky --verbose elif [[ "${ENV_BUILD_BRANCH}" == "develop_sky" ]]; then echo "===build dev===${NEXT_VERSION}" - bundle exec fastlane beta flavor:xhj env:Dev --verbose bundle exec fastlane beta flavor:sky env:Dev --verbose elif [[ "${ENV_BUILD_BRANCH}" == "release_sky" || "${ENV_BUILD_BRANCH}" == "feat_devops_sky" ]] ; then echo "===build pre===${NEXT_VERSION}" - bundle exec fastlane beta flavor:xhj env:Pre --verbose bundle exec fastlane beta flavor:sky env:Pre --verbose fi exit 0 \ No newline at end of file diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 895ba92e..2ab2fc24 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -17,22 +17,13 @@ default_platform(:ios) # setup_travis -# --- xhj Const --- -$signing_identity_xhj_distribution = 'iPhone Distribution: Shenzhen Xinhongjia Electronics Co., Ltd. (P8997RW3V8)' -$app_identifier = 'xhj' -$provisioning_name_adhoc = 'StarApt Project Mobile Ad Hoc' -$provisioning_name_distribution = 'StarApt Project Mobile Distribution' -$gym_config_sky_preview = 'Preview-xhj' -$gym_config_sky_release = 'Release' - # --- sky Const --- -$signing_identity_sky_distribution = 'iPhone Distribution: Shenzhen Xinhongjia Electronics Co., Ltd. (P8997RW3V8)' +$signing_identity_distribution = 'iPhone Distribution: Shenzhen Xinhongjia Electronics Co., Ltd. (P8997RW3V8)' $app_identifier = 'sky' $provisioning_name_adhoc = 'StarApt Project Mobile Ad Hoc' $provisioning_name_distribution = 'StarApt Project Mobile Distribution' -$gym_config_sky_preview = 'Preview-sky' -$gym_config_sky_release = 'Release' - +$gym_config_preview = 'Preview-sky' +$gym_config_release = 'Release' # --- common Const --- $match_type_adhoc = 'adhoc' @@ -72,14 +63,12 @@ platform :ios do desc "Build & Deliver to Pgy" lane :beta do |options| - flavor = options[:flavor] env = options[:env] - UI.user_error!("flavor is required") unless flavor UI.user_error!("env is required") unless env - print_log "build #{flavor} on #{env}" + print_log "build sky on #{env}" build_number = Time.now.strftime("%Y%m%d%H%M") print_log "Build Commits #{build_number}" - build_version = $next_version # Time.now.strftime("%Y%m%d%H%M%S") + build_version = $next_version print_log "build_version #{build_version}" commit_hash = last_git_commit short_hash = commit_hash[:abbreviated_commit_hash] @@ -89,18 +78,16 @@ platform :ios do sh("flutter","pub","get") end Dir.chdir ".." do - #sh("bundle", "exec" ,"pod", "install") sh("pod", "install") end Dir.chdir "../.." do - sh("flutter", "build", "ios", "--no-tree-shake-icons", "--no-codesign", "--release", "--flavor", "#{flavor}", "-t", "lib/main_#{flavor}_#{env}.dart", "--build-number=#{build_number}", "--build-name=#{build_version}") + sh("flutter", "build", "ios", "--no-tree-shake-icons", "--no-codesign", "--release", "--flavor", "sky", "-t", "lib/main_sky_#{env}.dart", "--build-number=#{build_number}", "--build-name=#{build_version}") end - #set_bundle_short_version('./Runner/Info.plist', $current_branch) - gym_scheme_preview="#{flavor}" + gym_scheme_preview="sky" print_log "gym_scheme_preview #{gym_scheme_preview}" - gym_configuration = "#{env}-release-#{flavor}" + gym_configuration = "#{env}-release-sky" print_log "gym_configuration #{gym_configuration}" - ipa_default_filename = "starlock-#{flavor}-preview-#{build_version}.ipa" + ipa_default_filename = "starlock-sky-preview-#{build_version}.ipa" print_log "ipa_default_filename #{ipa_default_filename}" gym( scheme: gym_scheme_preview, @@ -111,10 +98,8 @@ platform :ios do export_method: "ad-hoc", export_options: { provisioningProfiles: { - "com.xhjcn.lock.dev" => "Adhoc_com.xhjcn.lock.dev.mobileprovision", - "com.xhjcn.lock.pre" => "Adhoc_com.xhjcn.lock.pre.mobileprovision", "com.skychip.lock.dev" => "Adhoc_com.skychip.lock.dev.mobileprovision", - "com.skychip.lock.pre" => "Adhoc_com.skychip.lock.pre.mobileprovision", + "com.skychip.lock.pre" => "Adhoc_com.skychip.lock.pre.mobileprovision" } } ) @@ -128,9 +113,7 @@ platform :ios do desc "Build & Deliver to App Store Connect" lane :release_ipa do |options| - flavor = options[:flavor] - UI.user_error!("flavor is required") unless flavor - print_log "build flavor: #{flavor}" + print_log "build sky" build_number = Time.now.strftime("%Y%m%d%H%M") print_log "Build Commits #{build_number}" build_version = $current_tag.match(/^v(\d+\.\d+\.\d+)/).captures[0] @@ -143,17 +126,16 @@ platform :ios do sh("flutter","pub","get") end Dir.chdir ".." do - #sh("bundle", "exec" ,"pod", "install") sh("pod", "install") end Dir.chdir "../.." do - sh("flutter", "build", "ios", "--no-tree-shake-icons", "--no-codesign", "--release", "--flavor", "#{flavor}", "-t", "lib/main_#{flavor}_lite.dart", "--build-number=#{build_number}", "--build-name=#{build_version}") + sh("flutter", "build", "ios", "--no-tree-shake-icons", "--no-codesign", "--release", "--flavor", "sky", "-t", "lib/main_sky_lite.dart", "--build-number=#{build_number}", "--build-name=#{build_version}") end - gym_scheme_release="#{flavor}" + gym_scheme_release="sky" print_log "gym_scheme_release #{gym_scheme_release}" - gym_configuration = "Release-#{flavor}" + gym_configuration = "Release-sky" print_log "gym_configuration #{gym_configuration}" - ipa_default_filename = "starlock-#{flavor}-release-"+$current_tag+".ipa" + ipa_default_filename = "starlock-sky-release-"+$current_tag+".ipa" print_log "ipa_default_filename #{ipa_default_filename}" gym( scheme: gym_scheme_release, @@ -164,12 +146,11 @@ platform :ios do export_method: "app-store", export_options: { provisioningProfiles: { - "com.xhjcn.lock" => "Appstore_com.xhjcn.lock.mobileprovision", - "com.skychip.lock" => "Appstore_com.skychip.lock.mobileprovision", + "com.skychip.lock" => "Appstore_com.skychip.lock.mobileprovision" } } ) - auth_key_prefix=flavor.upcase + auth_key_prefix="SKY" print_log "auth_key_prefix #{auth_key_prefix}" api_key = app_store_connect_api_key( key_id: ENV["#{auth_key_prefix}_APPLE_AUTH_KEY_ID"], diff --git a/lib/login/login/starLock_login_logic.dart b/lib/login/login/starLock_login_logic.dart index f0523d0e..999ae9d6 100755 --- a/lib/login/login/starLock_login_logic.dart +++ b/lib/login/login/starLock_login_logic.dart @@ -188,23 +188,23 @@ class StarLockLoginLogic extends BaseGetXController { late StreamSubscription _agreePrivacySubscription; void _initEventListen() { - _agreePrivacySubscription = eventBus - .on() - .listen((AgreePrivacyAgreement event) async { - /// 检查ip如果属于国内才进行初始化 - final CheckIPEntity entity = await ApiRepository.to.checkIpAction(ip: ''); - String currentLanguage = - CurrentLocaleTool.getCurrentLocaleString(); // 当前选择语言 - // 判断如果ip是国内的且选的是中文才初始化一键登录 - if (entity.data!.abbreviation?.toLowerCase() == 'cn' && - currentLanguage == 'zh_CN') { - // 初始化一键登录服务 - await JverifyOneClickLoginManage(); - state.isCheckVerifyEnable.value = - await JverifyOneClickLoginManage().checkVerifyEnable(); - AppLog.log('一键登录初始化认证结果:${state.isCheckVerifyEnable.value}'); - } - }); + // _agreePrivacySubscription = eventBus + // .on() + // .listen((AgreePrivacyAgreement event) async { + // /// 检查ip如果属于国内才进行初始化 + // final CheckIPEntity entity = await ApiRepository.to.checkIpAction(ip: ''); + // String currentLanguage = + // CurrentLocaleTool.getCurrentLocaleString(); // 当前选择语言 + // // 判断如果ip是国内的且选的是中文才初始化一键登录 + // if (entity.data!.abbreviation?.toLowerCase() == 'cn' && + // currentLanguage == 'zh_CN') { + // // 初始化一键登录服务 + // await JverifyOneClickLoginManage(); + // state.isCheckVerifyEnable.value = + // await JverifyOneClickLoginManage().checkVerifyEnable(); + // AppLog.log('一键登录初始化认证结果:${state.isCheckVerifyEnable.value}'); + // } + // }); } @override diff --git a/lib/main.dart b/lib/main.dart index 69901fff..c74c51d8 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -106,20 +106,20 @@ Future privacySDKInitialization() async { await jpushProvider.initJPushService(); NotificationService().init(); // 初始化通知服务 - /// 检查ip如果属于国内才进行初始化 - final CheckIPEntity entity = await ApiRepository.to.checkIpAction(ip: ''); - if (entity.errorCode!.codeIsSuccessful) { - String currentLanguage = - CurrentLocaleTool.getCurrentLocaleString(); // 当前选择语言 - // 判断如果ip是国内的且选的是中文才初始化一键登录 - if (entity.data!.abbreviation?.toLowerCase() == 'cn' && - currentLanguage == 'zh_CN') { - // 初始化一键登录服务 - final StarLockLoginLogic loginLogic = Get.put(StarLockLoginLogic()); - await JverifyOneClickLoginManage(); - loginLogic.state.isCheckVerifyEnable.value = - await JverifyOneClickLoginManage().checkVerifyEnable(); - eventBus.fire(AgreePrivacyAgreement()); - } - } + // /// 检查ip如果属于国内才进行初始化 + // final CheckIPEntity entity = await ApiRepository.to.checkIpAction(ip: ''); + // if (entity.errorCode!.codeIsSuccessful) { + // String currentLanguage = + // CurrentLocaleTool.getCurrentLocaleString(); // 当前选择语言 + // // 判断如果ip是国内的且选的是中文才初始化一键登录 + // if (entity.data!.abbreviation?.toLowerCase() == 'cn' && + // currentLanguage == 'zh_CN') { + // // 初始化一键登录服务 + // final StarLockLoginLogic loginLogic = Get.put(StarLockLoginLogic()); + // await JverifyOneClickLoginManage(); + // loginLogic.state.isCheckVerifyEnable.value = + // await JverifyOneClickLoginManage().checkVerifyEnable(); + // eventBus.fire(AgreePrivacyAgreement()); + // } + // } } diff --git a/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart b/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart index 8d8140e6..8dcc731a 100755 --- a/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart +++ b/lib/main/lockDetail/card/cardDetail/cardDetail_page.dart @@ -220,8 +220,7 @@ class _CardDetailPageState extends State with RouteAware { left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: () async { - final bool isNetWork = - await LockMainLogic.to()?.judgeTheNetwork() ?? false; + final bool isNetWork = await logic.isConnected(); if (!isNetWork) { return; } diff --git a/lib/main/lockDetail/face/faceDetail/faceDetail_page.dart b/lib/main/lockDetail/face/faceDetail/faceDetail_page.dart index e4af7a36..fe038d53 100755 --- a/lib/main/lockDetail/face/faceDetail/faceDetail_page.dart +++ b/lib/main/lockDetail/face/faceDetail/faceDetail_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -49,9 +48,7 @@ class _FaceDetailPageState extends State with RouteAware { Obx(() => lockDataListItem('姓名'.tr, state.typeName.value, () { // showCupertinoAlertDialog(context); ShowTipView().showTFViewAlertDialog( - state.changeNameController, - '修改姓名'.tr, - '修改姓名'.tr, () { + state.changeNameController, '修改姓名'.tr, '修改姓名'.tr, () { if (state.changeNameController.text.isEmpty) { logic.showToast('请输入姓名'.tr); return; @@ -178,7 +175,7 @@ class _FaceDetailPageState extends State with RouteAware { Visibility( visible: !F.isSKY, child: Obx( - () => CommonItem( + () => CommonItem( leftTitel: '是否为管理员'.tr, rightTitle: '', isTipsImg: false, @@ -215,12 +212,10 @@ class _FaceDetailPageState extends State with RouteAware { left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: () async { - final bool isNetWork = - await LockMainLogic.to()?.judgeTheNetwork() ?? false; + final bool isNetWork = await logic.isConnected(); if (!isNetWork) { return; } - ShowTipView().showIosTipWithContentDialog('确定要删除吗?'.tr, () async { state.isDeletFace.value = true; diff --git a/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart b/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart index fc018b40..0f61aa7c 100755 --- a/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart +++ b/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart @@ -222,8 +222,7 @@ class _FingerprintDetailPageState extends State left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: () async { - final bool isNetWork = - await LockMainLogic.to()?.judgeTheNetwork() ?? false; + final bool isNetWork = await logic.isConnected(); if (!isNetWork) { return; } diff --git a/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart b/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart index b9a39d6c..03c36a5c 100755 --- a/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart +++ b/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart @@ -180,8 +180,7 @@ class _PasswordKeyDetailPageState extends State left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: () async { - final bool isNetWork = - await LockMainLogic.to()?.judgeTheNetwork() ?? false; + final bool isNetWork = await logic.isConnected(); if (!isNetWork) { return; } diff --git a/lib/tools/baseGetXController.dart b/lib/tools/baseGetXController.dart index 9393acfc..901cb9ff 100755 --- a/lib/tools/baseGetXController.dart +++ b/lib/tools/baseGetXController.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:io'; +import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:get/get.dart'; @@ -175,6 +176,13 @@ class BaseGetXController extends GetxController { }); } + /// 判断网络是否连接 + Future isConnected() async { + final List connectResults = + await Connectivity().checkConnectivity(); + return !connectResults.contains(ConnectivityResult.none); + } + String getUseKeyTypeStr(int? startDate, int? endDate, int? keyType) { String useDateStr = ''; if (keyType == XSConstantMacro.keyTypeTime) { @@ -241,6 +249,8 @@ class BaseGetXController extends GetxController { } return result; } + + } ///Extension_Int diff --git a/lib/tools/keySearchWidget.dart b/lib/tools/keySearchWidget.dart index 783b5ce7..25c3e2ee 100755 --- a/lib/tools/keySearchWidget.dart +++ b/lib/tools/keySearchWidget.dart @@ -53,6 +53,7 @@ class KeySearchWidget extends StatelessWidget { controller: editingController, autofocus: false, textAlign: TextAlign.start, + textInputAction: TextInputAction.search, onChanged: (String value) { AppLog.log('onChanged:$value'); }, @@ -60,6 +61,7 @@ class KeySearchWidget extends StatelessWidget { AppLog.log('onEditingComplete:'); }, onSubmitted: (String value) { + FocusScope.of(context).unfocus(); // 收起键盘 onSubmittedAction!(); }, decoration: InputDecoration( diff --git a/lib/tools/titleAppBar.dart b/lib/tools/titleAppBar.dart index 06897eb2..1355e6de 100755 --- a/lib/tools/titleAppBar.dart +++ b/lib/tools/titleAppBar.dart @@ -64,6 +64,7 @@ class _TitleAppBarState extends State { EasyLoading.dismiss(); } Navigator.pop(context); + FocusScope.of(context).unfocus(); // 收起键盘 } }) : Container()), diff --git a/notify.sh b/notify.sh index 0a5ecf90..05a33d84 100755 --- a/notify.sh +++ b/notify.sh @@ -6,20 +6,16 @@ if [[ "${CI_COMMIT_BRANCH}" == "release_sky" ]] ; then WECAHT_WEBHOOK_URL=$PRE_QYWECAHT_WEBHOOK_URL SKY_IOS_DOWNLOAD_URL=$PRE_SKY_IOS_DOWNLOAD_URL SKY_ANDROID_DOWNLOAD_URL=$PRE_SKY_ANDROID_DOWNLOAD_URL - XHJ_IOS_DOWNLOAD_URL=$PRE_XHJ_IOS_DOWNLOAD_URL - XHJ_ANDROID_DOWNLOAD_URL=$PRE_XHJ_ANDROID_DOWNLOAD_URL elif [[ "${CI_COMMIT_BRANCH}" == "develop_sky" ]] || [[ "${CI_COMMIT_BRANCH}" == "feat_devops_sky" ]]; then WECAHT_WEBHOOK_URL=$DEV_QYWECAHT_WEBHOOK_URL SKY_IOS_DOWNLOAD_URL=$DEV_SKY_IOS_DOWNLOAD_URL SKY_ANDROID_DOWNLOAD_URL=$DEV_SKY_ANDROID_DOWNLOAD_URL - XHJ_IOS_DOWNLOAD_URL=$DEV_XHJ_IOS_DOWNLOAD_URL - XHJ_ANDROID_DOWNLOAD_URL=$DEV_XHJ_ANDROID_DOWNLOAD_URL fi if [[ "${BUILD_STATUS}" == "success" ]]; then TITLE="😎 构建成功" BUILD_STATUS_DESC="成功" - NOTIFICATION_CONENT='{"msgtype":"markdown","markdown":{"content":"'$TITLE'\n> **项目名称**: '$APP_PRODUCT_NAME'\n> **分支**: '$CI_COMMIT_REF_NAME'\n> **构建状态**: '$BUILD_STATUS_DESC'\n> **安装地址**:\n 锁通通 ** [iOS]('$SKY_IOS_DOWNLOAD_URL') ** ** [Android]('$SKY_ANDROID_DOWNLOAD_URL')**\n > ** 星星锁 ** [iOS]('$XHJ_IOS_DOWNLOAD_URL') ** ** [Android]('$XHJ_ANDROID_DOWNLOAD_URL')** \n> **详情查看**: [构建日志]('$CI_JOB_URL')"}}' + NOTIFICATION_CONENT='{"msgtype":"markdown","markdown":{"content":"'$TITLE'\n> **项目名称**: '$APP_PRODUCT_NAME'\n> **分支**: '$CI_COMMIT_REF_NAME'\n> **构建状态**: '$BUILD_STATUS_DESC'\n> **安装地址**:\n 锁通通 ** [iOS]('$SKY_IOS_DOWNLOAD_URL') ** ** [Android]('$SKY_ANDROID_DOWNLOAD_URL')** \n> **详情查看**: [构建日志]('$CI_JOB_URL')"}}' else TITLE="😥 部署失败" BUILD_STATUS_DESC="失败" diff --git a/tag_generator.sh b/tag_generator.sh index 03937d48..141408f9 100755 --- a/tag_generator.sh +++ b/tag_generator.sh @@ -60,27 +60,39 @@ else [ -z "$patch" ] && patch=0 compare_json="" if [[ "$1" == "generate_tag" ]];then - echo "generate_tag:$newest_sky_tag-to-master\n" - compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=$newest_sky_tag&to=master") + echo "generate_tag:$newest_sky_tag-to-master_sky\n" + compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=$newest_sky_tag&to=master_sky") elif [[ "$1" == "generate_version" ]]; then - echo "generate_version:master-to-$CI_COMMIT_BRANCH\n" - compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=master&to=$CI_COMMIT_BRANCH") + echo "generate_version:master_sky-to-$CI_COMMIT_BRANCH\n" + compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=master_sky&to=$CI_COMMIT_BRANCH") fi echo "compare_json:$compare_json\n" new_patch=$patch new_minor=$minor + seen_commits="" # 用于去重 while IFS= read -r commit_json; do commit_id=$(echo "$commit_json" | jq -r '.id') + commit_title=$(echo "$commit_json" | jq -r '.title') commit_message=$(echo "$commit_json" | jq -r '.message') + + # commit id 去重(兼容所有 shell) + if echo "$seen_commits" | grep -q "$commit_id"; then + continue + fi + seen_commits="$seen_commits $commit_id" + + # 跳过 Merge 和 Revert 提交 + if [[ "$commit_title" =~ ^Merge ]] || [[ "$commit_title" =~ ^Revert ]]; then + continue + fi + echo "----$commit_message" - if [[ "$commit_message" =~ ("feat:"*) ]] && [[ $new_minor == $minor ]]; then + if [[ "$commit_message" =~ ^feat: ]] && [[ $new_minor == $minor ]]; then ((new_minor++)) - elif [[ "$commit_message" =~ ("fix:"*) ]]; then - ((new_patch++)) - elif [[ ! "$commit_message" =~ ("Merge"* | "Revert"*) ]]; then + elif [[ "$commit_message" =~ ^fix: ]]; then ((new_patch++)) fi - done < <(echo "$compare_json" | jq -c '.commits[] | {id: .id, message: .message}') + done < <(echo "$compare_json" | jq -c '.commits[] | {id: .id, title: .title, message: .message}') next_tag="v${major}.${new_minor}.${new_patch}_sky" fi