Merge branch 'develop' into build-addGateway-20240814
This commit is contained in:
commit
5e818c9d67
@ -4,6 +4,7 @@ stages:
|
||||
- build-artifacts
|
||||
- release-artifacts
|
||||
- notification
|
||||
- clean-up
|
||||
|
||||
variables:
|
||||
LC_ALL: "en_US.UTF-8"
|
||||
@ -61,7 +62,7 @@ variables:
|
||||
before_script:
|
||||
- ls -li
|
||||
- export NEXT_VERSION="$(cat app_new.version)"
|
||||
- flutter pub get
|
||||
# - flutter pub get
|
||||
- bundle install --gemfile android/Gemfile --quiet
|
||||
cache:
|
||||
paths:
|
||||
@ -72,7 +73,7 @@ variables:
|
||||
before_script:
|
||||
- ls -li
|
||||
- export NEXT_VERSION="$(cat app_new.version)"
|
||||
- flutter pub get
|
||||
# - flutter pub get
|
||||
- bundle install --gemfile ios/Gemfile --quiet
|
||||
cache:
|
||||
paths:
|
||||
@ -204,4 +205,11 @@ notify_failure:
|
||||
script:
|
||||
- bash notify.sh failure
|
||||
allow_failure: true
|
||||
when: on_failure
|
||||
when: on_failure
|
||||
|
||||
clean_up:
|
||||
stage: clean-up
|
||||
extends: .build_rule
|
||||
script:
|
||||
- git reset --hard
|
||||
when: always
|
||||
@ -23,6 +23,9 @@ if (flutterVersionName == null) {
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
//<com>
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
//</com>
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
apply plugin: 'com.android.application'
|
||||
@ -304,6 +307,8 @@ dependencies {
|
||||
implementation 'cn.jiguang.sdk.plugin:vivo:5.2.3'
|
||||
|
||||
// Umeng统计
|
||||
//<cn>
|
||||
implementation 'com.umeng.umsdk:common:9.7.9'
|
||||
implementation 'com.umeng.umsdk:asms:1.8.5'
|
||||
//</cn>
|
||||
}
|
||||
|
||||
@ -2,14 +2,14 @@
|
||||
"project_info": {
|
||||
"project_number": "281500445726",
|
||||
"project_id": "skychip2023-ecdff",
|
||||
"storage_bucket": "skychip2023-ecdff.appspot.com"
|
||||
"storage_bucket": "skychip2023-ecdff.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:281500445726:android:ddf52ac7b7f83cf5c4d20f",
|
||||
"mobilesdk_app_id": "1:281500445726:android:468195b9cc68dd6cc4d20f",
|
||||
"android_client_info": {
|
||||
"package_name": "com.skychip.lock"
|
||||
"package_name": "com.starlock.lock.local"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
|
||||
@ -2,15 +2,11 @@ package com.skychip.lock
|
||||
|
||||
import io.flutter.app.FlutterApplication
|
||||
import android.util.Log
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
|
||||
class App : FlutterApplication() {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
// UMConfigure.setLogEnabled(true);
|
||||
//友盟预初始化
|
||||
// UMConfigure.preInit(getApplicationContext(), "671244cf80464b33f6df9648", "Product");
|
||||
Log.d("MyApplication", "Application has started")
|
||||
}
|
||||
}
|
||||
@ -12,16 +12,10 @@ import android.bluetooth.BluetoothAdapter;
|
||||
import androidx.core.content.FileProvider
|
||||
import java.io.File
|
||||
|
||||
import com.umeng.commonsdk.UMConfigure
|
||||
|
||||
class MainActivity : FlutterActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
GeneratedPluginRegistrant.registerWith(flutterEngine!!)
|
||||
|
||||
// 初始化 Umeng SDK
|
||||
// UMConfigure.init(this, "671244cf80464b33f6df9648", "Product", UMConfigure.DEVICE_TYPE_PHONE, null)
|
||||
|
||||
MethodChannel(
|
||||
flutterEngine?.dartExecutor!!.binaryMessenger,
|
||||
"starLockFlutterSend"
|
||||
|
||||
48
android/app/src/sky/google-services.json
Normal file
48
android/app/src/sky/google-services.json
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "281500445726",
|
||||
"project_id": "skychip2023-ecdff",
|
||||
"storage_bucket": "skychip2023-ecdff.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:281500445726:android:ddf52ac7b7f83cf5c4d20f",
|
||||
"android_client_info": {
|
||||
"package_name": "com.skychip.lock"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyC-3-ABWuy9LrYyAw_KxDRto4DanQ0sq9g"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:281500445726:android:468195b9cc68dd6cc4d20f",
|
||||
"android_client_info": {
|
||||
"package_name": "com.starlock.lock.local"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyC-3-ABWuy9LrYyAw_KxDRto4DanQ0sq9g"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
48
android/app/src/xhj/google-services.json
Normal file
48
android/app/src/xhj/google-services.json
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "28150044todo",
|
||||
"project_id": "skychip2023-etodo",
|
||||
"storage_bucket": "skychip2023-etodo.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:281500445726:android:ddf52ac7b7f83cf5c4todo",
|
||||
"android_client_info": {
|
||||
"package_name": "com.xhjcn.lock"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyC-3-ABWuy9LrYyAw_KxDRto4DanQ0todo"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:281500445726:android:468195b9cc68dd6cc4todo",
|
||||
"android_client_info": {
|
||||
"package_name": "com.xhjcn.lock.local"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyC-3-ABWuy9LrYyAw_KxDRto4Dank9todo"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@ -12,12 +12,14 @@ 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
|
||||
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 flavor:xhj --verbose
|
||||
bundle exec fastlane release flavor:sky --verbose
|
||||
bundle exec fastlane release_apk flavor:xhj --verbose
|
||||
bundle exec fastlane release_apk flavor:sky --verbose
|
||||
bundle exec fastlane release_bundle flavor:xhj --verbose
|
||||
bundle exec fastlane release_bundle flavor:sky --verbose
|
||||
elif [[ "${ENV_BUILD_BRANCH}" == "develop" ]]; then
|
||||
echo "===build dev===${NEXT_VERSION}"
|
||||
bundle exec fastlane beta flavor:xhj env:dev --verbose
|
||||
|
||||
@ -67,7 +67,9 @@ platform :android do
|
||||
commit_hash = last_git_commit
|
||||
short_hash = commit_hash[:abbreviated_commit_hash]
|
||||
print_log "last_git_commit_short_hash #{short_hash}"
|
||||
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}")
|
||||
end
|
||||
old_file_path = File.join($path_apk_output_dir, "app-#{flavor}_#{env}-release.apk")
|
||||
@ -82,7 +84,7 @@ platform :android do
|
||||
end
|
||||
|
||||
desc "Build & upload a new version to Gitlab Release"
|
||||
lane :release do |options|
|
||||
lane :release_apk do |options|
|
||||
flavor = options[:flavor]
|
||||
UI.user_error!("flavor is required") unless flavor
|
||||
print_log "build flavor for: #{flavor}"
|
||||
@ -93,13 +95,31 @@ platform :android do
|
||||
commit_hash = last_git_commit
|
||||
short_hash = commit_hash[:abbreviated_commit_hash]
|
||||
print_log "last_git_commit_short_hash #{short_hash}"
|
||||
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}")
|
||||
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)
|
||||
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}"
|
||||
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}"
|
||||
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}")
|
||||
end
|
||||
old_bundle_file_path = File.join($path_bundle_output_dir , "/#{flavor}Release/app-#{flavor}-release.aab")
|
||||
@ -122,4 +142,45 @@ platform :android do
|
||||
File.delete(file)
|
||||
end
|
||||
end
|
||||
|
||||
lane :remove_zone_pre_build do |options|
|
||||
sh("git", "reset", "--hard")
|
||||
zone = options[:zone]
|
||||
UI.user_error!("Please provide valid 'zone'") unless zone
|
||||
pathList=["pubspec.yaml","/android/app/build.gradle","/lib/apm"]
|
||||
extensions = [".dart",".gradle"] #options[:extensions]
|
||||
if pathList.empty? || extensions.empty?
|
||||
UI.user_error!("Please provide valid 'paths' and 'extensions' arrays.")
|
||||
end
|
||||
puts "start prepare zone: #{zone},pathList:#{pathList},extensions:#{extensions}"
|
||||
regexp_List = [/#<#{zone}>.*?#<\/#{zone}>/m,/\/\/\<#{zone}\>.*?\/\/\<\/#{zone}\>/m]
|
||||
UI.message("Processed RegExpList: #{regexp_List}")
|
||||
def process_file(file_path, regexpList)
|
||||
content = File.read(file_path)
|
||||
regexpList.each do |tag|
|
||||
content = content.gsub(tag,'')
|
||||
end
|
||||
File.write(file_path, content)
|
||||
UI.message("Processed file: #{file_path},content :\n #{content}")
|
||||
end
|
||||
|
||||
pathList.each do |path|
|
||||
realPath = File.join($path_dir_build, path)
|
||||
if File.directory?(realPath)
|
||||
Dir.glob("#{realPath}/**/*").each do |file|
|
||||
if File.directory?(file)
|
||||
UI.message("Find child dir path: #{file}")
|
||||
elsif extensions.include?(File.extname(file))
|
||||
process_file(file,regexp_List)
|
||||
end
|
||||
end
|
||||
elsif File.file?(realPath)
|
||||
process_file(realPath,regexp_List)
|
||||
else
|
||||
UI.message("Invalid path: #{realPath}")
|
||||
end
|
||||
end
|
||||
UI.success("All matching content removed from specified files.")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
1
firebase.json
Normal file
1
firebase.json
Normal file
@ -0,0 +1 @@
|
||||
{"flutter":{"platforms":{"android":{"default":{"projectId":"skychip2023-ecdff","appId":"1:281500445726:android:468195b9cc68dd6cc4d20f","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"skychip2023-ecdff","appId":"1:281500445726:ios:b194ccffb92fb86cc4d20f","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"skychip2023-ecdff","configurations":{"android":"1:281500445726:android:468195b9cc68dd6cc4d20f","ios":"1:281500445726:ios:b194ccffb92fb86cc4d20f"}}}}}}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 45 KiB |
@ -1075,8 +1075,10 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NAQ5PL2DYC;
|
||||
INFOPLIST_FILE = Runner/info_sky.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@ -1086,6 +1088,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.starlock.lock.local;
|
||||
PRODUCT_NAME = Runner;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Debug_com.starlock.lock.local.mobileprovision;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
@ -1170,8 +1173,10 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = P8997RW3V8;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NAQ5PL2DYC;
|
||||
INFOPLIST_FILE = Runner/info_xhj.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@ -1181,6 +1186,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.starlock.lock.local;
|
||||
PRODUCT_NAME = Runner;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Debug_com.starlock.lock.local.mobileprovision;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
@ -1194,8 +1200,10 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NAQ5PL2DYC;
|
||||
INFOPLIST_FILE = Runner/info_sky.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@ -1204,6 +1212,7 @@
|
||||
);
|
||||
PRODUCT_NAME = Runner;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Appstore_com.skychip.lock.mobileprovision;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
@ -1217,8 +1226,10 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = P8997RW3V8;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = P8997RW3V8;
|
||||
INFOPLIST_FILE = Runner/info_xhj.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@ -1228,6 +1239,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.xhjcn.lock;
|
||||
PRODUCT_NAME = Runner;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Appstore_com.xhjcn.lock.mobileprovision;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
@ -1558,8 +1570,10 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NAQ5PL2DYC;
|
||||
INFOPLIST_FILE = Runner/info_sky.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@ -1569,6 +1583,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.skychip.lock.pre;
|
||||
PRODUCT_NAME = Runner;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Adhoc_com.skychip.lock.pre.mobileprovision;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
@ -1653,8 +1668,10 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = NAQ5PL2DYC;
|
||||
INFOPLIST_FILE = Runner/info_sky.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@ -1664,6 +1681,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.skychip.lock.dev;
|
||||
PRODUCT_NAME = Runner;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Adhoc_com.skychip.lock.dev.mobileprovision;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
@ -1748,8 +1766,10 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = P8997RW3V8;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = P8997RW3V8;
|
||||
INFOPLIST_FILE = Runner/info_xhj.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@ -1759,6 +1779,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.xhjcn.lock.pre;
|
||||
PRODUCT_NAME = Runner;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = Adhoc_com.xhjcn.lock.pre.mobileprovision;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Release-xhj"
|
||||
buildConfiguration = "Debug-xhj"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
#import "XSFlutterManager.h"
|
||||
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
#import <UMCommon/UMCommon.h>
|
||||
// #import <UMCommon/UMCommon.h>
|
||||
|
||||
|
||||
@interface AppDelegate()
|
||||
|
||||
10
ios/build.sh
10
ios/build.sh
@ -7,18 +7,18 @@ 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
|
||||
#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
|
||||
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 flavor:xhj --verbose
|
||||
bundle exec fastlane release flavor:sky --verbose
|
||||
bundle exec fastlane release_ipa flavor:xhj --verbose
|
||||
bundle exec fastlane release_ipa flavor:sky --verbose
|
||||
elif [[ "${ENV_BUILD_BRANCH}" == "develop" ]]; then
|
||||
echo "===build dev===${NEXT_VERSION}"
|
||||
bundle exec fastlane beta flavor:xhj env:Dev --verbose
|
||||
|
||||
@ -84,6 +84,13 @@ platform :ios do
|
||||
commit_hash = last_git_commit
|
||||
short_hash = commit_hash[:abbreviated_commit_hash]
|
||||
print_log "last_git_commit_short_hash #{short_hash}"
|
||||
remove_zone_pre_build(zone:"com")
|
||||
Dir.chdir "../.." do
|
||||
sh("flutter","pub","get")
|
||||
end
|
||||
Dir.chdir ".." do
|
||||
sh("bundle", "exec" ,"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}")
|
||||
end
|
||||
@ -119,7 +126,7 @@ platform :ios do
|
||||
end
|
||||
|
||||
desc "Build & Deliver to App Store Connect"
|
||||
lane :release do |options|
|
||||
lane :release_ipa do |options|
|
||||
flavor = options[:flavor]
|
||||
UI.user_error!("flavor is required") unless flavor
|
||||
print_log "build flavor: #{flavor}"
|
||||
@ -130,6 +137,13 @@ platform :ios do
|
||||
commit_hash = last_git_commit
|
||||
short_hash = commit_hash[:abbreviated_commit_hash]
|
||||
print_log "last_git_commit_short_hash #{short_hash}"
|
||||
remove_zone_pre_build(zone:"com")
|
||||
Dir.chdir "../.." do
|
||||
sh("flutter","pub","get")
|
||||
end
|
||||
Dir.chdir ".." do
|
||||
sh("bundle", "exec" ,"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}")
|
||||
end
|
||||
@ -188,6 +202,46 @@ platform :ios do
|
||||
end
|
||||
end
|
||||
|
||||
lane :remove_zone_pre_build do |options|
|
||||
sh("git", "reset", "--hard")
|
||||
zone = options[:zone]
|
||||
UI.user_error!("Please provide valid 'zone'") unless zone
|
||||
pathList=["pubspec.yaml","/lib/apm"]
|
||||
extensions = [".dart"] #options[:extensions]
|
||||
if pathList.empty? || extensions.empty?
|
||||
UI.user_error!("Please provide valid 'paths' and 'extensions' arrays.")
|
||||
end
|
||||
puts "start prepare zone: #{zone},pathList:#{pathList},extensions:#{extensions}"
|
||||
regexp_List = [/#<#{zone}>.*?#<\/#{zone}>/m,/\/\/\<#{zone}\>.*?\/\/\<\/#{zone}\>/m]
|
||||
UI.message("Processed RegExpList: #{regexp_List}")
|
||||
def process_file(file_path, regexpList)
|
||||
content = File.read(file_path)
|
||||
regexpList.each do |tag|
|
||||
content = content.gsub(tag,'')
|
||||
end
|
||||
File.write(file_path, content)
|
||||
UI.message("Processed file: #{file_path},content :\n #{content}")
|
||||
end
|
||||
|
||||
pathList.each do |path|
|
||||
realPath = File.join($path_dir_build, path)
|
||||
if File.directory?(realPath)
|
||||
Dir.glob("#{realPath}/**/*").each do |file|
|
||||
if File.directory?(file)
|
||||
UI.message("Find child dir path: #{file}")
|
||||
elsif extensions.include?(File.extname(file))
|
||||
process_file(file,regexp_List)
|
||||
end
|
||||
end
|
||||
elsif File.file?(realPath)
|
||||
process_file(realPath,regexp_List)
|
||||
else
|
||||
UI.message("Invalid path: #{realPath}")
|
||||
end
|
||||
end
|
||||
UI.success("All matching content removed from specified files.")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
71
lib/apm/apm_helper.dart
Normal file
71
lib/apm/apm_helper.dart
Normal file
@ -0,0 +1,71 @@
|
||||
//<com>
|
||||
import 'firebase/firebase_helper.dart';
|
||||
|
||||
//</com>
|
||||
|
||||
//<cn>
|
||||
import 'umeng/umeng_helper.dart';
|
||||
//</cn>
|
||||
|
||||
class ApmHelper {
|
||||
ApmHelper._internal();
|
||||
|
||||
factory ApmHelper() => _getInstance();
|
||||
|
||||
static ApmHelper get instance => _getInstance();
|
||||
static ApmHelper? _instance;
|
||||
|
||||
// 增加开关
|
||||
static bool enabled = false;
|
||||
|
||||
static ApmHelper _getInstance() {
|
||||
_instance ??= ApmHelper._internal();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
Future<void> initApp() async {
|
||||
//<cn>
|
||||
await UmengHelper.instance.initApp();
|
||||
//</cn>
|
||||
//<com>
|
||||
await FirebaseHelper.instance.initApp();
|
||||
//</com>
|
||||
}
|
||||
|
||||
Future<void> initSdk() async {
|
||||
//<cn>
|
||||
UmengHelper.instance.initSdk();
|
||||
//</cn>
|
||||
//<com>
|
||||
FirebaseHelper.instance.initSdk();
|
||||
//</com>
|
||||
}
|
||||
|
||||
Future<void> login(String userId) async {
|
||||
//<cn>
|
||||
UmengHelper.instance.login(userId);
|
||||
//</cn>
|
||||
//<com>
|
||||
FirebaseHelper.instance.login(userId);
|
||||
//</com>
|
||||
}
|
||||
|
||||
Future<void> trackEvent(
|
||||
String eventName, Map<String, Object> parameters) async {
|
||||
//<cn>
|
||||
UmengHelper.instance.trackEvent(eventName, parameters);
|
||||
//</cn>
|
||||
//<com>
|
||||
FirebaseHelper.instance.trackEvent(eventName, parameters);
|
||||
//</com>
|
||||
}
|
||||
|
||||
Future<void> logout() async {
|
||||
//<cn>
|
||||
UmengHelper.instance.logout();
|
||||
//</cn>
|
||||
//<com>
|
||||
FirebaseHelper.instance.logout();
|
||||
//</com>
|
||||
}
|
||||
}
|
||||
77
lib/apm/firebase/firebase_helper.dart
Normal file
77
lib/apm/firebase/firebase_helper.dart
Normal file
@ -0,0 +1,77 @@
|
||||
//<com>
|
||||
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||
import 'package:firebase_core/firebase_core.dart'
|
||||
show Firebase, FirebaseOptions;
|
||||
import 'package:flutter/foundation.dart'
|
||||
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
||||
|
||||
class DefaultFirebaseOptions {
|
||||
static FirebaseOptions get currentPlatform {
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.android:
|
||||
return android;
|
||||
case TargetPlatform.iOS:
|
||||
return ios;
|
||||
default:
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions are not supported for this platform.',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static const FirebaseOptions android = FirebaseOptions(
|
||||
apiKey: 'AIzaSyC-3-ABWuy9LrYyAw_KxDRto4DanQ0sq9g',
|
||||
appId: '1:281500445726:android:ddf52ac7b7f83cf5c4d20f',
|
||||
messagingSenderId: '281500445726',
|
||||
projectId: 'skychip2023-ecdff',
|
||||
storageBucket: 'skychip2023-ecdff.firebasestorage.app',
|
||||
);
|
||||
|
||||
static const FirebaseOptions ios = FirebaseOptions(
|
||||
apiKey: 'AIzaSyACbp5aUKhLU1SMg8iIdm9WmNX7wxI7fVc',
|
||||
appId: '1:281500445726:ios:b194ccffb92fb86cc4d20f',
|
||||
messagingSenderId: '281500445726',
|
||||
projectId: 'skychip2023-ecdff',
|
||||
storageBucket: 'skychip2023-ecdff.firebasestorage.app',
|
||||
iosBundleId: 'com.starlock.lock.local',
|
||||
);
|
||||
}
|
||||
|
||||
class FirebaseHelper {
|
||||
factory FirebaseHelper() => _getInstance();
|
||||
|
||||
FirebaseHelper._internal();
|
||||
|
||||
static FirebaseHelper get instance => _getInstance();
|
||||
static FirebaseHelper? _instance;
|
||||
|
||||
static FirebaseHelper _getInstance() {
|
||||
_instance ??= FirebaseHelper._internal();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
Future<void> initApp() async {
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> initSdk() async {
|
||||
FirebaseAnalytics.instance.setAnalyticsCollectionEnabled(true);
|
||||
}
|
||||
|
||||
Future<void> login(String userId) async {
|
||||
FirebaseAnalytics.instance.setUserId(id: userId);
|
||||
}
|
||||
|
||||
Future<void> trackEvent(
|
||||
String eventName, Map<String, Object>? parameters) async {
|
||||
FirebaseAnalytics.instance
|
||||
.logEvent(name: eventName, parameters: parameters);
|
||||
}
|
||||
|
||||
Future<void> logout() async {
|
||||
FirebaseAnalytics.instance.setUserId(id: '');
|
||||
}
|
||||
}
|
||||
//</com>
|
||||
41
lib/apm/umeng/umeng_helper.dart
Normal file
41
lib/apm/umeng/umeng_helper.dart
Normal file
@ -0,0 +1,41 @@
|
||||
//<cn>
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
import '../../flavors.dart';
|
||||
|
||||
class UmengHelper {
|
||||
UmengHelper._internal();
|
||||
|
||||
factory UmengHelper() => _getInstance();
|
||||
|
||||
static UmengHelper get instance => _getInstance();
|
||||
static UmengHelper? _instance;
|
||||
|
||||
static UmengHelper _getInstance() {
|
||||
_instance ??= UmengHelper._internal();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
Future<void> initApp() async {
|
||||
|
||||
}
|
||||
|
||||
Future<void> initSdk() async {
|
||||
UmengCommonSdk.initCommon(
|
||||
F.umengKey.androidKey, F.umengKey.iosKey, F.umengKey.channel);
|
||||
UmengCommonSdk.setPageCollectionModeManual();
|
||||
}
|
||||
|
||||
Future<void> login(String userId) async {
|
||||
UmengCommonSdk.onProfileSignIn(userId);
|
||||
}
|
||||
|
||||
Future<void> trackEvent(
|
||||
String eventName, Map<String, Object> parameters) async {
|
||||
UmengCommonSdk.onEvent(eventName, parameters);
|
||||
}
|
||||
|
||||
Future<void> logout() async {
|
||||
UmengCommonSdk.onProfileSignOff();
|
||||
}
|
||||
}
|
||||
//</cn>
|
||||
@ -22,6 +22,20 @@ class StarLockAMapKey {
|
||||
const StarLockAMapKey({required this.iosKey, required this.androidKey});
|
||||
}
|
||||
|
||||
class UmengKey {
|
||||
//iOS平台的key
|
||||
final String iosKey;
|
||||
|
||||
//Android平台的key
|
||||
final String androidKey;
|
||||
|
||||
//channle
|
||||
final String channel;
|
||||
|
||||
const UmengKey(
|
||||
{required this.iosKey, required this.androidKey, required this.channel});
|
||||
}
|
||||
|
||||
typedef dynamic fCallFunction();
|
||||
|
||||
class F {
|
||||
@ -180,6 +194,62 @@ class F {
|
||||
}
|
||||
}
|
||||
|
||||
// StarLockAMapKey
|
||||
static UmengKey get umengKey {
|
||||
switch (appFlavor) {
|
||||
case Flavor.local:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.dev:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.pre:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.sky_dev:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.sky_pre:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.sky:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.xhj_dev:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.xhj_pre:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
case Flavor.xhj:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
default:
|
||||
return const UmengKey(
|
||||
androidKey: '671244cf80464b33f6df9648',
|
||||
iosKey: '671244ae80464b33f6df9646',
|
||||
channel: 'Product');
|
||||
}
|
||||
}
|
||||
|
||||
// 是否是生产环境
|
||||
static bool get isProductionEnv {
|
||||
switch (appFlavor) {
|
||||
|
||||
@ -2,11 +2,11 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/login/forgetPassword/starLock_forgetPassword_state.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../network/api_repository.dart';
|
||||
import '../../tools/baseGetXController.dart';
|
||||
@ -55,7 +55,7 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
|
||||
'B748F838-94EE-4BDB-A0E6-7B2D16849792',
|
||||
state.verificationCode.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('resetPassword_result', {
|
||||
ApmHelper.instance.trackEvent('resetPassword_result', {
|
||||
'account':state.phoneStr.value,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'resetPassword_res':'成功',
|
||||
@ -64,7 +64,7 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
|
||||
showToast('重置成功'.tr);
|
||||
Get.back();
|
||||
}else{
|
||||
UmengCommonSdk.onEvent('resetPassword_result', {
|
||||
ApmHelper.instance.trackEvent('resetPassword_result', {
|
||||
'account':state.phoneStr.value,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'resetPassword_res':'${entity.errorCode}--${entity.errorMsg}',
|
||||
|
||||
@ -25,6 +25,7 @@ class LoginData {
|
||||
uid = json['uid'];
|
||||
isVip = json['isVip'];
|
||||
}
|
||||
|
||||
String? accessToken;
|
||||
int? userid;
|
||||
int? expiresAt;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/blue/blue_manage.dart';
|
||||
@ -7,7 +8,6 @@ import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/mine/mine/starLockMine_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../main/lockMian/lockMain/lockMain_logic.dart';
|
||||
import '../../mine/mine/starLockMine_logic.dart';
|
||||
@ -50,7 +50,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
||||
username: state.emailOrPhone.value,
|
||||
deviceInfo: state.deviceInfoMap);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('login_result', {
|
||||
ApmHelper.instance.trackEvent('login_result', {
|
||||
'account': state.emailOrPhone.value,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'login_res': '成功',
|
||||
@ -65,7 +65,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
||||
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
||||
BlueManage().scanDevices.clear(); //清除设备缓存
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('login_result', {
|
||||
ApmHelper.instance.trackEvent('login_result', {
|
||||
'account': state.emailOrPhone.value,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'login_res': '${entity.errorCode}--${entity.errorMsg}',
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/blue/blue_manage.dart';
|
||||
@ -12,7 +12,6 @@ import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../network/api_repository.dart';
|
||||
import '../../tools/baseGetXController.dart';
|
||||
@ -26,6 +25,7 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
final StarLockRegisterState state = StarLockRegisterState();
|
||||
|
||||
late Timer _timer;
|
||||
|
||||
void _startTimer() {
|
||||
_timer = Timer.periodic(1.seconds, (Timer timer) {
|
||||
if (state.currentSecond > 1) {
|
||||
@ -49,7 +49,7 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!RegularExpression().validateString(state.pwd.value)){
|
||||
if (!RegularExpression().validateString(state.pwd.value)) {
|
||||
showToast('密码需至少包含数字/字母/字符中的2种组合'.tr);
|
||||
return;
|
||||
}
|
||||
@ -61,10 +61,10 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
verificationCode: state.verificationCode.value,
|
||||
deviceInfo: state.deviceInfoMap.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('register_result', {
|
||||
'account':state.phoneOrEmailStr.value,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'register_res':'成功',
|
||||
ApmHelper.instance.trackEvent('register_result', {
|
||||
'account': state.phoneOrEmailStr.value,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'register_res': '成功',
|
||||
});
|
||||
|
||||
Storage.saveLoginData(entity.data);
|
||||
@ -73,11 +73,11 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
XSJPushProvider().initLocalNotification(isCancelLocalPush: false);
|
||||
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
||||
BlueManage().scanDevices.clear(); //清除设备缓存
|
||||
}else{
|
||||
UmengCommonSdk.onEvent('register_result', {
|
||||
'account':state.phoneOrEmailStr.value,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'register_res':'${entity.errorCode}--${entity.errorMsg}',
|
||||
} else {
|
||||
ApmHelper.instance.trackEvent('register_result', {
|
||||
'account': state.phoneOrEmailStr.value,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'register_res': '${entity.errorCode}--${entity.errorMsg}',
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -135,12 +135,15 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
|
||||
// 重置是否能提交
|
||||
void _resetCanSub() {
|
||||
state.canSub.value = state.pwdIsOK && state.codeIsOK && state.phoneOrEmailStr.value.isNotEmpty;
|
||||
state.canSub.value = state.pwdIsOK &&
|
||||
state.codeIsOK &&
|
||||
state.phoneOrEmailStr.value.isNotEmpty;
|
||||
}
|
||||
|
||||
// 重置是否能发送验证码
|
||||
void _resetCanSendCode() {
|
||||
state.canSendCode.value = state.pwdIsOK && state.phoneOrEmailStr.value.isNotEmpty;
|
||||
state.canSendCode.value =
|
||||
state.pwdIsOK && state.phoneOrEmailStr.value.isNotEmpty;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -17,8 +17,8 @@ import 'package:star_lock/tools/platform_info_services.dart';
|
||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import 'apm/apm_helper.dart';
|
||||
import 'app.dart';
|
||||
import 'app_settings/app_settings.dart';
|
||||
import 'tools/store_service.dart';
|
||||
@ -27,7 +27,7 @@ import 'tools/store_service.dart';
|
||||
FutureOr<void> main() async {
|
||||
FlutterBugly.postCatchedException(() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await ApmHelper.instance.initApp();
|
||||
await _setCommonServices();
|
||||
|
||||
// 设置国际化信息
|
||||
@ -74,10 +74,7 @@ Future<void> _setCommonServices() async {
|
||||
|
||||
//关于隐私协议的初始化
|
||||
Future<void> privacySDKInitialization() async {
|
||||
UmengCommonSdk.initCommon(
|
||||
'671244cf80464b33f6df9648', '671244ae80464b33f6df9646', 'Product');
|
||||
UmengCommonSdk.setPageCollectionModeManual();
|
||||
|
||||
ApmHelper.instance.initSdk();
|
||||
await Get.putAsync(() => PlatformInfoService().init());
|
||||
await BuglyTool.init();
|
||||
// 初始化JPush服务
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
@ -12,13 +12,8 @@ import 'package:star_lock/mine/valueAddedServices/valueAddedServicesHighFunction
|
||||
import 'package:star_lock/tools/NativeInteractionTool.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../../blue/sender_manage.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
import '../../../../tools/commonDataManage.dart';
|
||||
@ -222,7 +217,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
: '');
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('add_authorizedAdmin', {
|
||||
ApmHelper.instance.trackEvent('add_authorizedAdmin', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -245,7 +240,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
sendElectronicKeyRequest();
|
||||
});
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('add_authorizedAdmin', {
|
||||
ApmHelper.instance.trackEvent('add_authorizedAdmin', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -1,14 +1,12 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/card/addICCard/addICCard_entity.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../apm/apm_helper.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
@ -22,20 +20,23 @@ import '../../../../tools/eventBusEventManage.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
import 'addICCard_state.dart';
|
||||
|
||||
class AddICCardLogic extends BaseGetXController{
|
||||
class AddICCardLogic extends BaseGetXController {
|
||||
AddICCardState state = AddICCardState();
|
||||
|
||||
// 监听设备返回的数据
|
||||
late StreamSubscription<Reply> _replySubscription;
|
||||
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
// 添加IC卡开始
|
||||
if((reply is SenderAddICCardWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
||||
if ((reply is SenderAddICCardWithTimeCycleCoercionReply) &&
|
||||
(state.ifCurrentScreen.value == true)) {
|
||||
_replyAddICCardBegin(reply);
|
||||
}
|
||||
|
||||
// 添加卡确认
|
||||
if(reply is SenderAddICCardConfirmationReply) {
|
||||
if (reply is SenderAddICCardConfirmationReply) {
|
||||
_replyAddICCardConfirmation(reply);
|
||||
}
|
||||
});
|
||||
@ -46,13 +47,13 @@ class AddICCardLogic extends BaseGetXController{
|
||||
BuglyTool.uploadException(
|
||||
message: '添加卡开始,解析数据',
|
||||
detail: '添加卡开始,解析数据 _replyAddICCardBegin:${reply.data}',
|
||||
upload: false
|
||||
);
|
||||
upload: false);
|
||||
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
final List<int> cardNumberList = reply.data.sublist(reply.data.length - 2);
|
||||
final List<int> cardNumberList =
|
||||
reply.data.sublist(reply.data.length - 2);
|
||||
final String cardNumber = listChangInt(cardNumberList).toString();
|
||||
// AppLog.log("添加卡号:$cardNumberList cardNumber:$cardNumber");
|
||||
state.cardNumber.value = cardNumber.toString();
|
||||
@ -63,10 +64,13 @@ class AddICCardLogic extends BaseGetXController{
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList =
|
||||
changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
final List<String>? signKey =
|
||||
await Storage.getStringList(saveBlueSignKey);
|
||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
@ -78,25 +82,29 @@ class AddICCardLogic extends BaseGetXController{
|
||||
// AppLog.log('添加卡token:$token');
|
||||
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:0,
|
||||
useCountLimit:0xffff,
|
||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime:DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: token,
|
||||
isBeforeAddUser: false
|
||||
);
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
cardNo: 0,
|
||||
useCountLimit: 0xffff,
|
||||
operate: 0,
|
||||
// 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce: state.isCoerced.value == '1' ? 1 : 0,
|
||||
// 是否是胁迫
|
||||
isRound: state.selectType.value == '2' ? 1 : 0,
|
||||
// 是否是循环
|
||||
weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
|
||||
state.weekDay.value),
|
||||
// 周循环
|
||||
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime: DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: token,
|
||||
isBeforeAddUser: false);
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
@ -113,58 +121,59 @@ class AddICCardLogic extends BaseGetXController{
|
||||
message: '添加卡结果,解析数据',
|
||||
detail: '添加卡结果,解析数据 _replyAddICCardConfirmation:${reply.data}',
|
||||
eventStr: '添加卡事件结果',
|
||||
upload: true
|
||||
);
|
||||
upload: true);
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'add_card_result':'成功',
|
||||
ApmHelper.instance.trackEvent('add_card', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'add_card_result': '成功',
|
||||
});
|
||||
switch(reply.data[5]){
|
||||
switch (reply.data[5]) {
|
||||
case 0xff:
|
||||
// 注册指纹失败
|
||||
// 注册指纹失败
|
||||
showToast('退出添加'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFE:
|
||||
// 管理员已满
|
||||
// 管理员已满
|
||||
showToast('管理员已满'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFD:
|
||||
// 用户已满
|
||||
// 用户已满
|
||||
showToast('用户已满'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFC:
|
||||
// 指纹已满
|
||||
// 指纹已满
|
||||
showToast('锁上面添加卡已满'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFB:
|
||||
// 指纹已存在
|
||||
// 指纹已存在
|
||||
showToast('卡已存在'.tr);
|
||||
break;
|
||||
default:
|
||||
// 添加指纹中
|
||||
// 当前注册数
|
||||
// 添加指纹中
|
||||
// 当前注册数
|
||||
addICCardData();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'add_card_result':reply.data[2],
|
||||
ApmHelper.instance.trackEvent('add_card', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'add_card_result': reply.data[2],
|
||||
});
|
||||
break;
|
||||
}
|
||||
@ -175,91 +184,105 @@ class AddICCardLogic extends BaseGetXController{
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
final String command = SenderAddICCardWithTimeCycleCoercionCommand(
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:0,
|
||||
useCountLimit:0xffff,
|
||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime:DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
cardNo: 0,
|
||||
useCountLimit: 0xffff,
|
||||
operate: 0,
|
||||
// 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce: state.isCoerced.value == '1' ? 1 : 0,
|
||||
// 是否是胁迫
|
||||
isRound: state.selectType.value == '2' ? 1 : 0,
|
||||
// 是否是循环
|
||||
weekRound: DateTool()
|
||||
.accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value),
|
||||
// 周循环
|
||||
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime: DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
).toString();
|
||||
|
||||
showBlueConnetctToastTimer(action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'add_card_result':'添加卡超时',
|
||||
ApmHelper.instance.trackEvent('add_card', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'add_card_result': '添加卡超时',
|
||||
});
|
||||
|
||||
BuglyTool.uploadException(
|
||||
message: '添加卡超时处理-添加卡失败',
|
||||
detail: '添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
detail:
|
||||
'添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
eventStr: '添加卡事件超时',
|
||||
upload: true
|
||||
);
|
||||
upload: true);
|
||||
|
||||
Get.close(1);
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:0,
|
||||
useCountLimit:0xffff,
|
||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime:DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
isBeforeAddUser: false
|
||||
);
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
cardNo: 0,
|
||||
useCountLimit: 0xffff,
|
||||
operate: 0,
|
||||
// 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce: state.isCoerced.value == '1' ? 1 : 0,
|
||||
// 是否是胁迫
|
||||
isRound: state.selectType.value == '2' ? 1 : 0,
|
||||
// 是否是循环
|
||||
weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
|
||||
state.weekDay.value),
|
||||
// 周循环
|
||||
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime: DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
isBeforeAddUser: false);
|
||||
} else if (deviceConnectionState ==
|
||||
BluetoothConnectionState.disconnected) {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'add_card_result':'添加卡断开连接',
|
||||
ApmHelper.instance.trackEvent('add_card', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'add_card_result': '添加卡断开连接',
|
||||
});
|
||||
|
||||
BuglyTool.uploadException(
|
||||
message: '添加卡超时处理-添加卡失败',
|
||||
detail: '添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
detail:
|
||||
'添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
eventStr: '添加卡事件断开连接',
|
||||
upload: true
|
||||
);
|
||||
upload: true);
|
||||
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
cancelBlueConnetctToastTimer();
|
||||
@ -270,27 +293,32 @@ class AddICCardLogic extends BaseGetXController{
|
||||
|
||||
// 取消添加指纹
|
||||
Future<void> senderCancelAddCardCommand() async {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
final List<String>? privateKey =
|
||||
await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList =
|
||||
changeStringListToIntList(privateKey!);
|
||||
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
final List<String>? signKey =
|
||||
await Storage.getStringList(saveBlueSignKey);
|
||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderCancelAddCardCommand(
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
}else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
} else if (deviceConnectionState ==
|
||||
BluetoothConnectionState.disconnected) {
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
cancelBlueConnetctToastTimer();
|
||||
@ -319,18 +347,20 @@ class AddICCardLogic extends BaseGetXController{
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateIdCardUserNoLoadData(String cardId) async{
|
||||
final LoginEntity entity = await ApiRepository.to.updateIdCardUserNoLoadData(
|
||||
Future<void> updateIdCardUserNoLoadData(String cardId) async {
|
||||
final LoginEntity entity =
|
||||
await ApiRepository.to.updateIdCardUserNoLoadData(
|
||||
lockId: state.lockId.value.toString(),
|
||||
cardId: cardId,
|
||||
cardUserNo: state.cardNumber.value,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast('添加成功'.tr, something:(){
|
||||
if(state.fromType.value == 2){
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('添加成功'.tr, something: () {
|
||||
if (state.fromType.value == 2) {
|
||||
// 回调指纹号
|
||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(state.cardNumber.value));
|
||||
}else if(state.fromType.value == 1){
|
||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(
|
||||
state.cardNumber.value));
|
||||
} else if (state.fromType.value == 1) {
|
||||
eventBus.fire(OtherTypeRefreshListEvent());
|
||||
}
|
||||
Get.close(2);
|
||||
@ -356,5 +386,4 @@ class AddICCardLogic extends BaseGetXController{
|
||||
void onClose() {
|
||||
_replySubscription.cancel();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,8 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
|
||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_state.dart';
|
||||
@ -11,7 +10,6 @@ import 'package:star_lock/main/lockDetail/lockOperatingRecord/lockOperatingRecor
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../blue/blue_manage.dart';
|
||||
import '../../../blue/io_protocol/io_referEventRecordTime.dart';
|
||||
@ -151,7 +149,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||
'lockName': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -205,7 +203,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||
'lockName': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -303,7 +301,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
showEasyLoading();
|
||||
getLockRecordLastUploadDataTime();
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||
'lockName': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -314,7 +312,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
}
|
||||
dismissEasyLoading();
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||
'lockName': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_entity.dart';
|
||||
@ -17,7 +18,6 @@ import 'package:star_lock/tools/regularExpression.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
import 'package:star_lock/tools/showTipView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../../../blue/blue_manage.dart';
|
||||
|
||||
@ -185,7 +185,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
: '');
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('add_electronic_key', {
|
||||
ApmHelper.instance.trackEvent('add_electronic_key', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -201,7 +201,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
update();
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('add_electronic_key', {
|
||||
ApmHelper.instance.trackEvent('add_electronic_key', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
|
||||
@ -3,11 +3,10 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/fingerprint/addFingerprint/addFingerprint_entity.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../../blue/blue_manage.dart';
|
||||
import '../../../../../blue/io_reply.dart';
|
||||
@ -171,7 +170,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
case 0x00:
|
||||
//成功
|
||||
// var fingerprintNum = listChangInt(reply.data.sublist(9, 11)).toString();
|
||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
||||
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -203,7 +202,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
||||
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -254,7 +253,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
showBlueConnetctToastTimer(action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
||||
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -302,7 +301,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
);
|
||||
}else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
||||
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
@ -14,7 +15,6 @@ import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
||||
import 'package:star_lock/tools/bugly/bugly_tool.dart';
|
||||
import 'package:star_lock/tools/throttler.dart';
|
||||
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../app_settings/app_settings.dart';
|
||||
import '../../../blue/blue_manage.dart';
|
||||
@ -71,7 +71,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
if (status != 6) {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('open_lock', {
|
||||
ApmHelper.instance.trackEvent('open_lock', {
|
||||
'lock_name': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -378,7 +378,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
outTimer: 20,
|
||||
action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('open_lock', {
|
||||
ApmHelper.instance.trackEvent('open_lock', {
|
||||
'lock_name': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -422,7 +422,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
detail: '蓝牙连接失败,断开连接, 开锁失败--OpenLockCommand:$command',
|
||||
upload: true);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('open_lock', {
|
||||
ApmHelper.instance.trackEvent('open_lock', {
|
||||
'lock_name': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -3,9 +3,9 @@ import 'dart:async';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_factoryDataReset.dart';
|
||||
@ -294,7 +294,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
isShowBlueConnetctToast: false,
|
||||
action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -332,7 +332,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
token: getTokenList);
|
||||
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -538,6 +538,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
|
||||
// 下级界面修改成功后传递数据
|
||||
StreamSubscription? _passCurrentLockInformationEvent;
|
||||
|
||||
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
_passCurrentLockInformationEvent = eventBus
|
||||
@ -597,7 +598,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -616,7 +617,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
});
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -636,7 +637,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
state.deleteAdministratorIsHaveAllData.value == true ? 1 : 0);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -655,7 +656,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
});
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -2,11 +2,11 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_modelVendor.dart';
|
||||
@ -182,7 +182,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
pwdRight: state.isAdministrator.value == true ? 1 : 0);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('add_password', {
|
||||
ApmHelper.instance.trackEvent('add_password', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -199,7 +199,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
updatePWDNumberRequest(entity.data!.keyboardPwdId.toString());
|
||||
}
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('add_password', {
|
||||
ApmHelper.instance.trackEvent('add_password', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -419,7 +419,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_password', {
|
||||
ApmHelper.instance.trackEvent('add_password', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -465,7 +465,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
token: getTokenList);
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_password', {
|
||||
ApmHelper.instance.trackEvent('add_password', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
|
||||
@ -3,10 +3,10 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
|
||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_logic.dart';
|
||||
import 'package:star_lock/mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../app_settings/app_settings.dart';
|
||||
import '../../../blue/blue_manage.dart';
|
||||
@ -407,7 +407,7 @@ class SaveLockLogic extends BaseGetXController {
|
||||
state.lockId = entity.data!.lockId!;
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('save_lock_result', {
|
||||
ApmHelper.instance.trackEvent('save_lock_result', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -423,7 +423,7 @@ class SaveLockLogic extends BaseGetXController {
|
||||
state.sureBtnState.value = 0;
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('save_lock_result', {
|
||||
ApmHelper.instance.trackEvent('save_lock_result', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
||||
@ -13,7 +14,6 @@ import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
@ -131,7 +131,8 @@ class MineSetLogic extends BaseGetXController {
|
||||
await ApiRepository.to.userLogout(deviceld: getPushDeviceID);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('logout', {
|
||||
ApmHelper.instance.logout();
|
||||
ApmHelper.instance.trackEvent('logout', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -149,7 +150,8 @@ class MineSetLogic extends BaseGetXController {
|
||||
XSJPushProvider().initLocalNotification(isCancelLocalPush: true);
|
||||
Get.offNamedUntil(Routers.starLockLoginPage, (Route route) => false);
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('logout', {
|
||||
ApmHelper.instance.logout();
|
||||
ApmHelper.instance.trackEvent('logout', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
|
||||
import '../login/login/entity/LoginData.dart';
|
||||
import '../main/lockMian/entity/lockListInfo_entity.dart';
|
||||
@ -192,12 +193,14 @@ class Storage {
|
||||
final String? data = await Storage.getString(saveUserLoginData);
|
||||
if (data != null && data.isNotEmpty) {
|
||||
loginData = LoginData.fromJson(jsonDecode(data));
|
||||
ApmHelper.instance.login(loginData.userid!.toString());
|
||||
}
|
||||
// AppLog.log("loginData:$loginData");
|
||||
return loginData;
|
||||
}
|
||||
|
||||
static Future<void> saveLoginData(LoginData? data) async {
|
||||
ApmHelper.instance.login(data!.userid!.toString());
|
||||
await Storage.setString(saveUserLoginData, jsonEncode(data));
|
||||
}
|
||||
|
||||
|
||||
@ -236,7 +236,7 @@ dependencies:
|
||||
timelines: ^0.1.0
|
||||
#侧滑删除
|
||||
flutter_slidable: ^3.0.1
|
||||
# audio_service: ^0.18.12
|
||||
# audio_service: ^0.18.12
|
||||
app_settings: ^5.1.1
|
||||
flutter_local_notifications: ^17.0.0
|
||||
fluwx: 4.5.5
|
||||
@ -245,11 +245,16 @@ dependencies:
|
||||
colorfilter_generator: ^0.0.8
|
||||
file_picker: ^5.3.1
|
||||
# 错误日志监控
|
||||
# flutter_bugly_plugin: ^0.0.9
|
||||
# flutter_bugly_plugin: ^0.0.9
|
||||
flutter_bugly: ^1.0.2
|
||||
open_filex: ^4.4.0
|
||||
|
||||
#<cn>
|
||||
umeng_common_sdk: 1.2.8
|
||||
#</cn>
|
||||
#<com>
|
||||
firebase_analytics: 11.3.0
|
||||
#</com>
|
||||
|
||||
dependency_overrides:
|
||||
#强制设置google_maps_flutter_ios 为 2.5.2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user