How to hooking New string(int[],int,int) with Xposed or lsposed?

321 views Asked by At

I'm practicing hooking with xposed.

I know I use findAndHookConstructor to hook up constructors in xposed.

However, the following code could not be hooked with xposed.

String v1_1 = new String(v7, 0, v4); -> java.lang.String(int[], int, int)

Here is my xposed code:

....
        findAndHookConstructor("java.lang.String", lpparam.classLoader,int[].class, int.class, int.class, new XC_MethodHook() {
            @Override
            protected void beforeHookedMethod(MethodHookParam param) throws Throwable
            {
                Log.d(TAG,"[*] beforeHooked:");
                Log.d(TAG,"[*] String: " + param.getResult());
            }
            @Override
            protected void afterHookedMethod(MethodHookParam param) throws Throwable
            {
                Log.d(TAG,"[*] afterHooked:");
                Log.d(TAG,"[*] String: " + param.getResult());
            }
        });
....

The smali code is as follows. (String v1_1 = new String(v7, 0, v4))

...
invoke-direct {v1, v6, v0, v4}, Ljava/lang/String;-><init>([III)V
...

I'm really curious.

Where in my code is something wrong?

0

There are 0 answers