Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public class RuntimeTests extends AndroidTestCase
private ApplicationWriter aw;
private Dump dump;
private File optimizedDexOutputPath;
public static final char CLASS_NAME_LOCATION_SEPARATOR = '_';


public RuntimeTests()
{
}
Expand Down Expand Up @@ -120,7 +120,7 @@ private TargetObject loadProxy(File proxyFile, TargetObject implementationObject
Platform.implementationObject = implementationObject;

DexClassLoader dexClassLoader = new DexClassLoader(proxyFile.getAbsolutePath(), optimizedDexOutputPath.getAbsolutePath(), null, getContext().getClassLoader());
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen.com.proxy.TargetObject-0");
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen.com.proxy.TargetObject"+ CLASS_NAME_LOCATION_SEPARATOR + "0");
assertNotNull("Error loading proxy class com.tns.gen.com.proxy.TargetObject", clazz);

Constructor<?> ctor = clazz.getConstructor();
Expand All @@ -133,7 +133,7 @@ private <T> T loadAnyProxy(File proxyFile, T implementationObject) throws Except
Platform.implementationObject = (Object)implementationObject;

DexClassLoader dexClassLoader = new DexClassLoader(proxyFile.getAbsolutePath(), optimizedDexOutputPath.getAbsolutePath(), null, getContext().getClassLoader());
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen." + implementationObject.getClass().getSuperclass().getCanonicalName() + "-0");
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen." + implementationObject.getClass().getSuperclass().getCanonicalName() + CLASS_NAME_LOCATION_SEPARATOR + "0");
assertNotNull("Error loading proxy class com.tns.gen.com.proxy.Button1", clazz);

Constructor<?> ctor = clazz.getConstructor();
Expand All @@ -144,7 +144,7 @@ private <T> T loadAnyProxy(File proxyFile, T implementationObject) throws Except
private <T> T loadAnyProxyByClass(File proxyFile, Class<?> proxyClass) throws Exception
{
DexClassLoader dexClassLoader = new DexClassLoader(proxyFile.getAbsolutePath(), optimizedDexOutputPath.getAbsolutePath(), null, getContext().getClassLoader());
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen." + proxyClass.getName().replace('$', '_') + "-0");
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen." + proxyClass.getName().replace('$', '_') + CLASS_NAME_LOCATION_SEPARATOR + "0");
assertNotNull("Error loading proxy class com.tns.gen.com.proxy.Button1", clazz);

if (!proxyClass.getName().contains("ViewGroup"))
Expand All @@ -168,7 +168,7 @@ private Button1 loadButton1Proxy(File proxyFile, Button1 implementationObject) t
Platform.implementationObject = implementationObject;

DexClassLoader dexClassLoader = new DexClassLoader(proxyFile.getAbsolutePath(), optimizedDexOutputPath.getAbsolutePath(), null, getContext().getClassLoader());
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen.com.proxy.Button1-0");
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen.com.proxy.Button1" + CLASS_NAME_LOCATION_SEPARATOR + "0");
assertNotNull("Error loading proxy class com.tns.gen.com.proxy.Button1", clazz);

Constructor<?> ctor = clazz.getConstructor();
Expand All @@ -181,7 +181,7 @@ private TargetObject.TargetInterface loadInterfaceProxy(File proxyFile, TargetOb
Platform.implementationObject = implementationObject;

DexClassLoader dexClassLoader = new DexClassLoader(proxyFile.getAbsolutePath(), optimizedDexOutputPath.getAbsolutePath(), null, getContext().getClassLoader());
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen.com.proxy.TargetObject_TargetInterface-0");
Class<?> clazz = dexClassLoader.loadClass("com.tns.gen.com.proxy.TargetObject_TargetInterface" + CLASS_NAME_LOCATION_SEPARATOR + "0");
assertNotNull("Error loading proxy class com.tns.gen.com.proxy.TargetObject", clazz);

Constructor<?> ctor = clazz.getConstructor();
Expand Down