aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/java/jogamp/android/launcher/AssetDexClassLoader.java28
-rw-r--r--src/java/jogamp/android/launcher/ClassLoaderUtil.java6
2 files changed, 30 insertions, 4 deletions
diff --git a/src/java/jogamp/android/launcher/AssetDexClassLoader.java b/src/java/jogamp/android/launcher/AssetDexClassLoader.java
index ec3ae6c..dcc162c 100644
--- a/src/java/jogamp/android/launcher/AssetDexClassLoader.java
+++ b/src/java/jogamp/android/launcher/AssetDexClassLoader.java
@@ -7,14 +7,36 @@ import android.util.Log;
import dalvik.system.DexClassLoader;
public class AssetDexClassLoader extends DexClassLoader {
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = true;
private static final String assets_folder = "assets/";
+ private static int next_id = 1;
+ private final int id;
+
public AssetDexClassLoader(String dexPath, String dexOutputDir, String libPath, ClassLoader parent) {
super(dexPath, dexOutputDir, libPath, parent);
+ synchronized(AssetDexClassLoader.class) {
+ id = next_id++;
+ }
+ if(DEBUG) {
+ Log.d(getSimpleName(), getIdName()+".ctor: dexPath " + dexPath + ", dexOutputDir " + dexOutputDir + ", libPath " + libPath + ", parent " + parent);
+ }
+ }
+
+ protected final String getSimpleName() {
+ return AssetDexClassLoader.class.getSimpleName();
+ }
+ protected final String getIdName() {
+ return "ADCL["+id+"]";
+ }
+
+ @Override
+ public String findLibrary(String libName) {
+ final String res = super.findLibrary(libName);
if(DEBUG) {
- Log.d(AssetDexClassLoader.class.getSimpleName(), "ctor: dexPath " + dexPath + ", dexOutputDir " + dexOutputDir + ", libPath " + libPath + ", parent " + parent);
+ Log.d(getSimpleName(), getIdName()+".findLibrary: " + libName + " -> " + res);
}
+ return res;
}
@Override
@@ -22,7 +44,7 @@ public class AssetDexClassLoader extends DexClassLoader {
final String assetName = name.startsWith(assets_folder) ? name : assets_folder + name ;
URL url = super.findResource(assetName);
if(DEBUG) {
- Log.d(AssetDexClassLoader.class.getSimpleName(), "findResource: " + name + " -> " + assetName + " -> " + url);
+ Log.d(getSimpleName(), getIdName()+".findResource: " + name + " -> " + assetName + " -> " + url);
}
return url;
}
diff --git a/src/java/jogamp/android/launcher/ClassLoaderUtil.java b/src/java/jogamp/android/launcher/ClassLoaderUtil.java
index 4e044ea..dae099e 100644
--- a/src/java/jogamp/android/launcher/ClassLoaderUtil.java
+++ b/src/java/jogamp/android/launcher/ClassLoaderUtil.java
@@ -43,6 +43,7 @@ public class ClassLoaderUtil {
// FIXME: Need to generalize this .. (Note: native lib resources must be cached!)
private static final String[] packagesJogAmp = { "com.jogamp.common", "javax.media.opengl" };
+ // JAU private static final String[] packagesJogAmp = { "javax.media.opengl" };
private static ClassLoader jogAmpClassLoader = null;
// location where optimized dex files will be written
@@ -104,6 +105,7 @@ public class ClassLoaderUtil {
StringBuilder apks = new StringBuilder();
StringBuilder libs = new StringBuilder();
+ // JAU libs.append("/data/data/com.jogamp.common/").append(ELEM_SEP);
int apkCount = 0;
String lastUserPackageName = null; // the very last one reflects the Activity
@@ -124,10 +126,12 @@ public class ClassLoaderUtil {
}
}
apks.append(userAPK);
+ Log.d(TAG, "APK["+apkCount+"] found: <"+lastUserPackageName+"> -> <"+userAPK+">");
+ Log.d(TAG, "APK["+apkCount+"] apks: <"+apks.toString()+">");
if(addUserLibPath) {
libs.append(appDir).append(PATH_SEP).append(lastUserPackageName).append(PATH_SEP).append(libSub).append(PATH_SEP);
+ Log.d(TAG, "APK["+apkCount+"] libs: <"+libs.toString()+">");
}
- Log.d(TAG, "APK found: <"+lastUserPackageName+"> -> <"+userAPK+">");
apkCount++;
} else {
Log.d(TAG, "APK not found: <"+lastUserPackageName+">");