0

I'm using scripts from an old project, but the sources are already lost I addded libraries files to project

In an old application, I used the library like this:

public class x2.X {
static {
System.loadLibrary("x2");
}

public static String m0do(String str) {
return Base64.getEncoder().encodeToString(x01(str).getBytes());
}

public static native String x01(String str);

}

And in the new one like this:

public class x2 {
public static class X {
static {
System.loadLibrary("x2");
}

    public static String m0do(String str) {
        if (Build.VERSION.SDK_INT \>= Build.VERSION_CODES.O) {
            return Base64.getEncoder().encodeToString(x01(str).getBytes());
        }
        return "";
    }

    public static native String x01(String str);
}

}

but i get error:

full error: https://pastebin.com/696XMPHe

short: Pending exception java.lang.ClassNotFoundException: Didn't find class "x2.X" on path: DexPathList[[dex file "/data/data/com.alex.materialdiary/code_cache/.overlay/base.apk/classes3.dex", dex file "/data/data/com.alex.materialdiary/code_cache/.overlay/base.apk/classes9.dex", zip file "/data/app/~~udenJ-l_lr574UqmKQionQ==/com.alex.materialdiary-8pbNPHfMtMQMEkE0VpgYkw==/base.apk"],nativeLibraryDirectories=[/data/app/~~udenJ-l_lr574UqmKQionQ==/com.alex.materialdiary-8pbNPHfMtMQMEkE0VpgYkw==/lib/arm64, /data/app/~~udenJ-l_lr574UqmKQionQ==/com.alex.materialdiary-8pbNPHfMtMQMEkE0VpgYkw==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]

I tried rename classes, disassemble .so files

Master
  • 13
  • 3
  • `x2.X` is a class named `X` in the **package** `x2`. What you showed in new code is a class `X` inside *another class named `x2`* **inside the unnamed package** (that name would usually encode as `x2$X`). If you want a drop-in replacement for the old class the .java file should start with `package x2; public class X { ... }`. – Joachim Sauer Jan 23 '23 at 17:59
  • Huge huge thanks! How can I donate to you? You saved my app! – Master Jan 23 '23 at 18:03

0 Answers0