半栈工程师Android开发Android开发

Xposed开发实践(破解匆匆下载器VIP限制)

2018-08-08  本文已影响22人  Lazy1

一直没有找到合适的种子下载器,偶尔看到一个匆匆下载器,试了下解析成功率相当高,但是是要付费的,我这种穷逼,拿来的钱,所以就打算逆向下,看看

第一步分析

第二部开始分析,关键代码

这个是vip逻辑的限制

image
public class Man implements IXposedHookLoadPackage {

  private static final String FILTER_PKGNAME = "com.congcong.dl.application";
  private static final String BAI_DU_PKGNAME = "com.congcong.dl.application.widget.BDCloudVideoView";
  private static final String AD_PKGNAME = "com.congcong.dl.application.cc.bar.AdvancedMediaController";
  private static final String LOG_PKGNAME = "android.util.Log";
  @Override
  public void handleLoadPackage(final LoadPackageParam loadPackageParam) throws Throwable {
    Log.e("handleLoadPackage", loadPackageParam.packageName);
    if (FILTER_PKGNAME.equals(loadPackageParam.packageName)) {

      //这里是为了解决app多dex进行hook的问题,Xposed默认是hook主dex
      XposedHelpers
          .findAndHookMethod(Application.class, "attach", Context.class, new XC_MethodHook() {
            @Override
            protected void afterHookedMethod(MethodHookParam param) throws Throwable {
              Log.e("handleLoadPackage", "afterHookedMethod");
              final ClassLoader cl = ((Context) param.args[0]).getClassLoader();
              XposedHelpers.findAndHookMethod("com.congcong.dl.application.cc.AdvancedPlayActivity", cl, "onCreate", Bundle.class, new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam param) throws Throwable {
                  Log.e("handleLoadPackage", "onCreate");
                  //获取当前hook的activity
                  final Activity thisObject = (Activity) param.thisObject;
                  Uri data = thisObject.getIntent().getData();
                  Log.e("handleLoadPackage",data.toString());
                  final Class<?> aClass = cl.loadClass(AD_PKGNAME);
                  //hook AdvancedMediaController 中 startPositionTimer方法并且替换为空实现
                  XposedHelpers.findAndHookMethod(aClass, "startPositionTimer",
                      new XC_MethodReplacement() {
                        @Override
                        protected Object replaceHookedMethod(MethodHookParam methodHookParam)
                            throws Throwable {
                          Toast.makeText(thisObject,"hook,成功!",Toast.LENGTH_SHORT).show();
                          Log.e("handleLoadPackage", "replaceHookedMethod");
                          return null;
                        }
                      });
                }
              });

            }
          });
    }


  }
}

这样就可以无限制的看了,代码已经上传github地址,在xposted 里面搜索匆匆就可以使用该插件了

上一篇下一篇

猜你喜欢

热点阅读