Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大佬这种错误该怎么解决啊( Wrapper is disposed; perhaps it was borrowed from a hook instead of calling Java.retain() to make a long-lived wrapper) #7

Open
fastjien opened this issue Sep 14, 2021 · 1 comment

Comments

@fastjien
Copy link

环境

pixel3
Android 9.0
frida 14.2.18

Screen Shot 2021-09-14 at 10 17 54 PM

xposed代码

package com.hujinwen.tiktok;

import android.util.Log;

import java.lang.reflect.Field;

import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;

/**
 * Created by hu-jinwen on 2021/9/11
 */
public class TiktokHooker implements IXposedHookLoadPackage {

    private static final String LOG_TAG = "TiktokHooker";


    /**
     * Hook com.ss.android.deviceregister.b.d$a
     */
    @Override
    public void handleLoadPackage(LoadPackageParam loadPackageParam) throws Throwable {
        if (loadPackageParam.packageName.equals("com.ss.android.ugc.aweme")) {
            Log.i(LOG_TAG, "Find process -> " + loadPackageParam.packageName);

            Class<?> clazz = XposedHelpers.findClass("com.ss.android.deviceregister.b.d.a", loadPackageParam.classLoader);
            Log.i(LOG_TAG, "Find class -> " + clazz);

            XposedBridge.hookAllMethods(clazz, "a", new XC_MethodHook() {
                @Override
                protected void afterHookedMethod(MethodHookParam methodHookParam) throws Throwable {
                    String stackTraceString = Log.getStackTraceString(new Exception());
                    if (stackTraceString.contains("com.ss.android.deviceregister.b.d$a.a(RegisterServiceController.java:")) {
                        Log.i(LOG_TAG, "进来了关键分枝\n");
                        Log.i(LOG_TAG, stackTraceString);
                    }
                }
            });

        }
    }

}
@monkeylord
Copy link
Owner

试试看这个版本?
XposedFridaBridge.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants