Merge branch 'develop' of code.star-lock.cn:StarlockTeam/app-starlock into develop

# Conflicts:
#	ios/.DS_Store
This commit is contained in:
魏少阳 2024-10-28 11:55:38 +08:00
commit 6543fdd3ca
59 changed files with 2248 additions and 1399 deletions

BIN
.DS_Store vendored

Binary file not shown.

175
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,175 @@
stages:
- test
- generate_tag_or_version
- build-artifacts
- release-artifacts
- notification
variables:
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"
.build_rule:
tags:
- macos
- flutter
rules:
- if: $CI_COMMIT_BRANCH == "develop"
- if: $CI_COMMIT_BRANCH == "release"
- if: $CI_COMMIT_BRANCH =~ /feat_[a-zA-Z]+/
- if: $CI_COMMIT_BRANCH == "canary_release"
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$/
.generate_tag_rule:
tags:
- macos
- flutter
rules:
- if: $CI_COMMIT_BRANCH == "master"
.generate_next_version_rule:
tags:
- macos
- flutter
rules:
- if: $CI_COMMIT_BRANCH == "develop"
- if: $CI_COMMIT_BRANCH == "release"
- if: $CI_COMMIT_BRANCH == "canary_release"
- if: $CI_COMMIT_BRANCH =~ /feat_[a-zA-Z]+/
.print_env:
stage: test
extends: .build_rule
before_script:
- java --version
- printenv | while IFS='=' read -r key value; do echo "$key=$value"; done
after_script:
- echo "finished"
.setup_fastlane_android:
extends: .build_rule
before_script:
- ls -li
- export NEXT_VERSION="$(cat app_new.version)"
- flutter pub get
- bundle install --gemfile android/Gemfile --quiet
cache:
paths:
- app_new.version
.setup_fastlane_ios:
extends: .build_rule
before_script:
- ls -li
- export NEXT_VERSION="$(cat app_new.version)"
- flutter pub get
- bundle install --gemfile ios/Gemfile --quiet
cache:
paths:
- app_new.version
test_lint_check:
stage: test
extends: .print_env
script:
- echo "run lint check or per-test here"
tags:
- macos
- flutter
generate_git_tag:
stage: generate_tag_or_version
extends: .generate_tag_rule
before_script:
- project_url=$(echo $CI_PROJECT_URL | sed 's/http:\/\///')
- echo "project_url:$project_url"
- git remote set-url origin http://gitlab-ci-token:${GITLAB_ACCESS_TOKEN}@$project_url.git
script:
- bash tag_generator.sh generate_tag
generate_next_version:
stage: generate_tag_or_version
extends: .generate_next_version_rule
script:
- bash tag_generator.sh generate_version
cache:
paths:
- app_new.version
build_android:
stage: build-artifacts
extends: .setup_fastlane_android
script: bash android/build.sh
artifacts:
paths:
- build/app/outputs/flutter-apk/
build_ios:
stage: build-artifacts
extends: .setup_fastlane_ios
script:
- bash ios/build.sh
artifacts:
paths:
- build/app/outputs/flutter-ipa
create-release:
stage: release-artifacts
extends: .build_rule
dependencies:
- build_android
- build_ios
needs:
- job: build_android
artifacts: true
- job: build_ios
artifacts: true
rules:
- if: $CI_COMMIT_TAG
before_script:
- echo "start create release"
- bash release_description_generator.sh
- export RELEASE_DESCRIPTION="$(cat changelog.md)"
- echo "${RELEASE_DESCRIPTION}"
script:
- 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-release-${CI_COMMIT_TAG}.aab
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${StarLock_VERSION}/starlock-xhj-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:
name: '$CI_COMMIT_TAG'
description: '$(cat changelog.md)'
tag_name: '$CI_COMMIT_TAG'
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-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'

6
android/Gemfile Normal file
View File

@ -0,0 +1,6 @@
source "https://rubygems.org"
gem "fastlane"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)

221
android/Gemfile.lock Normal file
View File

@ -0,0 +1,221 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.7)
base64
nkf
rexml
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.979.0)
aws-sdk-core (3.209.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.94.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.166.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.10.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.2.0)
claide (1.1.0)
colored (1.2)
colored2 (3.1.2)
commander (4.6.0)
highline (~> 2.0.0)
declarative (0.0.20)
digest-crc (0.6.5)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.109.0)
faraday (1.10.4)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.1)
faraday (~> 1.0)
fastimage (2.3.1)
fastlane (2.222.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored (~> 1.2)
commander (~> 4.6)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
faraday (~> 1.0)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-apis-androidpublisher_v3 (~> 0.3)
google-apis-playcustomapp_v1 (~> 0.1)
google-cloud-env (>= 1.6.0, < 2.0.0)
google-cloud-storage (~> 1.31)
highline (~> 2.0)
http-cookie (~> 1.0.5)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (>= 2.0.0, < 3.0.0)
naturally (~> 2.2)
optparse (>= 0.1.1, < 1.0.0)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.5)
simctl (~> 1.6.3)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (~> 3)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-plugin-pgyer (0.2.9)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.54.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-core (0.11.3)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
rexml
google-apis-iamcredentials_v1 (0.17.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-playcustomapp_v1 (0.13.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-storage_v1 (0.29.0)
google-apis-core (>= 0.11.0, < 2.a)
google-cloud-core (1.6.1)
google-cloud-env (>= 1.0, < 3.a)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-errors (1.3.1)
google-cloud-storage (1.45.0)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.29.0)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (1.8.1)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.7)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.6.2)
json (2.7.2)
jwt (2.9.1)
base64
mini_magick (4.13.2)
mini_mime (1.1.5)
multi_json (1.15.0)
multipart-post (2.4.1)
nanaimo (0.3.0)
naturally (2.2.1)
nkf (0.2.0)
optparse (0.5.0)
os (1.1.4)
plist (3.7.1)
public_suffix (5.1.1)
rake (13.2.1)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.3.7)
rouge (2.0.7)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
security (0.1.5)
signet (0.18.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.10)
CFPropertyList
naturally
terminal-notifier (2.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
trailblazer-option (0.1.2)
tty-cursor (0.7.1)
tty-screen (0.8.2)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
uber (0.1.0)
unf (0.2.0)
unicode-display_width (2.6.0)
word_wrap (1.0.0)
xcodeproj (1.25.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (>= 3.3.2, < 4.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)
PLATFORMS
ruby
DEPENDENCIES
fastlane
fastlane-plugin-pgyer
BUNDLED WITH
1.17.2

View File

@ -106,10 +106,22 @@ android {
dimension "flavor-type"
applicationId "com.skychip.lock"
signingConfig signingConfigs.sky
resValue "string", "app_name", "斯凯智能"
resValue "string", "app_name", "锁通通"
manifestPlaceholders.JPUSH_PKGNAME = "com.skychip.lock"
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules-sky.pro'
}
sky_pre {
dimension "flavor-type"
applicationId "com.skychip.lock.pre"
signingConfig signingConfigs.sky
resValue "string", "app_name", "锁通通-P"
}
sky_dev {
dimension "flavor-type"
applicationId "com.skychip.lock.dev"
signingConfig signingConfigs.sky
resValue "string", "app_name", "锁通通-D"
}
xhj {
dimension "flavor-type"
applicationId "com.xhjcn.lock"
@ -118,6 +130,18 @@ android {
manifestPlaceholders.JPUSH_PKGNAME = "com.xhjcn.lock"
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules-xhj.pro'
}
xhj_pre {
dimension "flavor-type"
applicationId "com.xhjcn.lock.pre"
signingConfig signingConfigs.xhj
resValue "string", "app_name", "星星锁-P"
}
xhj_dev {
dimension "flavor-type"
applicationId "com.xhjcn.lock.dev"
signingConfig signingConfigs.xhj
resValue "string", "app_name", "星星锁-D"
}
}
// ----- END flavorDimensions (autogenerated by flutter_flavorizr) -----
@ -149,7 +173,7 @@ android {
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 25
targetSdkVersion 33
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
@ -227,6 +251,12 @@ android {
productFlavors.xhj.signingConfig signingConfigs.xhj
}
}
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "app-starlock-${variant.buildType.name}-${variant.flavorName}-${defaultConfig.versionName}.apk"
}
}
}
flutter {
@ -235,8 +265,9 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation('com.amap.api:location:5.6.0')
implementation('com.amap.api:3dmap:8.1.0')
// implementation('com.amap.api:location:5.6.0')
// implementation('com.amap.api:3dmap:8.1.0')
implementation('com.amap.api:3dmap-location-search:latest.integration')
implementation 'cn.jiguang.sdk:jpush:5.2.3'
//

View File

@ -0,0 +1,96 @@
{
"agcgw":{
"backurl":"connect-drcn.hispace.hicloud.com",
"url":"connect-drcn.dbankcloud.cn",
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
},
"agcgw_all":{
"CN":"connect-drcn.dbankcloud.cn",
"CN_back":"connect-drcn.hispace.hicloud.com",
"DE":"connect-dre.dbankcloud.cn",
"DE_back":"connect-dre.hispace.hicloud.com",
"RU":"connect-drru.hispace.dbankcloud.ru",
"RU_back":"connect-drru.hispace.dbankcloud.cn",
"SG":"connect-dra.dbankcloud.cn",
"SG_back":"connect-dra.hispace.hicloud.com"
},
"websocketgw_all":{
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
},
"client":{
"cp_id":"30086000752967166",
"product_id":"388421841222116270",
"client_id":"1406555529261648640",
"client_secret":"843E8191B02B692239726CF0ED990E1EC2B31928F825AA012B932A128FD2C516",
"project_id":"388421841222116270",
"app_id":"110798531",
"api_key":"DQEDAALnPCtuCgoYOyZfsIDa9/YZZhQ+buDGpypeurXhQUGMajWcVyYLQgXXqV3x2HbI6oyG+Wm2Gf+1hPs6j+wA3B6ylYAXG4aAQA==",
"package_name":"com.skychip.lock"
},
"oauth_client":{
"client_id":"110798531",
"client_type":1
},
"app_info":{
"app_id":"110798531",
"package_name":"com.skychip.lock"
},
"service":{
"analytics":{
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"resource_id":"p1",
"channel_id":""
},
"edukit":{
"edu_url":"edukit.cloud.huawei.com.cn",
"dh_url":"edukit.cloud.huawei.com.cn"
},
"search":{
"url":"https://search-drcn.cloud.huawei.com"
},
"cloudstorage":{
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
"storage_url_de":"https://ops-dre.agcstorage.link",
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
"storage_url_sg":"https://ops-dra.agcstorage.link",
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
},
"ml":{
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
}
},
"region":"CN",
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"com.skychip.lock",
"client":{
"app_id":"110798531"
},
"app_info":{
"package_name":"com.skychip.lock",
"app_id":"110798531"
},
"oauth_client":{
"client_type":1,
"client_id":"110798531"
}
}
]
}

View File

