app逆向之解除豌豆荚历史版本限制

文章最后更新时间为:2023年07月01日 23:23:53

最近豌豆荚不让下载历史版本了,有一些app历史版本的替代品,但是都没豌豆荚好用,于是尝试逆向一下豌豆荚,看看能否获取到历史版本的下载链接,本次测试的版本是豌豆荚8.2.6.1

0. 查签名校验和查壳

首先检查下app是否有签名校验,使用mt管理器重新签名安装,发现app可以正常使用。

然后检查下app是否有壳,使用mt管理器查看即可,无壳。

2023-07-01T15:11:56.png

1. 去除”历史版本“隐藏

直接用jadx反编译apk,搜索“历史”关键词,在资源文件中找到了“历史版本”,资源name为"ady"

2023-07-01T15:12:09.png

继续在资源文件中搜索"ady",找到资源ID为0x7f1106ab,先放着备用

2023-07-01T15:14:10.png

在app的详情页,并没有看到历史记录四个字,所以这四个字应该是被隐藏了,下面在资源文件中搜索ady,尝试找出其对应的布局文件:

2023-07-01T15:14:20.png

kt.xml内容如下

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:id="@+id/a7g" android:layout_width="match_parent" android:layout_height="wrap_content">
    <com.pp.assistant.view.font.FontTextView android:textSize="16dp" android:textColor="@color/lv" android:id="@+id/ase" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="16dp" android:layout_marginTop="20dp" android:layout_marginRight="16dp" android:layout_marginBottom="12dp" android:text="@string/it" app:ftv_fontStyle="1"/>
    <RelativeLayout android:id="@+id/anc" android:visibility="gone" android:layout_width="match_parent" android:layout_height="50dp" android:layout_marginLeft="16dp" android:layout_marginRight="16dp">
        <com.pp.assistant.view.font.FontTextView android:textSize="14dp" android:textColor="@color/lv" android:ellipsize="end" android:id="@+id/asb" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ab4" android:singleLine="true" android:layout_centerVertical="true" app:ftv_fontStyle="1"/>
        <com.pp.assistant.view.font.FontTextView android:textSize="12dp" android:textColor="@color/nd" android:gravity="right" android:id="@+id/asc" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_toRightOf="@+id/asb" android:layout_alignParentRight="true" android:layout_centerVertical="true"/>
        <View android:id="@+id/and" android:background="@color/j3" android:layout_width="match_parent" android:layout_height="@dimen/eo" android:layout_alignParentBottom="true"/>
    </RelativeLayout>
    <RelativeLayout android:id="@+id/ane" android:background="@drawable/o_" android:visibility="gone" android:layout_width="match_parent" android:layout_height="50dp">
        <com.pp.assistant.view.font.FontTextView android:textSize="14dp" android:textColor="@color/lv" android:id="@+id/as_" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="16dp" android:text="@string/amq" android:layout_centerVertical="true" app:ftv_fontStyle="1"/>
        <ImageView android:id="@+id/aye" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="16dp" android:src="@drawable/a4h" android:layout_alignParentRight="true" android:layout_centerVertical="true"/>
        <View android:id="@+id/anh" android:background="@color/j3" android:layout_width="match_parent" android:layout_height="@dimen/eo" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" android:layout_alignParentBottom="true"/>
    </RelativeLayout>
    <RelativeLayout android:id="@+id/anf" android:background="@drawable/o_" android:visibility="gone" android:layout_width="match_parent" android:layout_height="50dp">
        <com.pp.assistant.view.font.FontTextView android:textSize="14dp" android:textColor="@color/lv" android:id="@+id/asa" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="16dp" android:text="@string/aj0" android:layout_centerVertical="true" app:ftv_fontStyle="1"/>
        <ImageView android:id="@+id/ayg" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="16dp" android:src="@drawable/a4h" android:layout_alignParentRight="true" android:layout_centerVertical="true"/>
        <View android:background="@color/j3" android:layout_width="match_parent" android:layout_height="@dimen/eo" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" android:layout_alignParentBottom="true"/>
    </RelativeLayout>
    <RelativeLayout android:id="@+id/ang" android:background="@drawable/o_" android:clickable="true" android:layout_width="match_parent" android:layout_height="50dp">
        <ImageView android:id="@+id/ay4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="16dp" android:src="@drawable/a4h" android:layout_alignParentRight="true" android:layout_centerVertical="true"/>
        <com.pp.assistant.view.font.FontTextView android:textSize="14dp" android:textColor="@color/lv" android:ellipsize="end" android:id="@+id/asf" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="16dp" android:text="@string/ady" android:singleLine="true" android:layout_alignParentLeft="true" android:layout_centerVertical="true" app:ftv_fontStyle="1"/>
        <View android:background="@color/j3" android:layout_width="match_parent" android:layout_height="@dimen/eo" android:layout_marginLeft="16dp" android:layout_marginRight="16dp" android:layout_alignParentBottom="true"/>
    </RelativeLayout>
