0

I am using Unity 5.6.

Until now, the Android used a way to inspect the classes.dex file inside the APK to prevent app tampering

For a typical build, I had no problem importing the classes.dex file.

However, using the 'Split Binary Build' option to use the .obb file, I could not import the classes.dex file properly.

I used to import classes.dex file in the following way

string urlScheme = @"jar:file://";
string apkPath = Application.dataPath;
string separator = @"!/";
string entry = @"classes.dex";
string url = urlScheme + apkPath + separator + entry;

If you use the Split Binay Option in Unity, the path to Application.dataPath will be 'android / data / obb /.../ myobb.obb'

s there a way to get the same result as the existing Application.dataPath using the Split Binary Build option?

Choi GOD
  • 3
  • 1

1 Answers1

0

I solved it. It was impossible to solve within Unity.

You can get the same results if you use the values ​​imported from Java in Unity.

        PackageManager m = getPackageManager();
    String s = getPackageName();
    PackageInfo p = m.getPackageInfo(s, 0);
    s = p.applicationInfo.sourceDir;

Reference : Get Application Directory

Choi GOD
  • 3
  • 1