我们先看NewDetailFragment$40的JAVA源码
public void onClick(View view) {
onClick(view);
if (!PatchProxy.proxy(new Object[]{view}, this, a, false, 7416).isSupported) {
if (e.a().j()) {
NewDetailFragment.k(this.c, this.b);
} else if (e.a().f(NewDetailFragment.d(this.c))) {
NewDetailFragment.s(this.c).downloadBook(NewDetailFragment.d(this.c), "active", "detail");
} else if (c.a().g("video_book_download")) {
switch (a.z().h) {
case 0:/* 分析:当a.z().h=0时,执行*/
NewDetailFragment.k(this.c, this.b);
break;
case 1:/* 分析:当a.z().h=1时,执行downloadAfterAddPrivilege,根据字面意思,应该是=1时可以下载小说,那我们尝试修改smali*/
NewDetailFragment.s(this.c).downloadAfterAddPrivilege(NewDetailFragment.d(this.c), "active", "detail");
break;
case 2:/* 分析:当a.z().h=2时,提示要看视频才能下载 */
q qVar = new q(this.c.getActivity());
qVar.d(this.c.getString(2131100173));/* 16进制7f06020d转换10进制为2131100173*/
qVar.a(this.c.getString(2131100171), new 1(this));
qVar.c(this.c.getString(2131100170));
qVar.a().show();/* 显示弹窗 */
NewDetailFragment.s(this.c).reportInspireVideoEvent("show_ad_enter");
break;
default:
break;
}
} else {
NewDetailFragment.k(this.c, this.b);
}
NewDetailFragment.l(this.c).b(NewDetailFragment.d(this.c), "download");
NewDetailFragment.e(this.c).v.setVisibility(8);
h.a().f(true);
}
}
我们按下返回,搜索downloadAfterAddPrivilege,往上拉发现:pswitch_ab说明:pswitch_ab就是a.z().h=1,也就是case 1
:pswitch_ab #case 1 分支1,可下载
iget-object p1, p0, Lcom/dragon/read/pages/detail/fragment/NewDetailFragment$40;->c:Lcom/dragon/read/pages/detail/fragment/NewDetailFragment;
invoke-static {p1}, Lcom/dragon/read/pages/detail/fragment/NewDetailFragment;->s(Lcom/dragon/read/pages/detail/fragment/NewDetailFragment;)Lcom/dragon/read/pages/detail/BookDetailHelper;
move-result-object p1
iget-object v1, p0, Lcom/dragon/read/pages/detail/fragment/NewDetailFragment$40;->c:Lcom/dragon/read/pages/detail/fragment/NewDetailFragment;
invoke-static {v1}, Lcom/dragon/read/pages/detail/fragment/NewDetailFragment;->d(Lcom/dragon/read/pages/detail/fragment/NewDetailFragment;)Ljava/lang/String;
move-result-object v1
const-string v2, "active"
const-string v3, "detail"
invoke-virtual {p1, v1, v2, v3}, Lcom/dragon/read/pages/detail/BookDetailHelper;->downloadAfterAddPrivilege(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
goto :goto_ce
然后我们搜索7f06020d,发现case 2
:pswitch_64 #pswitch_64就是case 2
然后我们就可以把case 1改为case 2,把case 2改为case 1
#原APP的smali代码以及注释
.packed-switch 0x0 ##case 区域,从0开始,依次递增
:pswitch_bf #JAVA中的case 0
:pswitch_ab #JAVA中的case 1
:pswitch_64 #JAVA中的case 2
.end packed-switch
修改后为
#修改后的smali代码以及注释
.packed-switch 0x0 ##case 区域,从0开始,依次递增
:pswitch_bf #JAVA中的case 0
:pswitch_64 #JAVA中的case 1
:pswitch_ab #JAVA中的case 2
.end packed-switch
再转换下,查看JAVA:
switch (a.z().h) {
case 0:
NewDetailFragment.k(this.c, this.b);
break;
case 2:/* 之前这给分支是1 我们通过修改SMALI之后变成了2 */
NewDetailFragment.s(this.c).downloadAfterAddPrivilege(NewDetailFragment.d(this.c), "active", "detail");
break;
case 1:/* 之前这给分支是2 我们通过修改SMALI之后变成了1 */
q qVar = new q(this.c.getActivity());
qVar.d(this.c.getString(2131100173));
qVar.a(this.c.getString(2131100171), new 1(this));
qVar.c(this.c.getString(2131100170));
qVar.a().show();
NewDetailFragment.s(this.c).reportInspireVideoEvent("show_ad_enter");
break;
default:
break;
}
然后我们保存后,签名,安装APP后再次尝试下载,结果发现还是不行。
但是当时搜索7f06020d的时候是有两条的,那我们把a$29的另一条也按照上述方法修改case 1和2之后签名安装APP。之后发现可以跳过看视频就能下载小说了。 【需要注意的是:a$29和NewDetailFragment$40中的要跳转的地址pswitch_XX是不太一样的】