@@ -40,8 +40,8 @@ public class RuntimeTests extends AndroidTestCase
40
40
private ApplicationWriter aw ;
41
41
private Dump dump ;
42
42
private File optimizedDexOutputPath ;
43
+ public static final char CLASS_NAME_LOCATION_SEPARATOR = '_' ;
43
44
44
-
45
45
public RuntimeTests ()
46
46
{
47
47
}
@@ -120,7 +120,7 @@ private TargetObject loadProxy(File proxyFile, TargetObject implementationObject
120
120
Platform .implementationObject = implementationObject ;
121
121
122
122
DexClassLoader dexClassLoader = new DexClassLoader (proxyFile .getAbsolutePath (), optimizedDexOutputPath .getAbsolutePath (), null , getContext ().getClassLoader ());
123
- Class <?> clazz = dexClassLoader .loadClass ("com.tns.gen.com.proxy.TargetObject- 0" );
123
+ Class <?> clazz = dexClassLoader .loadClass ("com.tns.gen.com.proxy.TargetObject" + CLASS_NAME_LOCATION_SEPARATOR + " 0" );
124
124
assertNotNull ("Error loading proxy class com.tns.gen.com.proxy.TargetObject" , clazz );
125
125
126
126
Constructor <?> ctor = clazz .getConstructor ();
@@ -133,7 +133,7 @@ private <T> T loadAnyProxy(File proxyFile, T implementationObject) throws Except
133
133
Platform .implementationObject = (Object )implementationObject ;
134
134
135
135
DexClassLoader dexClassLoader = new DexClassLoader (proxyFile .getAbsolutePath (), optimizedDexOutputPath .getAbsolutePath (), null , getContext ().getClassLoader ());
136
- Class <?> clazz = dexClassLoader .loadClass ("com.tns.gen." + implementationObject .getClass ().getSuperclass ().getCanonicalName () + "- 0" );
136
+ Class <?> clazz = dexClassLoader .loadClass ("com.tns.gen." + implementationObject .getClass ().getSuperclass ().getCanonicalName () + CLASS_NAME_LOCATION_SEPARATOR + " 0" );
137
137
assertNotNull ("Error loading proxy class com.tns.gen.com.proxy.Button1" , clazz );
138
138
139
139
Constructor <?> ctor = clazz .getConstructor ();
@@ -144,7 +144,7 @@ private <T> T loadAnyProxy(File proxyFile, T implementationObject) throws Except
144
144
private <T > T loadAnyProxyByClass (File proxyFile , Class <?> proxyClass ) throws Exception
145
145
{
146
146
DexClassLoader dexClassLoader = new DexClassLoader (proxyFile .getAbsolutePath (), optimizedDexOutputPath .getAbsolutePath (), null , getContext ().getClassLoader ());
147
- Class <?> clazz = dexClassLoader .loadClass ("com.tns.gen." + proxyClass .getName ().replace ('$' , '_' ) + "- 0" );
147
+ Class <?> clazz = dexClassLoader .loadClass ("com.tns.gen." + proxyClass .getName ().replace ('$' , '_' ) + CLASS_NAME_LOCATION_SEPARATOR + " 0" );
148
148
assertNotNull ("Error loading proxy class com.tns.gen.com.proxy.Button1" , clazz );
149
149
150
150
if (!proxyClass .getName ().contains ("ViewGroup" ))
@@ -168,7 +168,7 @@ private Button1 loadButton1Proxy(File proxyFile, Button1 implementationObject) t
168
168
Platform .implementationObject = implementationObject ;
169
169
170
170
DexClassLoader dexClassLoader = new DexClassLoader (proxyFile .getAbsolutePath (), optimizedDexOutputPath .getAbsolutePath (), null , getContext ().getClassLoader ());
171
- Class <?> clazz = dexClassLoader .loadClass ("com.tns.gen.com.proxy.Button1- 0" );
171
+ Class <?> clazz = dexClassLoader .loadClass ("com.tns.gen.com.proxy.Button1" + CLASS_NAME_LOCATION_SEPARATOR + " 0" );
172
172
assertNotNull ("Error loading proxy class com.tns.gen.com.proxy.Button1" , clazz );
173
173
174
174
Constructor <?> ctor = clazz .getConstructor ();
@@ -181,7 +181,7 @@ private TargetObject.TargetInterface loadInterfaceProxy(File proxyFile, TargetOb
181
181
Platform .implementationObject = implementationObject ;
182
182
183
183
DexClassLoader dexClassLoader = new DexClassLoader (proxyFile .getAbsolutePath (), optimizedDexOutputPath .getAbsolutePath (), null , getContext ().getClassLoader ());
184
- Class <?> clazz = dexClassLoader .loadClass ("com.tns.gen.com.proxy.TargetObject_TargetInterface- 0" );
184
+ Class <?> clazz = dexClassLoader .loadClass ("com.tns.gen.com.proxy.TargetObject_TargetInterface" + CLASS_NAME_LOCATION_SEPARATOR + " 0" );
185
185
assertNotNull ("Error loading proxy class com.tns.gen.com.proxy.TargetObject" , clazz );
186
186
187
187
Constructor <?> ctor = clazz .getConstructor ();
0 commit comments