version:1.0.0
update:增加混淆,优化其他包名 bugfixes:
This commit is contained in:
1
app/.gitignore
vendored
1
app/.gitignore
vendored
@@ -1 +1,2 @@
|
||||
/build
|
||||
/proguardbuild/
|
||||
|
||||
@@ -22,8 +22,8 @@ android {
|
||||
|
||||
ndk {
|
||||
//根据需要 自行选择添加的对应cpu类型的.so库。
|
||||
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a'
|
||||
// 还可以添加 'x86', 'x86_64', 'mips', 'mips64'
|
||||
abiFilters 'arm64-v8a'
|
||||
// 还可以添加 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64'
|
||||
}
|
||||
|
||||
manifestPlaceholders = [
|
||||
@@ -62,11 +62,15 @@ android {
|
||||
|
||||
buildTypes {
|
||||
debug {
|
||||
// 显示Log
|
||||
versionNameSuffix "-debug"
|
||||
minifyEnabled false
|
||||
//Zipalign优化
|
||||
zipAlignEnabled true
|
||||
shrinkResources true
|
||||
//混淆
|
||||
minifyEnabled true
|
||||
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
//签名
|
||||
signingConfig signingConfigs.tuixin
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
@@ -79,16 +83,16 @@ android {
|
||||
}
|
||||
|
||||
release {
|
||||
// 不显示Log
|
||||
//混淆
|
||||
minifyEnabled false
|
||||
//Zipalign优化
|
||||
zipAlignEnabled true
|
||||
shrinkResources true
|
||||
//混淆
|
||||
minifyEnabled true
|
||||
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
//签名
|
||||
signingConfig signingConfigs.tuixin
|
||||
// 将release版本的包名重命名,加上版本及日期
|
||||
//将release版本的包名重命名,加上版本及日期
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
def outputFile = ""
|
||||
|
||||
432
app/proguard-rules.pro
vendored
432
app/proguard-rules.pro
vendored
@@ -19,3 +19,435 @@
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
|
||||
# ------------------------------基本指令区---------------------------------
|
||||
-optimizationpasses 5 #指定压缩级别
|
||||
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* #混淆时采用的算法
|
||||
-verbose #打印混淆的详细信息
|
||||
-dontoptimize #关闭优化
|
||||
-keepattributes *Annotation* #保留注解中的参数
|
||||
-keepattributes *Annotation*,InnerClasses # 保持注解
|
||||
-keepattributes Signature # 避免混淆泛型, 这在JSON实体映射时非常重要
|
||||
-ignorewarnings # 屏蔽警告
|
||||
-keepattributes SourceFile,LineNumberTable # 抛出异常时保留代码行号
|
||||
#混淆时不使用大小写混合,混淆后的类名为小写(大小写混淆容易导致class文件相互覆盖)
|
||||
-dontusemixedcaseclassnames
|
||||
|
||||
#未混淆的类和成员
|
||||
-printseeds proguardbuild/print_seeds.txt
|
||||
#列出从 apk 中删除的代码
|
||||
-printusage proguardbuild/print_unused.txt
|
||||
#混淆前后的映射,生成映射文件
|
||||
-printmapping proguardbuild/print_mapping.txt
|
||||
|
||||
# 指定一个文本文件,其中所有有效字词都用作混淆字段和方法名称。
|
||||
# 默认情况下,诸如“a”,“b”等短名称用作混淆名称。
|
||||
# 使用模糊字典,您可以指定保留关键字的列表,或具有外来字符的标识符,
|
||||
# 例如: 忽略空格,标点符号,重复字和#符号后的注释。
|
||||
# 注意,模糊字典几乎不改善混淆。 有些编译器可以自动替换它们,并且通过使用更简单的名称再次混淆,可以很简单地撤消该效果。
|
||||
# 最有用的是指定类文件中通常已经存在的字符串(例如'Code'),从而减少类文件的大小。 仅适用于混淆处理。
|
||||
#-obfuscationdictionary proguardbuild/pro_package.txt
|
||||
|
||||
# 指定一个文本文件,其中所有有效词都用作混淆类名。 与-obfuscationdictionary类似。 仅适用于混淆处理。
|
||||
#-classobfuscationdictionary proguardbuild/pro_class.txt
|
||||
|
||||
# 指定一个文本文件,其中所有有效词都用作混淆包名称。与-obfuscationdictionary类似。 仅适用于混淆处理。
|
||||
#-packageobfuscationdictionary proguardbuild/pro_func.txt
|
||||
|
||||
# -------------------------------基本指令区--------------------------------
|
||||
|
||||
|
||||
#---------------------------------默认保留区---------------------------------
|
||||
#继承activity,application,service,broadcastReceiver,contentprovider....不进行混淆
|
||||
-keep public class * extends android.app.Activity
|
||||
-keep public class * extends androidx.fragment.app.Fragment
|
||||
-keep public class * extends android.app.Application
|
||||
-keep public class * extends android.app.Service
|
||||
-keep public class * extends android.content.BroadcastReceiver
|
||||
-keep public class * extends android.content.ContentProvider
|
||||
-keep public class * extends android.app.backup.BackupAgentHelper
|
||||
-keep public class * extends android.preference.Preference
|
||||
-keep public class * extends android.view.View
|
||||
-keep class android.support.** {*;}
|
||||
|
||||
# androidx 混淆
|
||||
-keep class com.google.android.material.** {*;}
|
||||
-keep class androidx.** {*;}
|
||||
-keep public class * extends androidx.**
|
||||
-keep interface androidx.** {*;}
|
||||
-keep class * implements androidx.** {*;}
|
||||
-dontwarn com.google.android.material.**
|
||||
-dontnote com.google.android.material.**
|
||||
-dontwarn androidx.**
|
||||
-printconfiguration
|
||||
-keep,allowobfuscation interface androidx.annotation.Keep
|
||||
-keep @androidx.annotation.Keep class *
|
||||
-keepclassmembers class * {@androidx.annotation.Keep *;}
|
||||
|
||||
#不混淆View中的set***() 和 get***()方法 以保证属性动画正常工作 某个类中的某个方法不混淆
|
||||
#自定义View的set get方法 和 构造方法不混淆
|
||||
-keep public class * extends android.view.View{
|
||||
*** get*();
|
||||
void set*(***);
|
||||
public <init>(android.content.Context);
|
||||
public <init>(android.content.Context, android.util.AttributeSet);
|
||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||||
}
|
||||
-keepclasseswithmembers class * {
|
||||
public <init>(android.content.Context, android.util.AttributeSet);
|
||||
public <init>(android.content.Context, android.util.AttributeSet, int);
|
||||
}
|
||||
#这个主要是在layout 中写的onclick方法android:onclick="onClick",不进行混淆
|
||||
-keepclassmembers class * extends android.app.Activity {
|
||||
public void *(android.view.View);
|
||||
}
|
||||
|
||||
#保持 Serializable 不被混淆
|
||||
-keepnames class * implements java.io.Serializable
|
||||
#实现Serializable接口的类重写父类方法保留
|
||||
-keepclassmembers class * implements java.io.Serializable {
|
||||
static final long serialVersionUID;
|
||||
private static final java.io.ObjectStreamField[] serialPersistentFields;
|
||||
private void writeObject(java.io.ObjectOutputStream);
|
||||
private void readObject(java.io.ObjectInputStream);
|
||||
java.lang.Object writeReplace();
|
||||
java.lang.Object readResolve();
|
||||
}
|
||||
# 保留R文件中所有静态字段,以保证正确找到每个资源的ID
|
||||
-keepclassmembers class **.R$* {
|
||||
public static <fields>;
|
||||
}
|
||||
|
||||
|
||||
-keepclassmembers class * {
|
||||
void *(*Event);
|
||||
}
|
||||
|
||||
#保留枚举类中的values和valueOf方法
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
#保留Parcelable实现类中的Creator字段,以保证Parcelable机制正常工作
|
||||
-keep class * implements android.os.Parcelable {
|
||||
public static final android.os.Parcelable$Creator *;
|
||||
}
|
||||
|
||||
#保持 Parcelable 不被混淆
|
||||
-keep class * implements android.os.Parcelable {
|
||||
public static final android.os.Parcelable$Creator *;
|
||||
}
|
||||
|
||||
#不混淆包含native方法的类的类名以及native方法名
|
||||
-keepclasseswithmembernames class * {
|
||||
native<methods>;
|
||||
}
|
||||
|
||||
#避免log打印输出
|
||||
-assumenosideeffects class android.util.Log {
|
||||
public static *** v(...);
|
||||
public static *** d(...);
|
||||
public static *** i(...);
|
||||
public static *** w(...);
|
||||
}
|
||||
#对含有反射类的处理
|
||||
#--------------------------------默认保留区--------------------------------------------
|
||||
|
||||
|
||||
|
||||
#----------------------------- WebView(项目中没有可以忽略) -----------------------------
|
||||
#webView需要进行特殊处理
|
||||
# WebView
|
||||
-dontwarn android.webkit.WebView
|
||||
-dontwarn android.net.http.SslError
|
||||
-dontwarn android.webkit.WebViewClient
|
||||
-keep public class android.webkit.WebView
|
||||
-keep public class android.net.http.SslError
|
||||
-keep public class android.webkit.WebViewClient
|
||||
#在app中与HTML5的JavaScript的交互进行特殊处理
|
||||
#我们需要确保这些js要调用的原生方法不能够被混淆,于是我们需要做如下处理:
|
||||
-keepclassmembers class com.deepocean.tplh5.helper.JsInterfaceHelper {
|
||||
<methods>;
|
||||
}
|
||||
#----------------------------- WebView(项目中没有可以忽略) -----------------------------
|
||||
|
||||
|
||||
#----------------------------- 实体类不可混淆 ------------------------------------------
|
||||
#添加实体类混淆规则
|
||||
# Application classes that will be serialized/deserialized over Gson
|
||||
-keep class **.entity.** { *; }
|
||||
-keep class **.bean.** { *; }
|
||||
#----------------------------- 实体类不可混淆 ------------------------------------------
|
||||
|
||||
-dontwarn com.xxpatx.os.bean.**
|
||||
-keep class com.xxpatx.os.bean.**{*;}
|
||||
|
||||
-keep class com.xxpatx.os.utils.AppUsedTimeUtils { *; }
|
||||
-keep class com.xxpatx.os.utils.AppUsedTimeUtils$AppTimeinfo { *; }
|
||||
-keepclassmembers class com.xxpatx.os.utils.AppUsedTimeUtils.AppTimeinfo {
|
||||
<fields>;
|
||||
<methods>;
|
||||
}
|
||||
|
||||
#----------------------------- 第三方类库 ------------------------------------------
|
||||
#添加第三方类库的混淆规则
|
||||
#Adjust sdk
|
||||
-keep class com.adjust.sdk.**{ *; }
|
||||
-keep class com.google.android.gms.common.ConnectionResult {
|
||||
int SUCCESS;
|
||||
}
|
||||
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
|
||||
com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
|
||||
}
|
||||
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
|
||||
java.lang.String getId();
|
||||
boolean isLimitAdTrackingEnabled();
|
||||
}
|
||||
-keep public class com.android.installreferrer.**{ *; }
|
||||
# OkHttp3 去掉缺失类警告
|
||||
-dontwarn org.bouncycastle.**
|
||||
-dontwarn org.conscrypt.**
|
||||
-dontwarn org.openjsse.javax.net.ssl.**
|
||||
-dontwarn org.openjsse.net.ssl.**
|
||||
#----------------------------- 第三方类库 ------------------------------------------
|
||||
|
||||
#Aria
|
||||
-dontwarn com.arialyy.aria.**
|
||||
-keep class com.arialyy.aria.**{*;}
|
||||
|
||||
#QWeather
|
||||
-dontwarn com.qweather.sdk.**
|
||||
-keep class com.qweather.sdk.**{*;}
|
||||
|
||||
#NiceImageView
|
||||
-dontwarn com.shehuan.niv.**
|
||||
-keep class com.shehuan.niv.**{*;}
|
||||
|
||||
#verification-view
|
||||
-dontwarn com.tuo.customview.**
|
||||
-keep class com.tuo.customview.**{*;}
|
||||
|
||||
#disklrucache
|
||||
-dontwarn com.jakewharton.disklrucache.**
|
||||
-keep class com.jakewharton.disklrucache.**{*;}
|
||||
|
||||
#glide
|
||||
-keep public class * implements com.bumptech.glide.module.GlideModule
|
||||
-keep public class * extends com.bumptech.glide.module.AppGlideModule
|
||||
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {**[] $VALUES; public *;}
|
||||
#target<27
|
||||
-dontwarn com.bumptech.glide.load.resource.bitmap.VideoDecoder
|
||||
# for DexGuard only
|
||||
#-keepresourcexmlelements manifest/application/meta-data@value=GlideModule
|
||||
|
||||
#-------------- okhttp3 start-------------
|
||||
# OkHttp3
|
||||
# https://github.com/square/okhttp
|
||||
# okhttp
|
||||
-keepattributes Signature
|
||||
-keepattributes *Annotation*
|
||||
-keep class com.squareup.okhttp.* { *; }
|
||||
-keep interface com.squareup.okhttp.** { *; }
|
||||
-dontwarn com.squareup.okhttp.**
|
||||
|
||||
# okhttp 3
|
||||
-keepattributes Signature
|
||||
-keepattributes *Annotation*
|
||||
-keep class okhttp3.** { *; }
|
||||
-keep interface okhttp3.** { *; }
|
||||
-dontwarn okhttp3.**
|
||||
|
||||
# Okio
|
||||
-dontwarn com.squareup.**
|
||||
-dontwarn okio.**
|
||||
-keep public class org.codehaus.* { *; }
|
||||
-keep public class java.nio.* { *; }
|
||||
#----------okhttp end--------------
|
||||
|
||||
## ---------Retrofit混淆方法---------------
|
||||
-dontwarn javax.annotation.**
|
||||
-dontwarn javax.inject.**
|
||||
# OkHttp3
|
||||
-dontwarn okhttp3.logging.**
|
||||
-keep class okhttp3.internal.**{*;}
|
||||
-dontwarn okio.**
|
||||
# Retrofit
|
||||
-dontwarn retrofit2.**
|
||||
-keep class retrofit2.** { *; }
|
||||
-keepattributes Signature
|
||||
-keepattributes Exceptions
|
||||
# RxJava RxAndroid
|
||||
-dontwarn sun.misc.**
|
||||
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
|
||||
long producerIndex;
|
||||
long consumerIndex;
|
||||
}
|
||||
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
|
||||
rx.internal.util.atomic.LinkedQueueNode producerNode;
|
||||
}
|
||||
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
|
||||
rx.internal.util.atomic.LinkedQueueNode consumerNode;
|
||||
}
|
||||
|
||||
# Gson
|
||||
-keep class com.google.gson.stream.** { *; }
|
||||
-keepattributes EnclosingMethod
|
||||
|
||||
# Gson
|
||||
-keep class com.demo.demo1.service.bean.**{*;} # 自定义数据模型的bean目录
|
||||
|
||||
# zxing
|
||||
-dontwarn com.google.zxing.**
|
||||
-keep class com.google.zxing.** { *; }
|
||||
|
||||
# rxlifecycle
|
||||
-dontwarn com.trello.rxlifecycle4.**
|
||||
-keep class com.trello.rxlifecycle4.** { *; }
|
||||
-dontwarn com.trello.lifecycle4.**
|
||||
-keep class com.trello.lifecycle4.** { *; }
|
||||
|
||||
# rxbinding4
|
||||
-dontwarn com.jakewharton.rxbinding4.**
|
||||
-keep class com.jakewharton.rxbinding4.** { *; }
|
||||
|
||||
# live-event-bus-x
|
||||
-dontwarn com.jeremyliao.liveeventbus.**
|
||||
-keep class com.jeremyliao.liveeventbus.** { *; }
|
||||
-keep class android.arch.lifecycle.** { *; }
|
||||
-keep class android.arch.core.** { *; }
|
||||
|
||||
# facebook rebound
|
||||
-dontwarn com.facebook.rebound.**
|
||||
-keep class com.facebook.rebound.** { *; }
|
||||
|
||||
#amap start
|
||||
# 3D 地图 V5.0.0之前:
|
||||
-keep class com.amap.api.maps.**{*;}
|
||||
-keep class com.autonavi.amap.mapcore.*{*;}
|
||||
-keep class com.amap.api.trace.**{*;}
|
||||
|
||||
# 3D 地图 V5.0.0之后:
|
||||
-keep class com.amap.api.maps.**{*;}
|
||||
-keep class com.autonavi.**{*;}
|
||||
-keep class com.amap.api.trace.**{*;}
|
||||
|
||||
# 定位
|
||||
-keep class com.amap.api.location.**{*;}
|
||||
-keep class com.amap.api.fence.**{*;}
|
||||
-keep class com.loc.**{*;}
|
||||
-keep class com.autonavi.aps.amapapi.model.**{*;}
|
||||
|
||||
# 搜索
|
||||
-keep class com.amap.api.services.**{*;}
|
||||
|
||||
# 2D地图
|
||||
-keep class com.amap.api.maps2d.**{*;}
|
||||
-keep class com.amap.api.mapcore2d.**{*;}
|
||||
|
||||
# 导航
|
||||
-keep class com.amap.api.navi.**{*;}
|
||||
-keep class com.autonavi.**{*;}
|
||||
#amap end
|
||||
|
||||
# mmkv
|
||||
# Keep all native methods, their classes and any classes in their descriptors
|
||||
-keepclasseswithmembers,includedescriptorclasses class com.tencent.mmkv.** {
|
||||
native <methods>;
|
||||
long nativeHandle;
|
||||
private static *** onMMKVCRCCheckFail(***);
|
||||
private static *** onMMKVFileLengthError(***);
|
||||
private static *** mmkvLogImp(...);
|
||||
private static *** onContentChangedByOuterProcess(***);
|
||||
}
|
||||
|
||||
# bugly
|
||||
-dontwarn com.tencent.bugly.**
|
||||
-keep class com.tencent.bugly.**{*;}
|
||||
|
||||
# xcrash
|
||||
-dontwarn xcrash.**
|
||||
-keep class xcrash.**{*;}
|
||||
|
||||
# aliyun push
|
||||
-keepclasseswithmembernames class ** {
|
||||
native <methods>;
|
||||
}
|
||||
-keepattributes Signature
|
||||
-keep class sun.misc.Unsafe { *; }
|
||||
-keep class com.taobao.** {*;}
|
||||
-keep class com.alibaba.** {*;}
|
||||
-keep class com.alipay.** {*;}
|
||||
-keep class com.ut.** {*;}
|
||||
-keep class com.ta.** {*;}
|
||||
-keep class anet.**{*;}
|
||||
-keep class anetwork.**{*;}
|
||||
-keep class org.android.spdy.**{*;}
|
||||
-keep class org.android.agoo.**{*;}
|
||||
-keep class android.os.**{*;}
|
||||
-keep class org.json.**{*;}
|
||||
-dontwarn com.taobao.**
|
||||
-dontwarn com.alibaba.**
|
||||
-dontwarn com.alipay.**
|
||||
-dontwarn anet.**
|
||||
-dontwarn org.android.spdy.**
|
||||
-dontwarn org.android.agoo.**
|
||||
-dontwarn anetwork.**
|
||||
-dontwarn com.ut.**
|
||||
-dontwarn com.ta.**
|
||||
|
||||
# UltimateBarX
|
||||
-keep class com.zackratos.ultimatebarx.ultimatebarx.** { *; }
|
||||
-keep class * extends androidx.fragment.app.Fragment { *; }
|
||||
|
||||
# MagicIndicator
|
||||
-dontwarn net.lucode.hackware.**
|
||||
-keep class net.lucode.hackware.**{*;}
|
||||
|
||||
# circleprogressview
|
||||
-dontwarn com.king.view.circleprogressview.**
|
||||
-keep class com.king.view.circleprogressview.**{*;}
|
||||
|
||||
# jiaozivideoplayer
|
||||
-keep public class cn.jzvd.JZMediaSystem {*; }
|
||||
-keep public class cn.jzvd.demo.CustomMedia.CustomMedia {*; }
|
||||
-keep public class cn.jzvd.demo.CustomMedia.JZMediaIjk {*; }
|
||||
-keep public class cn.jzvd.demo.CustomMedia.JZMediaSystemAssertFolder {*; }
|
||||
|
||||
-keep class tv.danmaku.ijk.media.player.** {*; }
|
||||
-dontwarn tv.danmaku.ijk.media.player.*
|
||||
-keep interface tv.danmaku.ijk.media.player.** { *; }
|
||||
|
||||
# FFmpegMediaMetadataRetriever
|
||||
-dontwarn wseemann.media.**
|
||||
-keep class wseemann.media.**{*;}
|
||||
|
||||
# pictureselector start
|
||||
-keep class com.luck.picture.lib.** { *; }
|
||||
#// use Camerax
|
||||
-keep class com.luck.lib.camerax.** { *; }
|
||||
#// use uCrop
|
||||
-dontwarn com.yalantis.ucrop**
|
||||
-keep class com.yalantis.ucrop** { *; }
|
||||
-keep interface com.yalantis.ucrop** { *; }
|
||||
# pictureselector end
|
||||
|
||||
# FlycoTabLayout
|
||||
-dontwarn com.flyco.tablayout.**
|
||||
-keep class com.flyco.tablayout.**{ *; }
|
||||
|
||||
# Android-PickerView
|
||||
-dontwarn com.bigkoo.pickerview.**
|
||||
-keep class com.bigkoo.pickerview.**{ *; }
|
||||
|
||||
# LoadingDialog
|
||||
-dontwarn com.xiasuhuei321.loadingdialog.**
|
||||
-keep class com.xiasuhuei321.loadingdialog.**{ *; }
|
||||
|
||||
# XXPermissions
|
||||
-keep class com.hjq.permissions.** {*;}
|
||||
|
||||
# Toaster
|
||||
-keep class com.hjq.toast.** {*;}
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, Acti
|
||||
|
||||
//发送紧急广播
|
||||
Intent bootIntent = new Intent(BootReceiver.SOS);
|
||||
bootIntent.setComponent(new ComponentName("com.uiuios.sn", "com.uiuios.sn.receiver.BootReceiver"));
|
||||
bootIntent.setComponent(new ComponentName("com.xxpatx.sn", "com.xxpatx.sn.receiver.BootReceiver"));
|
||||
sendBroadcast(bootIntent);
|
||||
AmapManager.getInstance().startLocation();
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, PhoneActivityM
|
||||
|
||||
@Override
|
||||
public void onRemoteConnected() {
|
||||
Log.e(TAG, "onRemoteConnected: ");
|
||||
setDefaultDesktop();
|
||||
}
|
||||
|
||||
|
||||
@@ -175,18 +175,17 @@ public class WeatherActivity extends BaseMvvmActivity<WeatherViewModel, Activity
|
||||
if (weatherNowBean != null) {
|
||||
if (Code.OK == weatherNowBean.getCode()) {
|
||||
WeatherNowBean.NowBaseBean now = weatherNowBean.getNow();
|
||||
Log.d("getWeatherNow: ", "onSuccess: now " + new Gson().toJson(now));
|
||||
Log.d("getWeatherNowData: ", "onSuccess: now " + new Gson().toJson(now));
|
||||
mViewDataBinding.setNowBaseBean(now);
|
||||
Toaster.show("刷新成功");
|
||||
} else {
|
||||
//在此查看返回数据失败的原因
|
||||
Code code = weatherNowBean.getCode();
|
||||
Log.d("getWeatherNow: ", "failed code: " + code);
|
||||
Log.d("getWeatherNowData: ", "failed code: " + code);
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "getWeatherNow: weatherNowBean is null");
|
||||
Log.e(TAG, "getWeatherNowData: weatherNowBean is null");
|
||||
Toaster.show("获取天气失败");
|
||||
mViewModel.getWeatherCache();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -207,6 +206,7 @@ public class WeatherActivity extends BaseMvvmActivity<WeatherViewModel, Activity
|
||||
}
|
||||
|
||||
private void getWeather() {
|
||||
// mViewModel.getWeatherCache();
|
||||
String district = mMMKV.decodeString(CommonConfig.MANUALLY_SELECT_LOCATION_DISTRICT, CommonConfig.DEFAULT_LOCATION_DISTRICT);
|
||||
String tude = mMMKV.decodeString(CommonConfig.MANUALLY_SELECT_LOCATION_TUDE, CommonConfig.DEFAULT_LOCATION_TUDE);
|
||||
if (TextUtils.isEmpty(tude)) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import androidx.lifecycle.MutableLiveData;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.jeremyliao.liveeventbus.LiveEventBus;
|
||||
import com.qweather.sdk.bean.base.Lang;
|
||||
import com.qweather.sdk.bean.base.Unit;
|
||||
import com.qweather.sdk.bean.weather.WeatherDailyBean;
|
||||
@@ -207,6 +208,10 @@ public class WeatherViewModel extends BaseViewModel<ActivityWeatherBinding, Acti
|
||||
String jsonString = new Gson().toJson(weatherBean);
|
||||
mMMKV.encode(CommonConfig.WEATHER_NOW_KEY, jsonString);
|
||||
mWeatherNowData.setValue(weatherBean);
|
||||
WeatherNowBean.NowBaseBean now = weatherBean.getNow();
|
||||
LiveEventBus
|
||||
.get("some_key1")
|
||||
.post(now);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -221,16 +226,20 @@ public class WeatherViewModel extends BaseViewModel<ActivityWeatherBinding, Acti
|
||||
QWeather.getWeather7D(getCtx(), locationTude, new QWeather.OnResultWeatherDailyListener() {
|
||||
@Override
|
||||
public void onError(Throwable throwable) {
|
||||
Log.e("getWeather", "onError: " + throwable.getMessage());
|
||||
Log.e("getWeather7D", "onError: " + throwable.getMessage());
|
||||
// mWeatherDailyData.setValue(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(WeatherDailyBean weatherDailyBean) {
|
||||
String jsonString = new Gson().toJson(weatherDailyBean);
|
||||
Log.d("getWeather", "onSuccess: " + jsonString);
|
||||
Log.d("getWeather7D", "onSuccess: " + jsonString);
|
||||
mMMKV.encode(CommonConfig.WEATHER_DAILY_KEY, jsonString);
|
||||
mWeatherDailyData.setValue(weatherDailyBean);
|
||||
WeatherDailyBean.DailyBean dailyBean = weatherDailyBean.getDaily().get(0);
|
||||
LiveEventBus
|
||||
.get("some_key3")
|
||||
.post(dailyBean);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class BaseApplication extends Application {
|
||||
ShortcutUtils.init(this);
|
||||
|
||||
AmapManager.init(this);
|
||||
HeConfig.init("HE2210211540591362", "fe42a7bb59b14eefb27eea4fb2c40e99");
|
||||
HeConfig.init("HE2407111551551292", "28301b41b0ae42c2b6cecf12862ade1f");
|
||||
//切换至开发版服务
|
||||
HeConfig.switchToDevService();
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ public class AppListFragment extends BaseFragment {
|
||||
ApkUtils.openApp(mContext, "com.uiui.videoplayer");
|
||||
break;
|
||||
case "aios.appstore":
|
||||
ApkUtils.openApp(mContext, "com.uiuios.appstore");
|
||||
ApkUtils.openApp(mContext, "com.xxpatx.store");
|
||||
break;
|
||||
case "com.android.dialer":
|
||||
// int aole_call_forbid = Settings.System.getInt(mContext.getContentResolver(), "aole_call_forbid", 0);
|
||||
@@ -259,8 +259,8 @@ public class AppListFragment extends BaseFragment {
|
||||
// }
|
||||
break;
|
||||
case "com.xxpatx.os":
|
||||
case "com.uiuios.sn":
|
||||
case "com.uiuios.appstore":
|
||||
case "com.xxpatx.sn":
|
||||
case "com.xxpatx.store":
|
||||
case "com.uiuios.browser":
|
||||
ApkUtils.openPackage(v.getContext(), desktopIcon.getPackage(), desktopIcon.getClazz());
|
||||
AppUsedTimeUtils.getInstance().setAppPackageName(desktopIcon.getPackage());
|
||||
@@ -295,7 +295,7 @@ public class AppListFragment extends BaseFragment {
|
||||
}
|
||||
switch (pkg) {
|
||||
case "aios.exit":
|
||||
case "com.uiuios.sn":
|
||||
case "com.xxpatx.sn":
|
||||
case "aios.daily.app":
|
||||
case "aios.appstore":
|
||||
break;
|
||||
|
||||
@@ -511,7 +511,7 @@ public class CustomFragment extends BaseMvvmFragment<CustomViewModel, FragmentCu
|
||||
mViewDataBinding.clActivation.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ApkUtils.openPackage(mContext, "com.uiuios.sn");
|
||||
ApkUtils.openPackage(mContext, "com.xxpatx.sn");
|
||||
}
|
||||
});
|
||||
mViewDataBinding.clControl.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@@ -543,7 +543,7 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
||||
}
|
||||
|
||||
public void toAppstore(View view) {
|
||||
if (!ApkUtils.openPackage(mContext, "com.uiuios.appstore")) {
|
||||
if (!ApkUtils.openPackage(mContext, "com.xxpatx.store")) {
|
||||
Toaster.show("打开失败,请检查应用是否安装");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ public class SettingsFragment extends BaseMvvmFragment<SettingsViewModel, Fragme
|
||||
public class BtnClick {
|
||||
|
||||
public void toSn(View view) {
|
||||
if (!ApkUtils.openPackage(mContext, "com.uiuios.sn")) {
|
||||
if (!ApkUtils.openPackage(mContext, "com.xxpatx.sn")) {
|
||||
Toaster.show("打开失败,请检查应用是否安装");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,9 +106,9 @@ public class RemoteManager {
|
||||
if (mIGetInfoInterface == null) {
|
||||
//这是连接aidl服务的代码
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("com.uiuios.sn.IGetInfoInterface");
|
||||
intent.setPackage("com.uiuios.sn");
|
||||
intent.setComponent(new ComponentName("com.uiuios.sn", "com.uiuios.sn.service.RemoteService"));
|
||||
intent.setAction("com.xxpatx.sn.IGetInfoInterface");
|
||||
intent.setPackage("com.xxpatx.sn");
|
||||
intent.setComponent(new ComponentName("com.xxpatx.sn", "com.xxpatx.sn.service.RemoteService"));
|
||||
mContext.bindService(intent, mIGetInfoConnection, Context.BIND_AUTO_CREATE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.xxpatx.os.network;
|
||||
|
||||
public class UrlAddress {
|
||||
public static final String ROOT_URL = "https://led.zuoyepad.com/android/";
|
||||
public static final String ROOT_URL = "https://ghapi.mdmsaas.cn/";
|
||||
/*百度地图*/
|
||||
@Deprecated
|
||||
public static final String AMAP_ROOT_URL = "https://api.map.baidu.com/";
|
||||
|
||||
@@ -67,9 +67,9 @@ public class ApkUtils {
|
||||
this.add("com.uiui.videoplayer");
|
||||
// this.add("com.uiui.health");
|
||||
this.add("com.tencent.android.qqdownloader");
|
||||
// this.add("com.uiuios.appstore");
|
||||
// this.add("com.xxpatx.store");
|
||||
this.add("com.joytv.live");
|
||||
this.add("com.uiuios.appstore");
|
||||
this.add("com.xxpatx.store");
|
||||
this.add("com.teclast.zyos");
|
||||
this.add("com.teclast.zy");
|
||||
this.add("com.teclast.zyappstore");
|
||||
@@ -81,9 +81,9 @@ public class ApkUtils {
|
||||
}};
|
||||
|
||||
public static HashSet<String> showPackageName = new HashSet<String>() {{
|
||||
this.add("com.uiuios.sn");
|
||||
this.add("com.xxpatx.sn");
|
||||
this.add("com.uiuios.browser");
|
||||
// this.add("com.uiuios.appstore");
|
||||
// this.add("com.xxpatx.store");
|
||||
this.add("com.android.dialer");
|
||||
this.add("com.android.gallery3d");
|
||||
this.add("com.android.settings");
|
||||
@@ -158,14 +158,14 @@ public class ApkUtils {
|
||||
this.add("com.android.gallery3d");
|
||||
this.add("com.android.camera2");
|
||||
this.add("com.android.settings");
|
||||
this.add("com.uiuios.sn");
|
||||
this.add("com.uiuios.appstore");
|
||||
this.add("com.xxpatx.sn");
|
||||
this.add("com.xxpatx.store");
|
||||
}};
|
||||
|
||||
private static List<String> hideApp = new ArrayList<String>() {{
|
||||
this.add("com.uiuios.sn");
|
||||
this.add("com.xxpatx.sn");
|
||||
this.add("com.xxpatx.os");
|
||||
this.add("com.uiuios.appstore");
|
||||
this.add("com.xxpatx.store");
|
||||
this.add("com.android.quicksearchbox");
|
||||
this.add("com.android.stk");
|
||||
this.add("com.debug.loggerui");
|
||||
@@ -249,7 +249,7 @@ public class ApkUtils {
|
||||
resolveInfos.add(resolveInfo);
|
||||
}
|
||||
} else {
|
||||
if ("com.uiuios.sn".equals(pkg)) {
|
||||
if ("com.xxpatx.sn".equals(pkg)) {
|
||||
resolveInfos.add(resolveInfo);
|
||||
} else {
|
||||
Log.e(TAG, "queryFilterAppInfo: pkgSet ! contains " + pkg);
|
||||
@@ -322,7 +322,7 @@ public class ApkUtils {
|
||||
}
|
||||
|
||||
public static final HashSet<String> phoneShowPackageName = new HashSet<String>() {{
|
||||
this.add("com.uiuios.sn");
|
||||
this.add("com.xxpatx.sn");
|
||||
// this.add("com.uiuios.browser");
|
||||
// this.add("com.android.dialer");
|
||||
// this.add("com.android.gallery3d");
|
||||
@@ -377,7 +377,7 @@ public class ApkUtils {
|
||||
resolveInfos.add(resolveInfo);
|
||||
}
|
||||
} else {
|
||||
// if ("com.uiuios.sn".equals(pkg)) {
|
||||
// if ("com.xxpatx.sn".equals(pkg)) {
|
||||
// resolveInfos.add(resolveInfo);
|
||||
// } else {
|
||||
Log.e(TAG, "getAppstoreAppInfo: pkgSet ! contains " + pkg);
|
||||
|
||||
@@ -7,8 +7,8 @@ import java.util.List;
|
||||
|
||||
public class IconUtils {
|
||||
public static List<String> appClassNameList = new ArrayList<String>() {{
|
||||
this.add("com.uiuios.sn");//设别信息
|
||||
this.add("com.uiuios.appstore");//应用市场
|
||||
this.add("com.xxpatx.sn");//设备信息
|
||||
this.add("com.xxpatx.store");//应用市场
|
||||
this.add("aios.appstore");//应用市场
|
||||
this.add("com.uiui.weather");//天气
|
||||
this.add("com.android.browser");//浏览器
|
||||
|
||||
Reference in New Issue
Block a user