@ -0,0 +1,96 @@
{
"agcgw":{
"backurl":"connect-drcn.hispace.hicloud.com",
"url":"connect-drcn.dbankcloud.cn",
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
},
"agcgw_all":{
"CN":"connect-drcn.dbankcloud.cn",
"CN_back":"connect-drcn.hispace.hicloud.com",
"DE":"connect-dre.dbankcloud.cn",
"DE_back":"connect-dre.hispace.hicloud.com",
"RU":"connect-drru.hispace.dbankcloud.ru",
"RU_back":"connect-drru.hispace.dbankcloud.cn",
"SG":"connect-dra.dbankcloud.cn",
"SG_back":"connect-dra.hispace.hicloud.com"
},
"websocketgw_all":{
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
},
"client":{
"cp_id":"30086000752967166",
"product_id":"388421841222116270",
"client_id":"1406555529261648640",
"client_secret":"843E8191B02B692239726CF0ED990E1EC2B31928F825AA012B932A128FD2C516",
"project_id":"388421841222116270",
"app_id":"110798531",
"api_key":"DQEDAALnPCtuCgoYOyZfsIDa9/YZZhQ+buDGpypeurXhQUGMajWcVyYLQgXXqV3x2HbI6oyG+Wm2Gf+1hPs6j+wA3B6ylYAXG4aAQA==",
"package_name":"com.skychip.lock.dev"
},
"oauth_client":{
"client_id":"110798531",
"client_type":1
},
"app_info":{
"app_id":"110798531",
"package_name":"com.skychip.lock.dev"
},
"service":{
"analytics":{
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"resource_id":"p1",
"channel_id":""
},
"edukit":{
"edu_url":"edukit.cloud.huawei.com.cn",
"dh_url":"edukit.cloud.huawei.com.cn"
},
"search":{
"url":"https://search-drcn.cloud.huawei.com"
},
"cloudstorage":{
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
"storage_url_de":"https://ops-dre.agcstorage.link",
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
"storage_url_sg":"https://ops-dra.agcstorage.link",
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
},
"ml":{
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
}
},
"region":"CN",
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"com.skychip.lock.dev",
"client":{
"app_id":"110798531"
},
"app_info":{
"package_name":"com.skychip.lock.dev",
"app_id":"110798531"
},
"oauth_client":{
"client_type":1,
"client_id":"110798531"
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -0,0 +1,96 @@
{
"agcgw":{
"backurl":"connect-drcn.hispace.hicloud.com",
"url":"connect-drcn.dbankcloud.cn",
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
},
"agcgw_all":{
"CN":"connect-drcn.dbankcloud.cn",
"CN_back":"connect-drcn.hispace.hicloud.com",
"DE":"connect-dre.dbankcloud.cn",
"DE_back":"connect-dre.hispace.hicloud.com",
"RU":"connect-drru.hispace.dbankcloud.ru",
"RU_back":"connect-drru.hispace.dbankcloud.cn",
"SG":"connect-dra.dbankcloud.cn",
"SG_back":"connect-dra.hispace.hicloud.com"
},
"websocketgw_all":{
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
},
"client":{
"cp_id":"30086000752967166",
"product_id":"388421841222116270",
"client_id":"1406555529261648640",
"client_secret":"843E8191B02B692239726CF0ED990E1EC2B31928F825AA012B932A128FD2C516",
"project_id":"388421841222116270",
"app_id":"110798531",
"api_key":"DQEDAALnPCtuCgoYOyZfsIDa9/YZZhQ+buDGpypeurXhQUGMajWcVyYLQgXXqV3x2HbI6oyG+Wm2Gf+1hPs6j+wA3B6ylYAXG4aAQA==",
"package_name":"com.skychip.lock.pre"
},
"oauth_client":{
"client_id":"110798531",
"client_type":1
},
"app_info":{
"app_id":"110798531",
"package_name":"com.skychip.lock.pre"
},
"service":{
"analytics":{
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"resource_id":"p1",
"channel_id":""
},
"edukit":{
"edu_url":"edukit.cloud.huawei.com.cn",
"dh_url":"edukit.cloud.huawei.com.cn"
},
"search":{
"url":"https://search-drcn.cloud.huawei.com"
},
"cloudstorage":{
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
"storage_url_de":"https://ops-dre.agcstorage.link",
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
"storage_url_sg":"https://ops-dra.agcstorage.link",
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
},
"ml":{
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
}
},
"region":"CN",
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"com.skychip.lock.pre",
"client":{
"app_id":"110798531"
},
"app_info":{
"package_name":"com.skychip.lock.pre",
"app_id":"110798531"
},
"oauth_client":{
"client_type":1,
"client_id":"110798531"
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -0,0 +1,96 @@
{
"agcgw":{
"backurl":"connect-drcn.hispace.hicloud.com",
"url":"connect-drcn.dbankcloud.cn",
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
},
"agcgw_all":{
"CN":"connect-drcn.dbankcloud.cn",
"CN_back":"connect-drcn.hispace.hicloud.com",
"DE":"connect-dre.dbankcloud.cn",
"DE_back":"connect-dre.hispace.hicloud.com",
"RU":"connect-drru.hispace.dbankcloud.ru",
"RU_back":"connect-drru.hispace.dbankcloud.cn",
"SG":"connect-dra.dbankcloud.cn",
"SG_back":"connect-dra.hispace.hicloud.com"
},
"websocketgw_all":{
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
},
"client":{
"cp_id":"30086000752967166",
"product_id":"388421841222116270",
"client_id":"1406555529261648640",
"client_secret":"843E8191B02B692239726CF0ED990E1EC2B31928F825AA012B932A128FD2C516",
"project_id":"388421841222116270",
"app_id":"110798531",
"api_key":"DQEDAALnPCtuCgoYOyZfsIDa9/YZZhQ+buDGpypeurXhQUGMajWcVyYLQgXXqV3x2HbI6oyG+Wm2Gf+1hPs6j+wA3B6ylYAXG4aAQA==",
"package_name":"com.xhjcn.lock.dev"
},
"oauth_client":{
"client_id":"110798531",
"client_type":1
},
"app_info":{
"app_id":"110798531",
"package_name":"com.xhjcn.lock.dev"
},
"service":{
"analytics":{
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"resource_id":"p1",
"channel_id":""
},
"edukit":{
"edu_url":"edukit.cloud.huawei.com.cn",
"dh_url":"edukit.cloud.huawei.com.cn"
},
"search":{
"url":"https://search-drcn.cloud.huawei.com"
},
"cloudstorage":{
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
"storage_url_de":"https://ops-dre.agcstorage.link",
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
"storage_url_sg":"https://ops-dra.agcstorage.link",
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
},
"ml":{
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
}
},
"region":"CN",
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"com.xhjcn.lock.dev",
"client":{
"app_id":"110798531"
},
"app_info":{
"package_name":"com.xhjcn.lock.dev",
"app_id":"110798531"
},
"oauth_client":{
"client_type":1,
"client_id":"110798531"
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -0,0 +1,96 @@
{
"agcgw":{
"backurl":"connect-drcn.hispace.hicloud.com",
"url":"connect-drcn.dbankcloud.cn",
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
},
"agcgw_all":{
"CN":"connect-drcn.dbankcloud.cn",
"CN_back":"connect-drcn.hispace.hicloud.com",
"DE":"connect-dre.dbankcloud.cn",
"DE_back":"connect-dre.hispace.hicloud.com",
"RU":"connect-drru.hispace.dbankcloud.ru",
"RU_back":"connect-drru.hispace.dbankcloud.cn",
"SG":"connect-dra.dbankcloud.cn",
"SG_back":"connect-dra.hispace.hicloud.com"
},
"websocketgw_all":{
"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
"DE":"connect-ws-dre.hispace.dbankcloud.cn",
"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
"RU":"connect-ws-drru.hispace.dbankcloud.ru",
"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
"SG":"connect-ws-dra.hispace.dbankcloud.cn",
"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
},
"client":{
"cp_id":"30086000752967166",
"product_id":"388421841222116270",
"client_id":"1406555529261648640",
"client_secret":"843E8191B02B692239726CF0ED990E1EC2B31928F825AA012B932A128FD2C516",
"project_id":"388421841222116270",
"app_id":"110798531",
"api_key":"DQEDAALnPCtuCgoYOyZfsIDa9/YZZhQ+buDGpypeurXhQUGMajWcVyYLQgXXqV3x2HbI6oyG+Wm2Gf+1hPs6j+wA3B6ylYAXG4aAQA==",
"package_name":"com.xhjcn.lock.pre"
},
"oauth_client":{
"client_id":"110798531",
"client_type":1
},
"app_info":{
"app_id":"110798531",
"package_name":"com.xhjcn.lock.pre"
},
"service":{
"analytics":{
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"resource_id":"p1",
"channel_id":""
},
"edukit":{
"edu_url":"edukit.cloud.huawei.com.cn",
"dh_url":"edukit.cloud.huawei.com.cn"
},
"search":{
"url":"https://search-drcn.cloud.huawei.com"
},
"cloudstorage":{
"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
"storage_url_de":"https://ops-dre.agcstorage.link",
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
"storage_url_sg":"https://ops-dra.agcstorage.link",
"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
},
"ml":{
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
}
},
"region":"CN",
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"com.xhjcn.lock.pre",
"client":{
"app_id":"110798531"
},
"app_info":{
"package_name":"com.xhjcn.lock.pre",
"app_id":"110798531"
},
"oauth_client":{
"client_type":1,
"client_id":"110798531"
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

30
android/build.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/bash
set -e
echo "Build Params Info:Build Dir:$CI_PROJECT_DIR,Build Tag:$CI_COMMIT_TAG,Build Branch:$CI_COMMIT_BRANCH,Build BUILD_REVISION:$CI_RUNNER_REVISION"
export ENV_BUILD_TAG=${CI_COMMIT_TAG}
export ENV_BUILD_BRANCH=${CI_COMMIT_BRANCH}
export ENV_BUILD_WORKSPACE=${CI_PROJECT_DIR}
echo "GITLAB_WORKSPACE: ${CI_PROJECT_DIR}"
cd ${CI_PROJECT_DIR}/android
echo "ENV_BUILD_TAG:${ENV_BUILD_TAG},ENV_BUILD_BRANCH:${ENV_BUILD_BRANCH}"
regex='^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$'
if [[ "${ENV_BUILD_BRANCH}" == "canary_release" ]]; then
echo "===build canary_release: ${NEXT_VERSION}"
export ENV_BUILD_TAG=${NEXT_VERSION}
bundle exec fastlane release flavor:xhj --verbose
bundle exec fastlane release flavor:sky --verbose
elif [[ $ENV_BUILD_TAG =~ $regex ]]; then
echo "===build release===$ENV_BUILD_TAG"
bundle exec fastlane release flavor:xhj --verbose
bundle exec fastlane release flavor:sky --verbose
elif [[ "${ENV_BUILD_BRANCH}" == "develop" ]]; 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" ]] || [[ "${ENV_BUILD_BRANCH}" == "feat_devops" ]] ; 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

2
android/fastlane/Appfile Normal file
View File

@ -0,0 +1,2 @@
json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
package_name("") # e.g. com.krausefx.app

125
android/fastlane/Fastfile Normal file
View File

@ -0,0 +1,125 @@
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform(:android)
$env_key_project_root = 'ENV_BUILD_WORKSPACE'
$env_current_branch = 'ENV_BUILD_BRANCH'
$env_current_tag = 'ENV_BUILD_TAG'
$env_next_version = 'NEXT_VERSION'
$path_dir_build = File.join(ENV[$env_key_project_root],'')
$current_branch = ENV[$env_current_branch]
$current_tag = ENV[$env_current_tag]
$next_version = ENV[$env_next_version]
$path_apk_output_dir = File.join($path_dir_build, 'build/app/outputs/flutter-apk')
$path_bundle_output_dir = File.join($path_dir_build, 'build/app/outputs/bundle')
def print_header header
UI.message "~~~~~~~~~~~~~~~~~~~~~~"
UI.message '📍 ' + header.to_s
UI.message "~~~~~~~~~~~~~~~~~~~~~~"
end
def print_log(content)
UI.message '📠 ' + content.to_s
end
platform :android do
before_all 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
end
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}"
build_number = Time.now.strftime("%Y%m%d%H")
print_log "BuildNo #{build_number}"
build_version = $next_version
print_log "build_version #{build_version}"
commit_hash = last_git_commit
short_hash = commit_hash[:abbreviated_commit_hash]
print_log "last_git_commit_short_hash #{short_hash}"
Dir.chdir "../.." do
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}")
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")
File.rename(old_file_path, new_file_path)
logs = changelog_from_git_commits(
pretty: '- %s (%cn)',
commits_count: 5,
merge_commit_filtering: 'exclude_merges'
)
upload_file_to_pgy(directory:$path_apk_output_dir,file_extension:".apk",logs:logs)
end
desc "Build & upload a new version to Gitlab Release"
lane :release do |options|
flavor = options[:flavor]
UI.user_error!("flavor is required") unless flavor
print_log "build flavor for: #{flavor}"
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]
print_log "buildVersion #{build_version}"
commit_hash = last_git_commit
short_hash = commit_hash[:abbreviated_commit_hash]
print_log "last_git_commit_short_hash #{short_hash}"
Dir.chdir "../.." do
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}")
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")
File.rename(old_apk_file_path, new_apk_file_path)
Dir.chdir "../.." do
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}")
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")
File.rename(old_bundle_file_path, new_bundle_file_path)
sh('cp',new_bundle_file_path,$path_apk_output_dir)
end
lane :upload_file_to_pgy do |options|
directory = options[:directory]
file_extension = options[:file_extension]
logs = options[:logs]
UI.user_error!("Directory path is required") unless directory
UI.user_error!("File extension is required") unless file_extension
# 使用Dir.glob来查找目录下的所有.apk和.ipa文件
Dir.glob("#{directory}/*#{file_extension}").each do |file|
# 打印文件名称
puts "start upload file: #{file}"
pgyer(api_key: ENV['PGY_API_KEY'],apk:file,update_description: logs)
File.delete(file)
end
end
end

View File

@ -0,0 +1,5 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!
gem 'fastlane-plugin-pgyer'

1
ios/.gitignore vendored
View File

@ -7,6 +7,7 @@
**/*sync/
.sconsign.dblite
.tags*
.DS_Store
**/.vagrant/
**/DerivedData/
Icon?

View File

@ -0,0 +1,6 @@
#include "Generated.xcconfig"
FLUTTER_TARGET=lib/main_local.dart
ASSET_PREFIX=local
BUNDLE_NAME=星锁-local
BUNDLE_DISPLAY_NAME=星锁-local

View File

@ -2,5 +2,5 @@
FLUTTER_TARGET=lib/main_sky_full.dart
ASSET_PREFIX=sky
BUNDLE_NAME=斯凯智能
BUNDLE_DISPLAY_NAME=斯凯智能
BUNDLE_NAME=锁通通
BUNDLE_DISPLAY_NAME=锁通通

View File

@ -0,0 +1,6 @@
#include "Generated.xcconfig"
FLUTTER_TARGET=lib/main_sky_dev.dart
ASSET_PREFIX=sky
BUNDLE_NAME=锁通通-D
BUNDLE_DISPLAY_NAME=锁通通-D

View File

@ -0,0 +1,6 @@
#include "Generated.xcconfig"
FLUTTER_TARGET=lib/main_sky_pre.dart
ASSET_PREFIX=sky
BUNDLE_NAME=锁通通-P
BUNDLE_DISPLAY_NAME=锁通通-P

View File

@ -2,5 +2,5 @@
FLUTTER_TARGET=lib/main_sky_full.dart
ASSET_PREFIX=sky
BUNDLE_NAME=斯凯智能
BUNDLE_DISPLAY_NAME=斯凯智能
BUNDLE_NAME=锁通通
BUNDLE_DISPLAY_NAME=锁通通

View File

@ -1,6 +1,6 @@
#include "Generated.xcconfig"
FLUTTER_TARGET=lib/main_sky_full.dart
FLUTTER_TARGET=lib/main_sky_lite.dart
ASSET_PREFIX=sky
BUNDLE_NAME=斯凯智能
BUNDLE_DISPLAY_NAME=斯凯智能
BUNDLE_NAME=锁通通
BUNDLE_DISPLAY_NAME=锁通通

View File

@ -0,0 +1,6 @@
#include "Generated.xcconfig"
FLUTTER_TARGET=lib/main_xhj_dev.dart
ASSET_PREFIX=xhj
BUNDLE_NAME=星星锁-D
BUNDLE_DISPLAY_NAME=星星锁-D

View File

@ -0,0 +1,6 @@
#include "Generated.xcconfig"
FLUTTER_TARGET=lib/main_xhj_pre.dart
ASSET_PREFIX=xhj
BUNDLE_NAME=星星锁-P
BUNDLE_DISPLAY_NAME=星星锁-P

7
ios/Gemfile Normal file
View File

@ -0,0 +1,7 @@
source "https://rubygems.org"
gem "fastlane"
gem 'cocoapods', '1.14.3'
gem 'public_suffix', '~> 4.0'
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)

288
ios/Gemfile.lock Normal file
View File

@ -0,0 +1,288 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (6.1.7.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.979.0)
aws-sdk-core (3.209.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.94.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.166.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.10.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.2.0)
claide (1.1.0)
cocoapods (1.14.3)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.14.3)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.14.3)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored (1.2)
colored2 (3.1.2)
commander (4.6.0)
highline (~> 2.0.0)
concurrent-ruby (1.3.4)
declarative (0.0.20)
digest-crc (0.6.5)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.8.1)
emoji_regex (3.2.3)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
excon (0.109.0)
faraday (1.10.4)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.1)
faraday (~> 1.0)
fastimage (2.3.1)
fastlane (2.222.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored (~> 1.2)
commander (~> 4.6)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
faraday (~> 1.0)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-apis-androidpublisher_v3 (~> 0.3)
google-apis-playcustomapp_v1 (~> 0.1)
google-cloud-env (>= 1.6.0, < 2.0.0)
google-cloud-storage (~> 1.31)
highline (~> 2.0)
http-cookie (~> 1.0.5)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (>= 2.0.0, < 3.0.0)
naturally (~> 2.2)
optparse (>= 0.1.1, < 1.0.0)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.5)
simctl (~> 1.6.3)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (~> 3)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-plugin-pgyer (0.2.9)
ffi (1.17.0)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.54.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-core (0.11.3)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
rexml
google-apis-iamcredentials_v1 (0.17.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-playcustomapp_v1 (0.13.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-storage_v1 (0.29.0)
google-apis-core (>= 0.11.0, < 2.a)
google-cloud-core (1.6.1)
google-cloud-env (>= 1.0, < 3.a)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0)
google-cloud-errors (1.3.1)
google-cloud-storage (1.45.0)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.29.0)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (1.8.1)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.7)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
jmespath (1.6.2)
json (2.7.2)
jwt (2.9.1)
base64
mini_magick (4.13.2)
mini_mime (1.1.5)
minitest (5.25.1)
molinillo (0.8.0)
multi_json (1.15.0)
multipart-post (2.4.1)
nanaimo (0.3.0)
nap (1.1.0)
naturally (2.2.1)
netrc (0.11.0)
nkf (0.2.0)
optparse (0.5.0)
os (1.1.4)
plist (3.7.1)
public_suffix (4.0.7)
rake (13.2.1)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.3.7)
rouge (2.0.7)
ruby-macho (2.5.1)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
security (0.1.5)
signet (0.18.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.10)
CFPropertyList
naturally
terminal-notifier (2.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
trailblazer-option (0.1.2)
tty-cursor (0.7.1)
tty-screen (0.8.2)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uber (0.1.0)
unf (0.2.0)
unicode-display_width (2.6.0)
word_wrap (1.0.0)
xcodeproj (1.25.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (>= 3.3.2, < 4.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)
zeitwerk (2.6.18)
PLATFORMS
ruby
DEPENDENCIES
cocoapods (= 1.14.3)
fastlane
fastlane-plugin-pgyer
public_suffix (~> 4.0)
BUNDLED WITH
1.17.2

1760
ios/Runner.xcodeproj/project.pbxproj Executable file → Normal file

File diff suppressed because it is too large Load Diff

View File

@ -84,6 +84,8 @@
<string>应用请求相机,以便于拍摄照片,用于头像上传及人脸认证</string>
<key>NSContactsUsageDescription</key>
<string>Reason we need access to the contact list</string>
<key>NSFileProtectionKey</key>
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
<key>NSLocationAlwaysUsageDescription</key>
@ -105,6 +107,8 @@
<array>
<string>remote-notification</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>xhjLaunchScreen</string>
<key>UIMainStoryboardFile</key>
@ -121,10 +125,6 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSFileProtectionKey</key>
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
<key>UIFileSharingEnabled</key>
<true/>
<key>io.flutter.embedded_views_preview</key>
<true/>
</dict>

View File

@ -84,6 +84,8 @@
<string>应用请求相机,以便于拍摄照片,用于头像上传及人脸认证</string>
<key>NSContactsUsageDescription</key>
<string>Reason we need access to the contact list</string>
<key>NSFileProtectionKey</key>
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
<key>NSLocationAlwaysUsageDescription</key>
@ -105,6 +107,8 @@
<array>
<string>remote-notification</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>xhjLaunchScreen</string>
<key>UIMainStoryboardFile</key>
@ -121,10 +125,6 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSFileProtectionKey</key>
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
<key>UIFileSharingEnabled</key>
<true/>
<key>io.flutter.embedded_views_preview</key>
<true/>
</dict>

31
ios/build.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
set -e
echo "Build Params Info:Build Dir:$CI_PROJECT_DIR,Build Tag:$CI_COMMIT_TAG,Build Branch:$CI_COMMIT_BRANCH,Build BUILD_REVISION:$CI_RUNNER_REVISION"
export ENV_BUILD_TAG=${CI_COMMIT_TAG}
export ENV_BUILD_BRANCH=${CI_COMMIT_BRANCH}
export ENV_BUILD_WORKSPACE=${CI_PROJECT_DIR}
echo "GITLAB_WORKSPACE: ${CI_PROJECT_DIR}"
cd ${CI_PROJECT_DIR}/ios
bundle exec pod install
echo "ENV_BUILD_TAG:${ENV_BUILD_TAG},ENV_BUILD_BRANCH:${ENV_BUILD_BRANCH}"
regex='^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$'
if [[ "${ENV_BUILD_BRANCH}" == "canary_release" ]]; then
echo "===build canary_release: ${NEXT_VERSION}"
export ENV_BUILD_TAG=${NEXT_VERSION}
bundle exec fastlane release flavor:xhj --verbose
bundle exec fastlane release flavor:sky --verbose
elif [[ $ENV_BUILD_TAG =~ $regex ]]; then
echo "===build release===$ENV_BUILD_TAG"
bundle exec fastlane release flavor:xhj --verbose
bundle exec fastlane release flavor:sky --verbose
elif [[ "${ENV_BUILD_BRANCH}" == "develop" ]]; 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" ]] || [[ "${ENV_BUILD_BRANCH}" == "feat_devops" ]] ; 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

6
ios/fastlane/Appfile Normal file
View File

@ -0,0 +1,6 @@
# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app
# apple_id("[[APPLE_ID]]") # Your Apple Developer Portal username
# For more information about the Appfile, see:
# https://docs.fastlane.tools/advanced/#appfile

224
ios/fastlane/Fastfile Normal file
View File

@ -0,0 +1,224 @@
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
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)'
$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'
# --- common Const ---
$match_type_adhoc = 'adhoc'
$match_type_appstore = 'appstore'
$gym_scheme = 'Runner'
$gym_workspace = 'Runner.xcworkspace'
$env_key_project_root = 'ENV_BUILD_WORKSPACE'
$env_current_branch = 'ENV_BUILD_BRANCH'
$env_current_tag = 'ENV_BUILD_TAG'
$env_key_fastlane_apple_auth_key = 'APPLE_AUTH_CONTENT'
$env_key_fastlane_apple_auth_issuer_key = 'APPLE_AUTH_ISSUER_ID'
$env_key_fastlane_apple_auth_id_key = 'APPLE_AUTH_KEY_ID'
$env_next_version = 'NEXT_VERSION'
$path_dir_build = File.join(ENV[$env_key_project_root], '')
$current_branch = ENV[$env_current_branch]
$current_tag = ENV[$env_current_tag]
$next_version = ENV[$env_next_version]
$filename_ipa_default = 'app-starlock.ipa'
$filename_beta_ipa_copy = 'app-starlock-'+$current_branch+'.ipa'
$filename_release_ipa_copy = 'app-starlock-'+$current_tag+'.ipa'
$path_ipa_output_dir = File.join($path_dir_build, 'build/app/outputs/flutter-ipa')
# --- Lanes ---
platform :ios do
before_all do
print_header '🏁 Before All'
print_log $current_branch
print_log $current_tag
Dir.chdir "../.." do
sh('pwd')
end
end
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}"
build_number = Time.now.strftime("%Y%m%d%H")
print_log "Build Commits #{build_number}"
build_version = $next_version # Time.now.strftime("%Y%m%d%H%M%S")
print_log "build_version #{build_version}"
commit_hash = last_git_commit
short_hash = commit_hash[:abbreviated_commit_hash]
print_log "last_git_commit_short_hash #{short_hash}"
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}")
end
#set_bundle_short_version('./Runner/Info.plist', $current_branch)
gym_scheme_preview="#{flavor}"
print_log "gym_scheme_preview #{gym_scheme_preview}"
gym_configuration = "#{env}-release-#{flavor}"
print_log "gym_configuration #{gym_configuration}"
ipa_default_filename = "starlock-#{flavor}-preview-#{build_version}.ipa"
print_log "ipa_default_filename #{ipa_default_filename}"
gym(
scheme: gym_scheme_preview,
workspace: $gym_workspace,
configuration: gym_configuration,
output_directory: $path_ipa_output_dir,
output_name: ipa_default_filename,
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",
}
}
)
logs = changelog_from_git_commits(
pretty: '- %s (%cn)',
commits_count: 5,
merge_commit_filtering: 'exclude_merges'
)
upload_file_to_pgy(directory:$path_ipa_output_dir,file_extension:".ipa",logs:logs)
end
desc "Build & Deliver to App Store Connect"
lane :release do |options|
flavor = options[:flavor]
UI.user_error!("flavor is required") unless flavor
print_log "build flavor: #{flavor}"
build_number = Time.now.strftime("%Y%m%d%H")
print_log "Build Commits #{build_number}"
build_version = $current_tag.match(/^v(\d+\.\d+\.\d+)/).captures[0]
print_log "build_version #{build_version}"
commit_hash = last_git_commit
short_hash = commit_hash[:abbreviated_commit_hash]
print_log "last_git_commit_short_hash #{short_hash}"
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}")
end
gym_scheme_release="#{flavor}"
print_log "gym_scheme_release #{gym_scheme_release}"
gym_configuration = "Release-#{flavor}"
print_log "gym_configuration #{gym_configuration}"
ipa_default_filename = "starlock-#{flavor}-release-"+$current_tag+".ipa"
print_log "ipa_default_filename #{ipa_default_filename}"
gym(
scheme: gym_scheme_release,
workspace: $gym_workspace,
configuration: gym_configuration,
output_directory: $path_ipa_output_dir,
output_name: ipa_default_filename,
export_method: "app-store",
export_options: {
provisioningProfiles: {
"com.xhjcn.lock" => "Appstore_com.xhjcn.lock.mobileprovision",
"com.skychip.lock" => "Appstore_com.skychip.lock.mobileprovision",
}
}
)
auth_key_prefix=flavor.upcase
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"],
issuer_id: ENV["#{auth_key_prefix}_APPLE_AUTH_ISSUER_ID"],
key_content: ENV["#{auth_key_prefix}_APPLE_AUTH_CONTENT"],
is_key_content_base64: true,
duration: 1200,
in_house: false
)
print_log "api_key #{api_key}"
ipa_file_path = File.join($path_ipa_output_dir, ipa_default_filename)
pilot(
api_key: api_key,
ipa: ipa_file_path,
skip_submission: true,
skip_waiting_for_build_processing: true
)
end
lane :upload_file_to_pgy do |options|
directory = options[:directory]
file_extension = options[:file_extension]
logs = options[:logs]
UI.user_error!("Directory path is required") unless directory
UI.user_error!("File extension is required") unless file_extension
# 使用Dir.glob来查找目录下的所有.apk和.ipa文件
Dir.glob("#{directory}/*#{file_extension}").each do |file|
# 打印文件名称
puts "start upload file: #{file}"
pgyer(api_key: ENV['PGY_API_KEY'],apk:file,update_description: logs)
File.delete(file)
end
end
end
# --- Prints ---
def print_title_log(title, content)
UI.message '📠 ' + title.to_s + ':'
print_log content
end
def print_log(content)
UI.message '📠 ' + content.to_s
end
def print_dir(path)
UI.message '📂📂📂 Print Dir 📂📂📂'
Dir.chdir(path) do
sh('ls -lh')
end
end
def print_header header
UI.message "~~~~~~~~~~~~~~~~~~~~~~"
UI.message '📍 ' + header.to_s
UI.message "~~~~~~~~~~~~~~~~~~~~~~"
end
# --- Methods ---
def set_bundle_short_version(plist_path, version_string)
print_header "Set Bundle short version"
print_log plist_path
print_log version_string
set_info_plist_value(path: plist_path, key: 'CFBundleShortVersionString', value: version_string)
end

