Compare commits

...

9 Commits

Author SHA1 Message Date
a0c25a7c56 feat: 使用ASM插件检查隐私政策授权时的隐私问题
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-04-28 10:44:41 +08:00
a2bd5e01e0 Merge branch 'hotfix/v5.35.0-1050/jpush_clear_badge' into 'release'
fix: 修复极光推送清除角标提前获取信息的问题

See merge request halo/android/assistant-android!1649
2024-04-28 10:43:11 +08:00
844d227f19 fix: 修复极光推送清除角标提前获取信息的问题 2024-04-28 10:26:20 +08:00
f982bf6478 Merge branch 'hotfix/v5.35.0-1050/disable_jpush_auto_init' into 'release'
fix: 移除极光推送通过 ContentProvider 自动初始化的问题

See merge request halo/android/assistant-android!1647
2024-04-26 14:01:09 +08:00
33d7afec71 fix: 移除极光推送通过 ContentProvider 自动初始化相关代码 2024-04-26 13:40:16 +08:00
37ef50f323 Merge branch 'feat/GHZSCY-5243' into 'dev'
feat: 穿山甲广告SDK更换新版本与信息流广告优化 https://jira.shanqu.cc/browse/GHZSCY-5243

See merge request halo/android/assistant-android!1641
2024-04-26 10:10:33 +08:00
4c6acdee3a Merge branch 'fix/GHZSCY-5261' into 'dev'
fix: 【光环助手】开屏广告神策埋点数据上报问题 https://jira.shanqu.cc/browse/GHZSCY-5261

See merge request halo/android/assistant-android!1646
2024-04-25 10:36:50 +08:00
6beb060e63 fix: 【光环助手】开屏广告神策埋点数据上报问题 https://jira.shanqu.cc/browse/GHZSCY-5261 2024-04-25 10:31:22 +08:00
d11ccba0b7 feat: 穿山甲广告SDK更换新版本与信息流广告优化 https://jira.shanqu.cc/browse/GHZSCY-5243
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-04-22 16:29:42 +08:00
9 changed files with 101 additions and 23 deletions

View File

@ -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')

View File

@ -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) {

View File

@ -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);
}
}
}

View File

@ -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()

View File

@ -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();
}

View File

@ -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'

View File

@ -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"

View File

@ -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()

View File

@ -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>