Compare commits
9 Commits
pack/test-
...
feat/check
| Author | SHA1 | Date | |
|---|---|---|---|
| a0c25a7c56 | |||
| a2bd5e01e0 | |||
| 844d227f19 | |||
| f982bf6478 | |||
| 33d7afec71 | |||
| 37ef50f323 | |||
| 4c6acdee3a | |||
| 6beb060e63 | |||
| d11ccba0b7 |
@ -4,6 +4,7 @@ apply plugin: 'kotlin-android' // kotlin
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'AndResGuard'
|
||||
apply plugin: 'privacy-sentry-plugin'
|
||||
|
||||
import groovy.xml.XmlUtil
|
||||
|
||||
@ -409,12 +410,50 @@ dependencies {
|
||||
}
|
||||
internalImplementation(project(':module_internal_test'))
|
||||
|
||||
// 根据BUILD_PUSH_TYPE决定使用哪个推送SDK,目前默认使用阿里云推送
|
||||
def pushProject = findProperty('BUILD_PUSH_TYPE') == 'jg'
|
||||
def pushProperty = findProperty('BUILD_PUSH_TYPE')
|
||||
// 根据BUILD_PUSH_TYPE决定使用哪个推送SDK,目前默认使用极光推送
|
||||
def pushProject = (pushProperty == null || pushProperty == 'jg')
|
||||
? project(':feature:jg_push') : project(':feature:acloud_push')
|
||||
implementation(pushProject) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
}
|
||||
|
||||
def privacyVersion = "1.3.4.2"
|
||||
implementation "com.github.allenymt.PrivacySentry:hook-sentry:$privacyVersion"
|
||||
implementation "com.github.allenymt.PrivacySentry:privacy-annotation:$privacyVersion"
|
||||
|
||||
// 代理类的库,如果自己没有代理类,那么必须引用这个aar!!
|
||||
// 如果不想使用库中本身的代理方法,可以不引入这个aar,但是自己必须实现代理类!!
|
||||
// 引入privacy-proxy,也可以自定义类代理方法,优先以业务方定义的为准
|
||||
implementation "com.github.allenymt.PrivacySentry:privacy-proxy:$privacyVersion"
|
||||
// 1.2.3 新增类替换,主要是为了hook构造函数的参数,按业务方需求自己决定
|
||||
implementation "com.github.allenymt.PrivacySentry:privacy-replace:$privacyVersion"
|
||||
}
|
||||
|
||||
privacy {
|
||||
// 设置免hook的名单
|
||||
blackList = []
|
||||
// 开关PrivacySentry插件功能
|
||||
enablePrivacy = true
|
||||
// 开启hook反射的方法
|
||||
hookReflex = true
|
||||
// 开启hook 替换类,目前支持file
|
||||
hookConstructor = true
|
||||
// 是否开启hook变量,默认为false,建议弃用
|
||||
hookField = true
|
||||
|
||||
// 以下是为了解决小米照明弹自启动问题的尝试, 如果没有自启动的需求,这里关闭即可
|
||||
// hook Service的部分代码,修复在MIUI上的自启动问题
|
||||
// 部分Service把自己的Priority设置为1000,这里开启代理功能,可以代理成0
|
||||
enableReplacePriority = true
|
||||
replacePriority = 1
|
||||
|
||||
// 支持关闭Service的Export功能,默认为false,注意部分厂商通道之类的push(xiaomi、vivo、huawei等厂商的pushService),不能关闭
|
||||
enableCloseServiceExport = true
|
||||
// Export白名单Service, 这里根据厂商的名称设置了白名单
|
||||
serviceExportPkgWhiteList = ["xiaomi","vivo","honor","meizu","oppo","Oppo","Hms","huawei","stp","Honor"]
|
||||
// 修改Service的onStartCommand 返回值修改为START_NOT_STICKY
|
||||
enableHookServiceStartCommand = true
|
||||
}
|
||||
|
||||
File propFile = file('sign.properties')
|
||||
|
||||
@ -45,6 +45,14 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
|
||||
}
|
||||
isFromBackgroundToForeground = false
|
||||
}
|
||||
|
||||
if (activityCount == 1) {
|
||||
// 清除桌面角标
|
||||
if (activity !is SplashScreenActivity && activity !is AuthorizationActivity) {
|
||||
val pushProvider = ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider
|
||||
pushProvider?.cleanBadgeNumber(activity.applicationContext)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResumed(activity: Activity) {
|
||||
@ -84,10 +92,6 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
|
||||
}
|
||||
|
||||
XapkInstaller.updateCurrentInstallStatus()
|
||||
|
||||
// 清除桌面角标
|
||||
val pushProvider = ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider
|
||||
pushProvider?.cleanBadgeNumber(activity.applicationContext)
|
||||
}
|
||||
|
||||
override fun onActivityPaused(activity: Activity) {
|
||||
|
||||
@ -556,7 +556,10 @@ public class MainActivity extends BaseActivity {
|
||||
} else {
|
||||
TextView jumpBtn = findViewById(R.id.jumpBtn);
|
||||
jumpBtn.setText(String.format(Locale.CHINA, "跳过 %d", COUNTDOWN_MAX_COUNT - mCountdownCount));
|
||||
mBaseHandler.sendEmptyMessageDelayed(COUNTDOWN_AD, 1000);
|
||||
Message newMsg = Message.obtain();
|
||||
newMsg.what = COUNTDOWN_AD;
|
||||
newMsg.obj = msg.obj;
|
||||
mBaseHandler.sendMessageDelayed(newMsg, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,6 +34,8 @@ import com.gh.gamecenter.core.utils.SPUtils
|
||||
import com.gh.gamecenter.feature.utils.PlatformUtils
|
||||
import com.gh.gamecenter.pkg.PkgHelper
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.lightgame.download.FileUtils
|
||||
import com.yl.lib.sentry.hook.PrivacySentry
|
||||
import org.json.JSONObject
|
||||
import splitties.systemservices.notificationManager
|
||||
import java.text.SimpleDateFormat
|
||||
@ -154,6 +156,8 @@ class SplashScreenActivity : BaseActivity() {
|
||||
private fun showPrivacyDialog() {
|
||||
NewPrivacyPolicyDialogFragment.show(this, null) { isSuccess: Boolean ->
|
||||
if (isSuccess) {
|
||||
PrivacySentry.Privacy.updatePrivacyShow()
|
||||
|
||||
mShouldPrefetchData = false
|
||||
prefetchData()
|
||||
|
||||
|
||||
@ -85,6 +85,8 @@ import com.lightgame.utils.Utils;
|
||||
import com.llew.huawei.verifier.LoadedApkHuaWei;
|
||||
import com.shuyu.gsyvideoplayer.cache.CacheFactory;
|
||||
import com.shuyu.gsyvideoplayer.player.PlayerFactory;
|
||||
import com.yl.lib.sentry.hook.PrivacySentry;
|
||||
import com.yl.lib.sentry.hook.PrivacySentryBuilder;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ServiceLoader;
|
||||
@ -617,6 +619,24 @@ public class HaloApp extends MultiDexApplication {
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
|
||||
// 完成功能的初始化
|
||||
PrivacySentryBuilder builder = new PrivacySentryBuilder()
|
||||
// 自定义文件结果的输出名
|
||||
.configResultFileName("buyer_privacy")
|
||||
// debug打开,可以看到logcat的堆栈日志
|
||||
.syncDebug(true)
|
||||
// 配置写入文件日志 , 线上包这个开关不要打开!!!!,true打开文件输入,false关闭文件输入
|
||||
.enableFileResult(true)
|
||||
// 持续写入文件30分钟
|
||||
.configWatchTime(30 * 60 * 1000)
|
||||
// 文件输出后的回调
|
||||
.configResultCallBack(s -> {
|
||||
|
||||
});
|
||||
// 添加默认结果输出,包含log输出和文件输出
|
||||
PrivacySentry.Privacy.INSTANCE.init(this, builder);
|
||||
|
||||
for (IApplication application : mApplicationList) {
|
||||
application.attachBaseContext();
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ buildscript {
|
||||
|
||||
dependencies {
|
||||
classpath "com.android.tools.build:gradle:7.1.3"
|
||||
classpath 'com.github.allenymt.PrivacySentry:plugin-sentry:1.3.4.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
// 使用了 1.2.21 在蓝叠模拟器上无法进入首页? 但是不使用又会出现触发 V3 签名...
|
||||
classpath 'io.github.leon406:AndResGuard-gradle-plugin:1.2.23'
|
||||
|
||||
@ -2,7 +2,7 @@ ext {
|
||||
//Android
|
||||
buildToolsVersion = "30.0.3"
|
||||
compileSdkVersion = 34
|
||||
minSdkVersion = 16
|
||||
minSdkVersion = 21
|
||||
|
||||
targetSdkVersion = 30
|
||||
|
||||
@ -129,7 +129,7 @@ ext {
|
||||
|
||||
documentfile = "1.0.1"
|
||||
|
||||
csjVersion = "5.6.2.0"
|
||||
csjVersion = "5.8.0.4.0"
|
||||
|
||||
qGameVersion = "1.57.14"
|
||||
qGameAdVersion = "4.520.1390"
|
||||
|
||||
@ -72,18 +72,19 @@ object CsjAdHelper {
|
||||
*/
|
||||
override fun getDevOaid(): String = oaid
|
||||
})
|
||||
.build(),
|
||||
object : TTVfSdk.InitCallback {
|
||||
override fun success() {
|
||||
Utils.log(TAG, "穿山甲初始化成功")
|
||||
mIsInitialed = true
|
||||
}
|
||||
.build())
|
||||
|
||||
override fun fail(p0: Int, p1: String?) {
|
||||
Utils.log(TAG, "穿山甲初始化失败, $p0 $p1")
|
||||
mIsInitialed = false
|
||||
}
|
||||
})
|
||||
TTVfSdk.start(object : TTVfSdk.Callback {
|
||||
override fun success() {
|
||||
Utils.log(TAG, "穿山甲初始化成功")
|
||||
mIsInitialed = true
|
||||
}
|
||||
|
||||
override fun fail(p0: Int, p1: String?) {
|
||||
Utils.log(TAG, "穿山甲初始化失败, $p0 $p1")
|
||||
mIsInitialed = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun updateThemeStatus(isDarkMode: Boolean) {
|
||||
@ -124,8 +125,8 @@ object CsjAdHelper {
|
||||
}
|
||||
|
||||
mTTVfNative.loadSphVs(adSlot, object : TTVfNative.CSJSplashAdListener {
|
||||
override fun onSplashLoadSuccess() {
|
||||
Utils.log(TAG, "开屏广告加载成功")
|
||||
override fun onSplashLoadSuccess(p0: CSJSplashAd?) {
|
||||
Utils.log(TAG, "开屏广告加载成功 $p0")
|
||||
}
|
||||
|
||||
override fun onSplashLoadFail(p0: CSJAdError?) {
|
||||
@ -199,7 +200,7 @@ object CsjAdHelper {
|
||||
.setCodeId(slotId) // 广告位id
|
||||
.setSupportDeepLink(true)
|
||||
.setAdCount(1) // 请求广告数量为1到3条
|
||||
.setExpressViewAcceptedSize(expressViewAcceptedSize, 96F) // 期望模板广告view的size,宽度最低为375,单位dp
|
||||
.setExpressViewAcceptedSize(expressViewAcceptedSize, 0F) // 期望模板广告view的size,宽度最低为375,单位dp
|
||||
.setAdLoadType(TTAdLoadType.LOAD) // 推荐使用,用于标注此次的广告请求用途为预加载(当做缓存)还是实时加载,方便后续为开发者优化相关策略
|
||||
.build()
|
||||
|
||||
|
||||
@ -32,6 +32,12 @@
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<provider
|
||||
android:name="cn.jpush.android.service.InitProvider"
|
||||
android:authorities="${applicationId}.jiguang.InitProvider"
|
||||
android:exported="false"
|
||||
tools:node="remove" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
Reference in New Issue
Block a user