既然这样,那我就对腾讯视频tv版来个全广告去升级纯净版
云视听极光的广告共有三部分,播放视频时的广告,开启app的广告,待机广告以及横幅广告
去掉开启广告和待机广告:
首先我们打开AndroidManifest.xml文件
<activity android:configChanges="orientation|screenSize" android:label="@string/app_name" android:name="com.ktcp.video.activity.MainActivity" android:screenOrientation="landscape" android:theme="@style/AppStartTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.MONKEY"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter>
<action android:name="com.tencent.qqlivetv.open.splash"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
可以看到com.ktcp.video.activity.MainActivity 是最先启动的activity,我们去这个activity对它反编译看看里边的逻辑
里边有代码: SplashManager.getInstance().showSplash(new SplashManager.OnSplashShowCallback()
Splash很多时候代表是闪屏广告,我们可以从这里入手
不过直接屏蔽SplashManager.getInstance().showSplash 是不行的,这样太暴力了,容易程序崩溃,我们要本着最小化修改达到完美修改的目的
继续往下看:
public boolean onTadReceived(ITadWrapper paramITadWrapper)
{
boolean bool = true;
if ((paramITadWrapper == null) || (paramITadWrapper.isEmpty()))
{
TVCommonLog.i("MainActivity", "requestSplashAd onNonAd");
MainActivity.a(MainActivity.this, true);
AppstartRenderTime.getInstance().putTimeOne();
AppstartRenderTime.getInstance().setIsHasAD(false);
AppStartFactory.getAppStartManager(MainActivity.this.getApplicationContext()).setAppInitStatuts(2);
ThreadPoolUtils.execute(new Runnable()
{
public void run()
{
PluginLoader.loadDexPlugin("mediaplayer");
}
});
MainActivity.this.runOnUiThread(new Runnable()
{
public void run()
{
MainActivity.a(MainActivity.this);
}
});
bool = false;
}
发现亮点没有,咱们可以伪装requestSplashAd onNonAd 条件,让他直接通过:
.method public onTadReceived(Lcom/tencent/tads/main/ITadWrapper;)Z
.locals 6
.prologue
const/4 v1, 0x0
const/4 v0, 0x1
.line 167
if-eqz v1, :cond_0 #修改变量为v1 if-eqz:为等于0就跳转到:cond_0,:cond_0 就是跳过闪屏广告的代码逻辑
invoke-interface {p1}, Lcom/tencent/tads/main/ITadWrapper;->isEmpty()Z
move-result v2
if-eqz v2, :cond_1
.line 169
:cond_0
const-string/jumbo v2, "MainActivity"
const-string/jumbo v3, "requestSplashAd onNonAd"
待机广告也是差不多这个逻辑修改,全局搜索requestSplashAd onNonAd
在ScreenSaverActivity里边同样这么修改:
.method public onTadReceived(Lcom/tencent/tads/main/ITadWrapper;)Z
.locals 10
.prologue
const/4 v8, 0x1
const/4 v0, 0x0
const/4 v3, 0x0
.line 88
if-eqz v3, :cond_0 #直接跳去:cond_0 代码段
invoke-interface {p1}, Lcom/tencent/tads/main/ITadWrapper;->isEmpty()Z
move-result v1
if-eqz v1, :cond_1
.line 90
:cond_0
const-string/jumbo v1, "ScreenSaverActivity"
const-string/jumbo v2, "hsjkey requestSplashAd onNonAd"
去横幅广告处理:
横幅广告使用Android studio 的layout inpector 层级查看器,得到关键字Banner
使用apkIDE全局搜索Banner,当然会出很多代码,要一步步寻找有用的信息,终于找到一个关键代码点:
.line 211
const-string/jumbo v0, "show_detail_banner_ad"
const-string/jumbo v1, ""
invoke-static {v0, v1}, Lcom/tencent/qqlivetv/model/advertisement/ADProxy;->notifyADShow(Ljava/lang/String;Ljava/lang/String;)V
goto :goto_1
notifyADShow:通知广告的展示,而且还是静态方法,那我们就可以全局把这个代码 invoke-static {v0, v1}, Lcom/tencent/qqlivetv/model/advertisement/ADProxy;->notifyADShow(Ljava/lang/String;Ljava/lang/String;)V 替换为空,至此横幅广告成功屏蔽
去升级提示:
我找到对应的函数:
.method private checkForceUpgrade()V 和 startCheckVersion
都是void的函数,所以我这边就比较简单粗暴,在函数开头给了个
return-void
把这些修改的逻辑保存,使用apkIDE重新编译修改的smali,就得到一个纯净版的无广告无升级的腾讯视频tv版了
|