</LinearLayout>

尝试定位上级RelativeLayout,资源name为ang,看看哪个activity引用了这个布局。(这里为什么不去定位整个LinearLayout,资源name为a7g,因为没定位到,在实际测试时,需要一级一级定位测试)。

在资源文件中搜索"ang",找到其资源的ID为0x7f090777

2023-07-01T15:14:36.png

于是去代码中搜索该资源,使用0x7f090777的10进制2131298167去搜索,(这个是jadx才用十进制去搜索,如果用mt管理器,还是用16进制去搜索)

2023-07-01T15:14:48.png

在代码中,使用变量pp_rl_details_version来表示这个资源,下面继续在代码中搜索pp_rl_details_version

2023-07-01T15:14:57.png

找到使用这个layout资源的地方了,点击进去:

2023-07-01T15:15:07.png

setvisibility有三个参数:VISIBLE, INVISIBLE, GONE,分别是:

  • VISIBLE=0 可见的
  • INVISIBILITY=4 不可见,但是还占用原来的布局空间
  • GONE=8 不可见的,不占用原来的布局空间

这里可以看出,relativeLayout.setVisibility(8);这句直接隐藏了这个布局,所以页面上也就不显示"历史版本"这块内容了。

下面使用mt管理器,将8改成0即可:

2023-07-01T15:15:21.png

修改完之后安装,打开app详情页,发现已经存在历史版本

2023-07-01T15:15:30.png

2. 给"历史版本"加上动作

上一步显示了历史版本的布局,但是尝试点击还是没反应,于是尝试寻找这个按钮绑定的点击事件,在代码中搜索pp_rl_details_version的时候其实也看到了

2023-07-01T15:15:39.png

点击进去看看

2023-07-01T15:15:48.png

看起来一切正常,如果点击了"历史版本",应该会跳转到AppHistoryActivity,但是没反应,要么是没跳转到AppHistoryActivity,要么是AppHistoryActivity被修改了,下面尝试修改掉中间的if (list == null || list.size() == 0) ,让其不要返回试试。

2023-07-01T15:16:04.png

使用mt注释上面的三行即可:

2023-07-01T15:16:13.png

然后打包安装,发现点击”历史记录“已经可以进入历史版本的activity了,点击下载安装也是正常的

2023-07-01T15:16:43.png

4. 总结

豌豆荚目前只在客户端做了布局和activity的隐藏,app历史记录的下载逻辑和下载链接都还在,未来可能会移除这部分功能,且行且珍惜吧

成品app下载

链接:https://pan.baidu.com/s/1MiIcFsrgwq5qZY8RaTaKtw?pwd=2p38 提取码:2p38
1 + 4 =
4 评论
    WTQ Chrome 114 Windows 10
    2023年07月20日 回复

    后台里存的apk文件似乎也开始大量清理了,只剩少部分版本号能下载,基本也算寄了

      saucerman Chrome 114 OSX
      2023年07月21日 回复

      @WTQ 嗯是的

    我哦按SD卡十大 Chrome 114 Windows 10
    2023年07月19日 回复

    test Chrome 96 Android 12
    2023年07月06日 回复

    能否传一下蓝奏云盘呢