5
ios/fastlane/Pluginfile Normal file
View File

@ -0,0 +1,5 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!
gem 'fastlane-plugin-pgyer'

View File

@ -5,7 +5,11 @@ enum Flavor {
dev,
pre,
sky,
sky_dev,
sky_pre,
xhj,
xhj_dev,
xhj_pre,
}
class StarLockAMapKey {
@ -28,8 +32,15 @@ class F {
static String get name => appFlavor?.name ?? '';
static bool get isXHJ => appFlavor == Flavor.xhj;
static bool get isSKY => appFlavor == Flavor.sky;
static bool get isXHJ =>
appFlavor == Flavor.xhj ||
appFlavor == Flavor.xhj_dev ||
appFlavor == Flavor.xhj_pre;
static bool get isSKY =>
appFlavor == Flavor.sky ||
appFlavor == Flavor.sky_dev ||
appFlavor == Flavor.sky_pre;
//便
static dynamic sw(
@ -39,6 +50,8 @@ class F {
}
switch (appFlavor) {
case Flavor.sky:
case Flavor.sky_dev:
case Flavor.sky_pre:
return skyCall();
case Flavor.local:
case Flavor.dev:
@ -58,8 +71,12 @@ class F {
case Flavor.pre:
return '星锁-pre';
case Flavor.sky:
case Flavor.sky_dev:
case Flavor.sky_pre:
return '锁通通'.tr;
case Flavor.xhj:
case Flavor.xhj_dev:
case Flavor.xhj_pre:
return '星星锁'.tr;
default:
throw Exception('flavor[$name] title not found');
@ -75,8 +92,12 @@ class F {
case Flavor.pre:
return '星锁'.tr;
case Flavor.sky:
case Flavor.sky_dev:
case Flavor.sky_pre:
return '锁通通'.tr;
case Flavor.xhj:
case Flavor.xhj_dev:
case Flavor.xhj_pre:
return '星星锁'.tr;
default:
throw Exception('flavor[$name] title not found');
@ -87,11 +108,16 @@ class F {
switch (appFlavor) {
case Flavor.local:
// return 'https://ge.lock.star-lock.cn'; //
// return 'http://192.168.1.15:8022'; //
// return 'http://192.168.1.15:8022'; //
return 'http://zhou.lock.star-lock.cn'; //
case Flavor.dev:
case Flavor.xhj_dev:
case Flavor.sky_dev:
return 'https://dev.lock.star-lock.cn';
case Flavor.pre:
case Flavor.xhj_pre:
case Flavor.sky_pre:
return 'https://pre.lock.star-lock.cn';
case Flavor.sky:
return 'https://lock.skychip.top';

8
lib/main_sky_dev.dart Normal file
View File

@ -0,0 +1,8 @@
import 'flavors.dart';
import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.sky_dev;
await runner.main();
}

8
lib/main_sky_pre.dart Normal file
View File

@ -0,0 +1,8 @@
import 'flavors.dart';
import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.sky_pre;
await runner.main();
}

8
lib/main_xhj_dev.dart Normal file
View File

@ -0,0 +1,8 @@
import 'flavors.dart';
import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.xhj_dev;
await runner.main();
}

8
lib/main_xhj_pre.dart Normal file
View File

@ -0,0 +1,8 @@
import 'flavors.dart';
import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.xhj_pre;
await runner.main();
}

View File

@ -0,0 +1,56 @@
#!/bin/bash
# 读取环境变量
URL=$CI_API_V4_URL
TOKEN=$GITLAB_ACCESS_TOKEN
PROJECT_ID=$CI_PROJECT_ID
echo "PRIVATE-TOKEN: $TOKEN $URL/projects/$PROJECT_ID/repository/tags"
tags_json=$(curl -H "Content-Type: application/json" -H "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/tags")
echo "tags_json:$tags_json\n"
tags=$(echo "$tags_json" | jq -r '.[].name')
tags_length=$(echo "$tags_json" | jq -r 'length')
if [ "$tags_length" -lt 2 ]; then
newest_tag="master"
second_newest_tag=$(echo "$tags" | head -n 1)
else
newest_tag=$(echo "$tags" | head -n 1)
second_newest_tag=$(echo "$tags" | head -n 2 | tail -n 1)
fi
echo "newest_tag:$newest_tag-second_newest_tag$second_newest_tag\n"
# 比较两个tag之间的commits
compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=$second_newest_tag&to=$newest_tag")
#echo "compare_json:$compare_json\n"
feat_log=""
fix_log=""
other_log=""
while IFS= read -r commit_json; do
# 使用 jq 解析每一行的 JSON 对象
commit_id=$(echo "$commit_json" | jq -r '.id')
commit_message=$(echo "$commit_json" | jq -r '.message')
if [[ "$commit_message" =~ ("feat:"*) ]]; then
feat_log+="* ${commit_message#feat:}\n"
elif [[ "$commit_message" =~ ("fix:"*) ]]; then
fix_log+="* ${commit_message#fix:}\n"
elif [[ ! "$commit_message" =~ ("Merge"* | "Revert"*) ]]; then
other_log+="* ${commit_message#("Merge" | "Revert")}\n"
fi
done < <(echo "$compare_json" | jq -c '.commits[] | {id: .id, message: .message}')
echo -e "feat_log:$feat_log,fix_log:$fix_log,other_log:$other_log"
# 如果没有feat或fix的commits则设置默认日志
if [[ -z "$feat_log" ]]; then
feat_log="- No 'feat' commits since last tagged commit."
fi
if [[ -z "$fix_log" ]]; then
fix_log="- No 'fix' commits since last tagged commit."
fi
# 生成changelog文本
changelog="# Features\n$feat_log\n# Fixes\n$fix_log\n# Others\n$other_log"
# 打印结果(或可以重定向到文件等)
echo "$changelog"
# (可选)将结果保存到文件中
echo -e "$changelog" > changelog.md

62
tag_generator.sh Executable file
View File

@ -0,0 +1,62 @@
#!/bin/bash
# 读取环境变量
URL=$CI_API_V4_URL
TOKEN=$GITLAB_ACCESS_TOKEN
PROJECT_ID=$CI_PROJECT_ID
next_tag=""
newest_tag=""
echo "PRIVATE-TOKEN: $TOKEN $URL/projects/$PROJECT_ID/repository/tags"
tags_json=$(curl -H "Content-Type: application/json" -H "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/tags")
#echo "tags_json:$tags_json\n"
tags=$(echo "$tags_json" | jq -r '.[].name')
tags_length=$(echo "$tags_json" | jq -r 'length')
if [ "$tags_length" -lt 1 ]; then
next_tag="v1.0.0"
else
newest_tag=$(echo "$tags" | head -n 1)
IFS='.' read -r major minor patch <<< "$newest_tag"
major="${major#v}"
compare_json=""
if [[ "$1" == "generate_tag" ]];then
echo "generate_tag:$newest_tag-to-master\n"
compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=$newest_tag&to=master")
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")
fi
echo "compare_json:$compare_json\n"
new_patch=$patch
while IFS= read -r commit_json; do
# 使用 jq 解析每一行的 JSON 对象
commit_id=$(echo "$commit_json" | jq -r '.id')
commit_message=$(echo "$commit_json" | jq -r '.message')
echo "----$commit_message"
if [[ "$commit_message" =~ ("feat:"*) ]]; then
((minor++))
new_patch=0
break
elif [[ "$commit_message" =~ ("fix:"*) ]] && [[ $new_patch == $patch ]]; then
((new_patch++))
elif [[ ! "$commit_message" =~ ("Merge"* | "Revert"*) ]] && [[ $new_patch == $patch ]]; then
((new_patch++))
fi
done < <(echo "$compare_json" | jq -c '.commits[] | {id: .id, message: .message}')
next_tag="v$major.$minor.$new_patch"
fi
echo "New Tag:$newest_tag;New version: $next_tag;command: $1"
if [[ "$1" == "generate_tag" ]];then
if [ "$next_tag" == "$newest_tag" ]; then
echo "no change from master,skip to generate tag"
exit 0
fi
git config user.name
git tag $next_tag
git push -u origin $next_tag
echo "generate tag: $next_tag"
elif [[ "$1" == "generate_version" ]]; then
export NEXT_VERSION="$next_tag"
echo "generate version: $NEXT_VERSION"
fi
echo "$next_tag" > app_new.version