Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock
This commit is contained in:
commit
920c7c2d85
1
star_lock/android/.gitignore
vendored
1
star_lock/android/.gitignore
vendored
@ -14,3 +14,4 @@ GeneratedPluginRegistrant.java
|
||||
#key.properties
|
||||
#**/*.keystore
|
||||
#**/*.jks
|
||||
/bundletool.jar
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
{
|
||||
"config": {
|
||||
"emas.appKey":"334068743",
|
||||
"emas.appSecret":"64de537f14984159a66ada10e54c6b63",
|
||||
"emas.packageName":"com.skychip.lock",
|
||||
"hotfix.idSecret":"334068743-1",
|
||||
"hotfix.rsaSecret":"MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCrcYP7FeYbeYakUMBa2Z5PtVh7LsuS+CfAM6GUjNUDByktVz2lFmZatFvMHn7xuxg6rgsRMrZ9IFziLC4xGltwHhSsCkr6cNoVZODAIXpowq+/Uwg3Gdbw/SOOT5dV70h5Dt3ztORVlobghCb5D74jgn6pqQVmhpSbrS+7zZTzcyKhsvRbQEx3tLa98uCDdIOjym4Jk0+dANCpVOTCPYbQtxewUKZv4ZcpIF0vwqVmAmNjjK04Bp6rhpM1pSxfIo3k6jwng9E+9iwmQkjk7NsexqyzXGmBywUBpSqFBo4bLLrGByqN/kAMAXpchRCBpx9Q311RHJb1T98n0wRimT5HAgMBAAECggEAClNE2ptgB2mTRVQjsZUHps9KK+kOk6RkaHvzkEnHDm6g+T0W1ll6Ap54JNv1U0OsWuRegEOon/KSBYEZqxVmSmNVZWMdTuX7DGzN6GRbxfFruj8a8I6a1lq4iHqcp61IlRnjHilX0xvEtcLfwgJDtknGrRsj2x/h1Vph1JK2FM9RqupT7O7Jy0ehkpVeyGWYLHcFKFThECRPFLHqAwBIY3aU6wp1G8NxkDRxj+C2cF4/cIEHFa7ZsEmVpNOI01qjntlFylNumuR+Ehz6DBKKT72eeVz+gMpnHs+ILGe0ov54soMobBTisw2dFdP9StHnnjoRwOH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jmbBbxGP7oPsy7yF9zn/hJiuvzlQfjtK85IXAYUKj7IcLashQUT5lrGYlObCznH2qOPkw8OP+cboP51uWIeXFMYatwXRR05vtWVLEeUhaFE1onzQtcG0YwIDAQAB",
|
||||
"appmonitor.rsaSecret":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCW084k+HG1OOaSY2B2N6aj4AOz8RhInqlaFr7BbQrqmPwzHC2Co0N/jmbBbxGP7oPsy7yF9zn/hJiuvzlQfjtK85IXAYUKj7IcLashQUT5lrGYlObCznH2qOPkw8OP+cboP51uWIeXFMYatwXRR05vtWVLEeUhaFE1onzQtcG0YwIDAQAB"
|
||||
},
|
||||
"services": {
|
||||
"hotfix_service":{
|
||||
"status":1,
|
||||
"version":"3.4.0"
|
||||
},
|
||||
"ha-adapter_service":{
|
||||
"status":1,
|
||||
"version":"1.2.3.0-open"
|
||||
},
|
||||
"feedback_service":{
|
||||
"status":1,
|
||||
"version":"3.4.2"
|
||||
},
|
||||
"tlog_service":{
|
||||
"status":1,
|
||||
"version":"1.1.7.0-open"
|
||||
},
|
||||
"httpdns_service":{
|
||||
"status":1,
|
||||
"version":"2.3.5"
|
||||
},
|
||||
"apm_service":{
|
||||
"status":1,
|
||||
"version":"1.1.3.0-open"
|
||||
},
|
||||
"man_service":{
|
||||
"status":1,
|
||||
"version":"1.2.7"
|
||||
},
|
||||
"cps_service":{
|
||||
"status":1,
|
||||
"version":"3.8.8.1"
|
||||
}
|
||||
},
|
||||
"use_maven":true,
|
||||
"proguard_keeplist":"\n#httpdns\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n\n#cps\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n-keepclasseswithmembernames class ** {\nnative <methods>;\n}\n-keepattributes Signature\n-keep class sun.misc.Unsafe { *; }\n-keep class com.alipay.** {*;}\n-dontwarn com.alipay.**\n-keep class anet.**{*;}\n-keep class org.android.spdy.**{*;}\n-keep class org.android.agoo.**{*;}\n-dontwarn anet.**\n-dontwarn org.android.spdy.**\n-dontwarn org.android.agoo.**\n\n#hotfix\n#基线包使用,生成mapping.txt\n-printmapping mapping.txt\n#生成的mapping.txt在app/buidl/outputs/mapping/release路径下,移动到/app路径下\n#修复后的项目使用,保证混淆结果一致\n#-applymapping mapping.txt\n#hotfix\n-keep class com.taobao.sophix.**{*;}\n-keep class com.ta.utdid2.device.**{*;}\n#防止inline\n-dontoptimize\n\n#man\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n\n#feedback\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n"
|
||||
}
|
||||
@ -23,7 +23,6 @@ if (flutterVersionName == null) {
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.aliyun.ams.emas-services' // 引用emas-services插件
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
@ -114,7 +113,7 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
|
||||
applicationId "com.skychip.lock"
|
||||
// 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
|
||||
@ -129,6 +128,18 @@ android {
|
||||
//设置支持的SO库架构(开发者可以根据需要,选择一个或多个平台的so)
|
||||
abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86","x86_64"
|
||||
}
|
||||
|
||||
manifestPlaceholders = [
|
||||
JPUSH_PKGNAME : "com.skychip.lock",
|
||||
//JPush 上注册的包名对应的 Appkey.
|
||||
JPUSH_APPKEY : "7ff37d174c1a568a89e98dad",
|
||||
//暂时填写默认值即可.
|
||||
JPUSH_CHANNEL : "flutter_channel",
|
||||
|
||||
//若不集成厂商通道,可直接跳过以下配置
|
||||
XIAOMI_APPID : "MI-2882303761520287291",
|
||||
XIAOMI_APPKEY : "MI-5352028744291",
|
||||
]
|
||||
splits {
|
||||
abi {
|
||||
enable true
|
||||
@ -140,6 +151,7 @@ android {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// 高德地图导致release编译模式下应用闪退,根据:[高德地图在Debug模式下运行正常但是打Release包时则闪退解决办法](https://blog.csdn.net/weixin_39370093/article/details/109631210)
|
||||
@ -163,7 +175,9 @@ 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.aliyun.ams:alicloud-android-push:3.8.7'
|
||||
//小米依赖
|
||||
implementation 'com.aliyun.ams:alicloud-android-third-push-xiaomi:3.8.7'
|
||||
|
||||
implementation 'cn.jiguang.sdk:jpush:5.2.3'
|
||||
implementation 'com.huawei.hms:push:6.12.0.300'
|
||||
|
||||
implementation 'cn.jiguang.sdk.plugin:xiaomi:5.2.3'
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.star_lock">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.example.star_lock">
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation"/>
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />-->
|
||||
@ -18,10 +18,6 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||
<!--允许获取wifi状态改变,用于网络定位(无gps情况下的定位),若需网络定位功能则必选-->
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
|
||||
<!--后台获取位置信息,若需后台定位则必选-->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />-->
|
||||
<!--用于申请调用A-GPS模块,卫星定位加速-->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />-->
|
||||
<!--允许写设备缓存,用于问题排查-->
|
||||
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
|
||||
<!--允许写入扩展存储,用于写入缓存定位数据-->
|
||||
@ -35,7 +31,10 @@
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
<uses-permission android:name="android.permission.REORDER_TASKS"/>
|
||||
<application android:label="@string/app_name" android:name="${applicationName}" android:icon="@mipmap/ic_launcher">
|
||||
<application android:label="@string/app_name" android:name="android.app.Application" android:icon="@mipmap/ic_launcher">
|
||||
<meta-data
|
||||
android:name="flutterEmbedding"
|
||||
android:value="2" />
|
||||
<!-- 配置定位Service -->
|
||||
<service android:name="com.amap.api.location.APSService"/>
|
||||
<activity android:name="com.skychip.lock.MainActivity" android:exported="true" android:screenOrientation="portrait" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
|
||||
@ -49,50 +48,7 @@
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
<meta-data android:name="flutterEmbedding" android:value="2"/>
|
||||
<meta-data android:name="com.amap.api.v2.apikey" android:value="11d49b3f4fc09c04a02bbb7500925ba2"></meta-data>
|
||||
<!-- 请填写你自己的- appKey -->
|
||||
<meta-data android:name="com.alibaba.app.appkey" android:value="334068743"/>
|
||||
<!-- 请填写你自己的appSecret -->
|
||||
<meta-data android:name="com.alibaba.app.appsecret" android:value="64de537f14984159a66ada10e54c6b63"/>
|
||||
<!-- 华为通道的参数appid -->
|
||||
<meta-data android:name="com.huawei.hms.client.appid" android:value="appid=xxxxx"/>
|
||||
<!-- vivo通道的参数api_key为appkey -->
|
||||
<meta-data android:name="com.vivo.push.api_key" android:value=""/>
|
||||
<meta-data android:name="com.vivo.push.app_id" android:value=""/>
|
||||
<!-- honor通道的参数-->
|
||||
<meta-data android:name="com.hihonor.push.app_id" android:value=""/>
|
||||
<!-- oppo -->
|
||||
<meta-data android:name="com.oppo.push.key" android:value=""/>
|
||||
<meta-data android:name="com.oppo.push.secret" android:value=""/>
|
||||
<!-- 小米-->
|
||||
<meta-data android:name="com.xiaomi.push.id" android:value="id=2882303761520287291"/>
|
||||
<meta-data android:name="com.xiaomi.push.key" android:value="id=5352028744291"/>
|
||||
<!-- 魅族-->
|
||||
<meta-data android:name="com.meizu.push.id" android:value=""/>
|
||||
<meta-data android:name="com.meizu.push.key" android:value=""/>
|
||||
<!-- fcm -->
|
||||
<meta-data android:name="com.gcm.push.sendid" android:value="id=999999999999"/>
|
||||
<meta-data android:name="com.gcm.push.applicationid" android:value=""/>
|
||||
<meta-data android:name="com.gcm.push.projectid" android:value=""/>
|
||||
<meta-data android:name="com.gcm.push.api.key" android:value=""/>
|
||||
<!-- 消息接收监听器 (用户可自主扩展) -->
|
||||
<receiver android:name="com.skychip.lock.MyMessageReceiver" android:exported="false">
|
||||
<!-- 为保证receiver安全,建议设置不可导出,如需对其他应用开放可通过android:permission进行限制 -->
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.sdk.android.push.intent.MESSAGE"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.sdk.android.push.RECEIVE"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
|
||||
</manifest>
|
||||
|
||||
@ -4,22 +4,15 @@ import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory
|
||||
import com.aliyun.ams.emas.push.CommonCallback
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import io.flutter.embedding.engine.FlutterEngine;
|
||||
import io.flutter.plugins.GeneratedPluginRegistrant
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import com.alibaba.sdk.android.push.register.MiPushRegister
|
||||
|
||||
class MainActivity: FlutterActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
initAliyunPushService()
|
||||
|
||||
MiPushRegister.register(applicationContext, "2882303761520287291", "5352028744291");
|
||||
|
||||
GeneratedPluginRegistrant.registerWith(flutterEngine!!)
|
||||
MethodChannel(flutterEngine?.dartExecutor!!.binaryMessenger, "starLockFlutterSend").setMethodCallHandler { call, result ->
|
||||
if (call.method == "loadNativeShare") {
|
||||
@ -63,23 +56,6 @@ class MainActivity: FlutterActivity() {
|
||||
startActivity(Intent.createChooser(shareIntent, null))
|
||||
}
|
||||
|
||||
private fun initAliyunPushService() {
|
||||
PushServiceFactory.init(applicationContext)
|
||||
val pushService = PushServiceFactory.getCloudPushService()
|
||||
|
||||
val callback = object : CommonCallback, com.alibaba.sdk.android.push.CommonCallback {
|
||||
override fun onSuccess(response: String?) {
|
||||
Log.e("TAG","success $response")
|
||||
}
|
||||
|
||||
override fun onFailed(errorCode: String?, errorMessage: String?) {
|
||||
Log.e("TAG","error $errorMessage")
|
||||
}
|
||||
}
|
||||
|
||||
pushService.register(applicationContext,callback)
|
||||
}
|
||||
|
||||
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
||||
GeneratedPluginRegistrant.registerWith(flutterEngine);
|
||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "starLockFlutterSend").setMethodCallHandler {
|
||||
|
||||
@ -1,72 +0,0 @@
|
||||
package com.skychip.lock
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.alibaba.sdk.android.push.MessageReceiver
|
||||
import com.alibaba.sdk.android.push.notification.CPushMessage
|
||||
|
||||
|
||||
class MyMessageReceiver : MessageReceiver() {
|
||||
override fun onNotification(
|
||||
context: Context?,
|
||||
title: String,
|
||||
summary: String,
|
||||
extraMap: Map<String?, String?>
|
||||
) {
|
||||
// TODO处理推送通知
|
||||
Log.e(
|
||||
"MyMessageReceiver",
|
||||
"Receive notification, title: $title, summary: $summary, extraMap: $extraMap"
|
||||
)
|
||||
}
|
||||
|
||||
override fun onMessage(context: Context?, cPushMessage: CPushMessage) {
|
||||
Log.e(
|
||||
"MyMessageReceiver",
|
||||
"onMessage, messageId: " + cPushMessage.getMessageId() + ", title: " + cPushMessage.getTitle() + ", content:" + cPushMessage.getContent()
|
||||
)
|
||||
}
|
||||
|
||||
override fun onNotificationOpened(context: Context?, title: String, summary: String, extraMap: String) {
|
||||
Log.e(
|
||||
"MyMessageReceiver",
|
||||
"onNotificationOpened, title: $title, summary: $summary, extraMap:$extraMap"
|
||||
)
|
||||
}
|
||||
|
||||
protected override fun onNotificationClickedWithNoAction(
|
||||
context: Context?,
|
||||
title: String,
|
||||
summary: String,
|
||||
extraMap: String
|
||||
) {
|
||||
Log.e(
|
||||
"MyMessageReceiver",
|
||||
"onNotificationClickedWithNoAction, title: $title, summary: $summary, extraMap:$extraMap"
|
||||
)
|
||||
}
|
||||
|
||||
protected override fun onNotificationReceivedInApp(
|
||||
context: Context?,
|
||||
title: String,
|
||||
summary: String,
|
||||
extraMap: Map<String?, String?>,
|
||||
openType: Int,
|
||||
openActivity: String,
|
||||
openUrl: String
|
||||
) {
|
||||
Log.e(
|
||||
"MyMessageReceiver",
|
||||
"onNotificationReceivedInApp, title: $title, summary: $summary, extraMap:$extraMap, openType:$openType, openActivity:$openActivity, openUrl:$openUrl"
|
||||
)
|
||||
}
|
||||
|
||||
protected override fun onNotificationRemoved(context: Context?, messageId: String?) {
|
||||
Log.e("MyMessageReceiver", "onNotificationRemoved")
|
||||
}
|
||||
|
||||
companion object {
|
||||
// 消息接收部分的LOG_TAG
|
||||
const val REC_TAG = "receiver"
|
||||
}
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import com.alibaba.sdk.android.push.AndroidPopupActivity
|
||||
|
||||
class PopupPushActivity : AndroidPopupActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
/**
|
||||
* 实现通知打开回调方法,获取通知相关信息
|
||||
* @param title 标题
|
||||
* @param summary 内容
|
||||
* @param extMap 额外参数
|
||||
*/
|
||||
override fun onSysNoticeOpened(title: String, summary: String, extMap: Map<String, String>) {
|
||||
Log.e(
|
||||
"PopupPushActivity",
|
||||
"OnMiPushSysNoticeOpened, title: $title, content: $summary, extMap: $extMap"
|
||||
) }
|
||||
|
||||
companion object {
|
||||
const val TAG = "PopupPushActivity"
|
||||
}
|
||||
}
|
||||
@ -4,16 +4,19 @@ buildscript {
|
||||
google()
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { // 添加Maven仓库地址
|
||||
url 'https://maven.aliyun.com/nexus/content/repositories/releases/'
|
||||
}
|
||||
// hms, 若不集成华为厂商通道,可直接跳过
|
||||
maven { url 'https://developer.huawei.com/repo/'}
|
||||
// fcm, 若不集成 FCM 通道,可直接跳过
|
||||
maven { url "https://maven.google.com" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
// 添加emas-services插件
|
||||
classpath 'com.aliyun.ams:emas-services:1.0.4'
|
||||
// fcm,若不集成 FCM 通道,可直接跳过
|
||||
classpath 'com.google.gms:google-services:4.3.8'
|
||||
// hms,若不集成华为厂商通道,可直接跳过
|
||||
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
|
||||
}
|
||||
|
||||
}
|
||||
@ -21,11 +24,11 @@ buildscript {
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
// mavenCentral()
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven { // 添加Maven仓库地址
|
||||
url 'https://maven.aliyun.com/nexus/content/repositories/releases/'
|
||||
}
|
||||
// 配置HMS Core SDK的Maven仓地址。
|
||||
maven {url 'https://developer.huawei.com/repo/'}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,6 +36,7 @@ end
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
source 'https://github.com/aliyun/aliyun-specs.git'
|
||||
pod 'AlicloudPush', '~> 1.9.9'
|
||||
pod 'JPush'
|
||||
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
|
||||
@ -5,23 +5,23 @@
|
||||
<key>config</key>
|
||||
<dict>
|
||||
<key>emas.appKey</key>
|
||||
<string>333904046</string>
|
||||
<string>334068745</string>
|
||||
<key>emas.appSecret</key>
|
||||
<string>3eead09a7fc7416cb4082319aa6f48c6</string>
|
||||
<string>bee9c200835e4951a85dc8709c319560</string>
|
||||
<key>emas.bundleId</key>
|
||||
<string>cn.star-lock.starLock</string>
|
||||
<key>hotfix.idSecret</key>
|
||||
<string>333904046-2</string>
|
||||
<string>334068745-2</string>
|
||||
<key>hotfix.rsaSecret</key>
|
||||
<string>MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCS0i6gEzmEoaXFe0gDcur1sdkE2ecWXRay3h+O11F0FmoNfQx+V4i+pt2se+KDAx/GQq8Axj4DnjzE4KT0TeVmrutI1FF4h2Tv5Ge9KT0yuCayiQPW5gkqTDxaehkRDyCzGkwaLkVslN2kFqammWsODTQw2a0/lziMrNpQU8bnjjYbKS1eIQUPM9s6smwN2A4RErAP7X1knsT1tCHoCgfgjZf1nddQSMw4vy9FBpKZDYD1gjdo5+U93VopVLpMqcbOVXbQeUwpArURNnY/dbSkrGsC2TXAfaYa+sVXPchy0pZ7C2wU2/6INkFBpw2QjFQ4uAcNXwoEn5x5iBw4VbnPAgMBAAECggEAfoowLT7kf+9iFIZgVrig0QlrZcb4aEnq2lafFFl3lnoLBX0VW37OGKNwwswzOX9jz1iBxEUYBb5H2ddT1Euev5Vaq/ZyEVOAJ1HQJzR3zlLw50c3y+uPUqlKCyDYod9L65FqrdXbd+4F6Pqsv0HTBtVSehfiPcBzuKrxrfHGqKKWx4C620SxPqtpNaYXaENyqfZ3qyKw+xtWGJtxjQ8DFkeWJ1C8O7ZxJ33SpwpEb9UIJpDtPcaKbwccLn/w5214kYAqE7m5aTmLUTFRYay2Hez1gPUKVirt/QDfEfHRv6xbv5jePl0snXWK0VwgoR3hLDuF9etM3UFLr40eQNICQQKBgQDCBjM7NvscgRCJ7E8vdcfxlebUhooZUewc9gBsTpPMcS8xZXP8desc1smZvokPtIKKwPdECw6rGf1a+sb6dnHMNjWBUbHTxWnYKqVlDDXJkgcSynK+74wRCfzmFamtQmJ1qVATHRVL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aiEdCW6VGSBSFIPQXtsLCE/51BrQoucGDt0S5ZtWn147Wd1v+OEB9rMOc1NbFvVL1+o0CgYEApnA58wOgtxJGggaa4LS6T+VTsx73mzz3YP8AAHsgePeFCqS/MdDwaoLlAKBRkDm07KkaRh0/Nofn3jSRs7zlFHSOUmhsAI0htEQx1x4f3MoBIuDtozv/eMT/XbGrNsP2i696TN39stnczrV3ZD7jzFvveEHRARaF4MvuLcRBrdQ=</string>
|
||||
<key>httpdns.accountId</key>
|
||||
<string>125761</string>
|
||||
<string>100674</string>
|
||||
<key>httpdns.secretKey</key>
|
||||
<string>f77f39c6f0e66d7c169aa7e8d87dfe13</string>
|
||||
<string>6cd4984095d53f6f311424cc9299257b</string>
|
||||
<key>appmonitor.tlog.rsaSecret</key>
|
||||
<string>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSlqdpwcdPniL1ahrYfTy47aD8Ay7D7qLyKO5QeXy64V+CQ0UvYwyTtfPRzvlXbwmc2ONjwKHq2B7SRhwHuBwURZNp5Iw1XaGCmqPPMOpL9UnYEIO90x3sFebIRHmXscyRVniGhmmdOXpVaP6BA3RWK1uwH/FBetzom6H+dcNMPQIDAQAB</string>
|
||||
<string>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCku9yUXBjd9m7V8fflC6XTwJEc8D8GSe5KzgXQZXk12S3KaZrx82Cu6/nOD7RNtZvsxrYd69bzkrG84tvIwwVSefWuPiDAiY2uiigpSXXda0FjQXZ0xHPJGcsrbI67y/2xFeK0pD9542Y4FBYPq6BcslAYFUVFD8bN+K/GBXkJRwIDAQAB</string>
|
||||
<key>appmonitor.rsaSecret</key>
|
||||
<string>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCSlqdpwcdPniL1ahrYfTy47aD8Ay7D7qLyKO5QeXy64V+CQ0UvYwyTtfPRzvlXbwmc2ONjwKHq2B7SRhwHuBwURZNp5Iw1XaGCmqPPMOpL9UnYEIO90x3sFebIRHmXscyRVniGhmmdOXpVaP6BA3RWK1uwH/FBetzom6H+dcNMPQIDAQAB</string>
|
||||
<string>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCku9yUXBjd9m7V8fflC6XTwJEc8D8GSe5KzgXQZXk12S3KaZrx82Cu6/nOD7RNtZvsxrYd69bzkrG84tvIwwVSefWuPiDAiY2uiigpSXXda0FjQXZ0xHPJGcsrbI67y/2xFeK0pD9542Y4FBYPq6BcslAYFUVFD8bN+K/GBXkJRwIDAQAB</string>
|
||||
</dict>
|
||||
<key>services</key>
|
||||
<dict>
|
||||
@ -65,7 +65,7 @@
|
||||
<key>status</key>
|
||||
<integer>1</integer>
|
||||
<key>version</key>
|
||||
<string>1.2.0</string>
|
||||
<string>1.2.0-no-memory</string>
|
||||
</dict>
|
||||
<key>man_service</key>
|
||||
<dict>
|
||||
@ -79,7 +79,7 @@
|
||||
<key>status</key>
|
||||
<integer>1</integer>
|
||||
<key>version</key>
|
||||
<string>2.0.4</string>
|
||||
<string>1.9.9.1-notnull</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
||||
@ -9,9 +9,14 @@
|
||||
#import <AudioToolbox/AudioToolbox.h>
|
||||
|
||||
#import <CloudPushSDK/CloudPushSDK.h>
|
||||
#import "JPUSHService.h"
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
|
||||
#import "JPUSHService.h"
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
|
||||
|
||||
@interface AppDelegate : FlutterAppDelegate <UIApplicationDelegate>
|
||||
@interface AppDelegate : FlutterAppDelegate <UIApplicationDelegate, JPUSHRegisterDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
|
||||
|
||||
|
||||
@interface AppDelegate()
|
||||
|
||||
@end
|
||||
@ -18,6 +19,18 @@
|
||||
- (BOOL)application:(UIApplication *)application
|
||||
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
|
||||
// //【注册通知】通知回调代理(可选)
|
||||
// JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
|
||||
// entity.types = JPAuthorizationOptionAlert|JPAuthorizationOptionBadge|JPAuthorizationOptionSound|JPAuthorizationOptionProvidesAppNotificationSettings;
|
||||
// [JPUSHService registerForRemoteNotificationConfig:entity delegate:self];
|
||||
//
|
||||
// //【初始化sdk】
|
||||
// // notice: 2.1.5 版本的 SDK 新增的注册方法,改成可上报 IDFA,如果没有使用 IDFA 直接传 nil
|
||||
// [JPUSHService setupWithOption:launchOptions appKey:@"7ff37d174c1a568a89e98dad"
|
||||
// channel:@"flutter_channel"
|
||||
// apsForProduction:NO
|
||||
// advertisingIdentifier:nil];
|
||||
|
||||
// [self initCloudPush];
|
||||
// [CloudPushSDK sendNotificationAck:launchOptions];
|
||||
XSFlutterManager *VC = [[XSFlutterManager alloc] init];
|
||||
@ -29,7 +42,7 @@
|
||||
|
||||
- (void)initCloudPush {
|
||||
// SDK初始化
|
||||
[CloudPushSDK asyncInit:@"333904046" appSecret:@"3eead09a7fc7416cb4082319aa6f48c6" callback:^(CloudPushCallbackResult *res) {
|
||||
[CloudPushSDK asyncInit:@"334068745" appSecret:@"bee9c200835e4951a85dc8709c319560" callback:^(CloudPushCallbackResult *res) {
|
||||
if (res.success) {
|
||||
NSLog(@"Push SDK init success, deviceId: %@.", [CloudPushSDK getDeviceId]);
|
||||
} else {
|
||||
@ -62,13 +75,16 @@
|
||||
* 苹果推送注册成功回调,将苹果返回的deviceToken上传到CloudPush服务器
|
||||
*/
|
||||
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
|
||||
[CloudPushSDK registerDevice:deviceToken withCallback:^(CloudPushCallbackResult *res) {
|
||||
if (res.success) {
|
||||
NSLog(@"Register deviceToken success.");
|
||||
} else {
|
||||
NSLog(@"Register deviceToken failed, error: %@", res.error);
|
||||
}
|
||||
}];
|
||||
// [CloudPushSDK registerDevice:deviceToken withCallback:^(CloudPushCallbackResult *res) {
|
||||
// if (res.success) {
|
||||
// NSLog(@"Register deviceToken success.");
|
||||
// } else {
|
||||
// NSLog(@"Register deviceToken failed, error: %@", res.error);
|
||||
// }
|
||||
// }];
|
||||
//sdk注册DeviceToken
|
||||
[JPUSHService registerDeviceToken:deviceToken];
|
||||
|
||||
}
|
||||
/*
|
||||
* 苹果推送注册失败回调
|
||||
@ -98,12 +114,6 @@
|
||||
NSLog(@"Receive message title: %@, content: %@.", title, body);
|
||||
}
|
||||
|
||||
//- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
// // 点击通知将App从关闭状态启动时,将通知打开回执上报
|
||||
// // [CloudPushSDK handleLaunching:launchOptions];(Deprecated from v1.8.1)
|
||||
// [CloudPushSDK sendNotificationAck:launchOptions];
|
||||
// return YES;
|
||||
//}
|
||||
/*
|
||||
* App处于启动状态时,通知打开回调
|
||||
*/
|
||||
|
||||
@ -1,82 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>$(BUNDLE_DISPLAY_NAME)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(BUNDLE_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>NSBluetoothAlwaysUsageDescription</key>
|
||||
<string>The app uses bluetooth to find, connect and transfer data between different devices</string>
|
||||
<key>NSBluetoothPeripheralUsageDescription</key>
|
||||
<string>The app uses bluetooth to find, connect and transfer data between different devices</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>照片</string>
|
||||
<key>NSContactsUsageDescription</key>
|
||||
<string>Reason we need access to the contact list</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
<string>应用在后台的时候可以搜到更新的位置信息</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>应用在前台的时候可以搜到更新的位置信息</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>应用请求麦克风用来通话</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>用于相册</string>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict/>
|
||||
</dict>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>remote-notification</string>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>io.flutter.embedded_views_preview</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
<dict>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>$(BUNDLE_DISPLAY_NAME)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(BUNDLE_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>NSBluetoothAlwaysUsageDescription</key>
|
||||
<string>The app uses bluetooth to find, connect and transfer data between different devices</string>
|
||||
<key>NSBluetoothPeripheralUsageDescription</key>
|
||||
<string>The app uses bluetooth to find, connect and transfer data between different devices</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>应用请求相机,以便于拍摄照片,用于头像上传</string>
|
||||
<key>NSContactsUsageDescription</key>
|
||||
<string>Reason we need access to the contact list</string>
|
||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
|
||||
<key>NSLocationAlwaysUsageDescription</key>
|
||||
<string>应用在后台的时候可以搜到更新的位置信息</string>
|
||||
<key>NSLocationWhenInUseUsageDescription</key>
|
||||
<string>应用在前台的时候可以搜到更新的位置信息</string>
|
||||
<key>NSMicrophoneUsageDescription</key>
|
||||
<string>应用请求麦克风用来通话</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string>应用请求相册用于头像上传</string>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict/>
|
||||
</dict>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>remote-notification</string>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
<key>NSUserTrackingUsageDescription</key>
|
||||
<string>需要访问您的隐私数据,以提供个性化的体验。</string>
|
||||
<key>io.flutter.embedded_views_preview</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@ -1,15 +1,17 @@
|
||||
import 'package:aliyun_push/aliyun_push.dart';
|
||||
// import 'package:aliyun_push/aliyun_push.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:jpush_flutter/jpush_flutter.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/tools/app_manager.dart';
|
||||
import 'package:star_lock/tools/bindings/app_binding.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:star_lock/tools/xs_aliyunPush.dart';
|
||||
// import 'package:star_lock/tools/storage.dart';
|
||||
// import 'package:star_lock/tools/xs_aliyunPush.dart';
|
||||
|
||||
import 'package:star_lock/translations/app_dept.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
@ -30,6 +32,8 @@ class MyApp extends StatefulWidget {
|
||||
// final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>();
|
||||
|
||||
class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
|
||||
final JPush jpush = JPush();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ScreenUtilInit(
|
||||
@ -101,7 +105,8 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
initFlutterAliyunPush();
|
||||
|
||||
initJPushService();
|
||||
}
|
||||
|
||||
@override
|
||||
@ -109,6 +114,43 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> initJPushService() async {
|
||||
final data = await Storage.getString(saveUserLoginData);
|
||||
if (data != null && data.isNotEmpty) {
|
||||
jpush.setup(
|
||||
appKey: "7ff37d174c1a568a89e98dad",
|
||||
channel: "flutter_channel",
|
||||
production: false,
|
||||
debug: true,
|
||||
);
|
||||
|
||||
jpush.addEventHandler(
|
||||
// 接收通知回调方法。
|
||||
onReceiveNotification: (Map<String, dynamic> message) async {
|
||||
print("flutter onReceiveNotification: $message");
|
||||
},
|
||||
// 点击通知回调方法。
|
||||
onOpenNotification: (Map<String, dynamic> message) async {
|
||||
print("flutter onOpenNotification: $message");
|
||||
},
|
||||
// 接收自定义消息回调方法。
|
||||
onReceiveMessage: (Map<String, dynamic> message) async {
|
||||
print("flutter onReceiveMessage: $message");
|
||||
},
|
||||
);
|
||||
|
||||
jpush.applyPushAuthority(
|
||||
const NotificationSettingsIOS(sound: true, alert: true, badge: true));
|
||||
// jpush.setChannelAndSound(
|
||||
// channel: "flutter_channel", channelID: "115700", sound: "default");
|
||||
|
||||
// Platform messages may fail, so we use a try/catch PlatformException.
|
||||
jpush.getRegistrationID().then((rid) {
|
||||
print("flutter get registration id : $rid");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void openBlueScan() {
|
||||
@ -146,26 +188,3 @@ Future<bool> getMicrophonePermission() async {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//初始化阿里云推送
|
||||
Future<void> initFlutterAliyunPush() async {
|
||||
final data = await Storage.getString(saveUserLoginData);
|
||||
if (data != null) {
|
||||
final aliyunPush = AliyunPush();
|
||||
XSAliyunPushProvider().init(aliyunPush);
|
||||
XSAliyunPushProvider().initAliyunPush();
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
XSAliyunPushProvider().initAliyunThirdPush();
|
||||
}
|
||||
|
||||
//暂使用DeviceID推送
|
||||
aliyunPush.getDeviceId().then((deviceId) async {
|
||||
print('得到的DeviceId$deviceId');
|
||||
if (deviceId.isNotEmpty) {
|
||||
XSAliyunPushProvider()
|
||||
.pushBindDeviceID(deviceId, Platform.isAndroid ? 10 : 20);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ import 'package:star_lock/login/login/starLock_login_page.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../blue/blue_manage.dart';
|
||||
import '../main/lockMian/lockMain/lockMain_page.dart';
|
||||
|
||||
class StarLockApplication extends StatefulWidget {
|
||||
@ -14,8 +13,6 @@ class StarLockApplication extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
@ -27,7 +24,8 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
Widget build(BuildContext context) {
|
||||
print("StarLockApplication build");
|
||||
AppFirstEnterHandle().getAppFirstEnter(context, isAgreePrivacy);
|
||||
AppFirstEnterHandle().getAppFirstEnter(context, isShowUpdateVersion);
|
||||
getAgreePrivacyShowUpdate();
|
||||
|
||||
return FutureBuilder<bool>(
|
||||
future: getLoginStatus(),
|
||||
builder: (context, snapshot) {
|
||||
@ -57,4 +55,11 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Future<void> getAgreePrivacyShowUpdate() async {
|
||||
final data = await Storage.getString(isAgreePrivacy);
|
||||
if (data == isAgreePrivacy) {
|
||||
AppFirstEnterHandle().getAppFirstEnter(context, isShowUpdateVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,20 +1,14 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../network/api_repository.dart';
|
||||
import '../translations/trans_lib.dart';
|
||||
import '../versionUndate/versionUndateTool.dart';
|
||||
import '../versionUndate/versionUndate_entity.dart';
|
||||
|
||||
class AppFirstEnterHandle {
|
||||
Future getAppFirstEnter(BuildContext widgetContext, String flagStr) async {
|
||||
@ -116,6 +110,7 @@ class AppFirstEnterHandle {
|
||||
onPressed: () {
|
||||
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
||||
Navigator.of(context).pop();
|
||||
getAppFirstEnter(context, isShowUpdateVersion);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/*
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:aliyun_push/aliyun_push.dart';
|
||||
@ -133,3 +134,4 @@ class XSAliyunPushProvider {
|
||||
if (entity.errorCode!.codeIsSuccessful) {}
|
||||
}
|
||||
}
|
||||
*/
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
@ -17,7 +16,7 @@ import 'versionUndate_entity.dart';
|
||||
class VersionUndateTool {
|
||||
static VersionUndateTool? _manager;
|
||||
|
||||
VersionUndateTool._init(){
|
||||
VersionUndateTool._init() {
|
||||
// _initLoadUpdateVersionData();
|
||||
}
|
||||
|
||||
@ -32,7 +31,6 @@ class VersionUndateTool {
|
||||
VersionUndateTool? get manager => shareManager();
|
||||
|
||||
void _initLoadUpdateVersionData() {
|
||||
|
||||
getVersionData();
|
||||
}
|
||||
|
||||
@ -68,7 +66,7 @@ class VersionUndateTool {
|
||||
currentVersion: version,
|
||||
);
|
||||
if (entity.errorCode! == 0) {
|
||||
if(entity.data!.isUpdate! == 1){
|
||||
if (entity.data!.isUpdate! == 1) {
|
||||
showUpdateAlertDialog(entity);
|
||||
}
|
||||
}
|
||||
@ -82,52 +80,60 @@ class VersionUndateTool {
|
||||
content: Column(
|
||||
children: [
|
||||
Container(
|
||||
// color: AppColors.mainColor,
|
||||
// color: AppColors.mainColor,
|
||||
alignment: Alignment.topCenter,
|
||||
height: 50.h,
|
||||
child: Text('版本更新', style: TextStyle(fontSize: 28.sp, color: Colors.blue),)
|
||||
),
|
||||
child: Text(
|
||||
'版本更新',
|
||||
style: TextStyle(fontSize: 28.sp, color: Colors.blue),
|
||||
)),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left:20.w, right: 20.w, top: 10.h),
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w, top: 10.h),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(versionUndateEntity.data!.description!, textAlign:TextAlign.start, style: TextStyle(fontSize: 20.sp))
|
||||
),
|
||||
child: Text(versionUndateEntity.data!.description!,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontSize: 20.sp))),
|
||||
],
|
||||
),
|
||||
actions: versionUndateEntity.data!.isForceUpdate == 0 ?
|
||||
[
|
||||
CupertinoDialogAction(
|
||||
child: Text("下次再说"),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
Storage.setString(isShowUpdateVersion, isShowUpdateVersion);
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||
onPressed: () async {
|
||||
if (await canLaunch(versionUndateEntity.data!.appDownloadUrl!)) {
|
||||
await launch(versionUndateEntity.data!.appDownloadUrl!);
|
||||
} else {
|
||||
throw 'Could not launch ${versionUndateEntity.data!.appDownloadUrl}';
|
||||
}
|
||||
},
|
||||
),
|
||||
]:
|
||||
[
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||
onPressed: () async {
|
||||
if (await canLaunch(versionUndateEntity.data!.appDownloadUrl!)) {
|
||||
await launch(versionUndateEntity.data!.appDownloadUrl!);
|
||||
} else {
|
||||
throw 'Could not launch ${versionUndateEntity.data!.appDownloadUrl}';
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
actions: versionUndateEntity.data!.isForceUpdate == 0
|
||||
? [
|
||||
CupertinoDialogAction(
|
||||
child: Text("下次再说"),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
Storage.setString(
|
||||
isShowUpdateVersion, isShowUpdateVersion);
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||
onPressed: () async {
|
||||
if (await canLaunchUrl(Uri.parse(
|
||||
versionUndateEntity.data!.appDownloadUrl!))) {
|
||||
await launchUrl(Uri.parse(
|
||||
versionUndateEntity.data!.appDownloadUrl!));
|
||||
} else {
|
||||
throw 'Could not launch ${versionUndateEntity.data!.appDownloadUrl}';
|
||||
}
|
||||
},
|
||||
),
|
||||
]
|
||||
: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||
onPressed: () async {
|
||||
if (await canLaunchUrl(Uri.parse(
|
||||
versionUndateEntity.data!.appDownloadUrl!))) {
|
||||
await launchUrl(Uri.parse(
|
||||
versionUndateEntity.data!.appDownloadUrl!));
|
||||
} else {
|
||||
throw 'Could not launch ${versionUndateEntity.data!.appDownloadUrl}';
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,8 +17,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
|
||||
version: 1.0.15+2024031501
|
||||
# 版本说明:
|
||||
# 1.0.18+2024032001:修复同意隐私政策前获取SN
|
||||
version: 1.0.18+2024032001
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
@ -113,7 +114,7 @@ dependencies:
|
||||
#网络图片缓存
|
||||
cached_network_image: ^3.2.0
|
||||
webview_flutter: ^4.2.3
|
||||
aliyun_push: ^0.1.6
|
||||
jpush_flutter: ^2.5.1
|
||||
|
||||
#视频播放器
|
||||
video_player: ^2.7.1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user