2525
2626public class Platform
2727{
28- private static native void initNativeScript (String filesPath , int appJavaObjectId , boolean verboseLoggingEnabled , String packageName , Object [] v8Options , JsDebugger jsDebugger );
28+ private static native void initNativeScript (String filesPath , boolean verboseLoggingEnabled , String packageName , Object [] v8Options , JsDebugger jsDebugger );
2929
3030 private static native void runModule (String filePath ) throws NativeScriptException ;
3131
@@ -100,7 +100,7 @@ public static void setErrorActivityClass(Class<?> clazz)
100100 errorActivityClass = clazz ;
101101 }
102102
103- public static int init (Application application , ThreadScheduler threadScheduler , Logger logger , String appName , File runtimeLibPath , File rootDir , File appDir , ClassLoader classLoader , File dexDir , String dexThumb ) throws RuntimeException
103+ public static void init (Application application , ThreadScheduler threadScheduler , Logger logger , String appName , File runtimeLibPath , File rootDir , File appDir , ClassLoader classLoader , File dexDir , String dexThumb ) throws RuntimeException
104104 {
105105 if (initialized )
106106 {
@@ -113,20 +113,10 @@ public static int init(Application application, ThreadScheduler threadScheduler,
113113
114114 Platform .dexFactory = new DexFactory (logger , classLoader , dexDir , dexThumb );
115115
116- int appJavaObjectId = -1 ;
117-
118116 if (logger .isEnabled ())
119117 {
120118 logger .write ("Initializing NativeScript JAVA" );
121119 }
122-
123- appJavaObjectId = generateNewObjectId ();
124- makeInstanceStrong (application , appJavaObjectId );
125- if (logger .isEnabled ())
126- {
127- logger .write ("Initialized app instance id:" + appJavaObjectId );
128- }
129-
130120
131121 try
132122 {
@@ -143,7 +133,7 @@ public static int init(Application application, ThreadScheduler threadScheduler,
143133 jsDebugger = new JsDebugger (application , logger , threadScheduler );
144134 }
145135
146- Platform .initNativeScript (Module .getApplicationFilesPath (), appJavaObjectId , logger .isEnabled (), appName , v8Config , jsDebugger );
136+ Platform .initNativeScript (Module .getApplicationFilesPath (), logger .isEnabled (), appName , v8Config , jsDebugger );
147137
148138 if (jsDebugger != null )
149139 {
@@ -160,7 +150,6 @@ public static int init(Application application, ThreadScheduler threadScheduler,
160150 }
161151
162152 initialized = true ;
163- return appJavaObjectId ;
164153 }
165154
166155 @ RuntimeCallable
0 commit comments