@nativescript/android 8.4.0-dev.2 → 8.5.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -163,41 +163,41 @@ public final class RuntimeHelper {
163
163
 
164
164
  runtime = Runtime.initializeRuntimeWithConfiguration(config);
165
165
  if (isDebuggable) {
166
- // try {
167
- // v8Inspector = new AndroidJsV8Inspector(context.getFilesDir().getAbsolutePath(), context.getPackageName());
168
- // v8Inspector.start();
169
- //
170
- // // the following snippet is used as means to notify the VSCode extension
171
- // // debugger that the debugger agent has started
172
- // File debuggerStartedFile = new File("/data/local/tmp", context.getPackageName() + "-debugger-started");
173
- // if (debuggerStartedFile.exists() && !debuggerStartedFile.isDirectory() && debuggerStartedFile.length() == 0) {
174
- // java.io.FileWriter fileWriter = new java.io.FileWriter(debuggerStartedFile);
175
- // fileWriter.write("started");
176
- // fileWriter.close();
177
- // }
178
- //
179
- // // check if --debug-brk flag has been set. If positive:
180
- // // write to the file to invalidate the flag
181
- // // inform the v8Inspector to pause the main thread
182
- // File debugBreakFile = new File("/data/local/tmp", context.getPackageName() + "-debugbreak");
183
- // boolean shouldBreak = false;
184
- // if (debugBreakFile.exists() && !debugBreakFile.isDirectory() && debugBreakFile.length() == 0) {
185
- // java.io.FileWriter fileWriter = new java.io.FileWriter(debugBreakFile);
186
- // fileWriter.write("started");
187
- // fileWriter.close();
188
- //
189
- // shouldBreak = true;
190
- // }
191
- //
192
- // v8Inspector.waitForDebugger(shouldBreak);
193
- // } catch (IOException e) {
194
- // if (Util.isDebuggableApp(context)) {
195
- // e.printStackTrace();
196
- // }
197
- // }
198
- //
199
- // // if app is in debuggable mode run livesync service
200
- // // runtime needs to be initialized before the NativeScriptSyncService is enabled because it uses runtime.runScript(...)
166
+ try {
167
+ v8Inspector = new AndroidJsV8Inspector(context.getFilesDir().getAbsolutePath(), context.getPackageName());
168
+ v8Inspector.start();
169
+
170
+ // the following snippet is used as means to notify the VSCode extension
171
+ // debugger that the debugger agent has started
172
+ File debuggerStartedFile = new File("/data/local/tmp", context.getPackageName() + "-debugger-started");
173
+ if (debuggerStartedFile.exists() && !debuggerStartedFile.isDirectory() && debuggerStartedFile.length() == 0) {
174
+ java.io.FileWriter fileWriter = new java.io.FileWriter(debuggerStartedFile);
175
+ fileWriter.write("started");
176
+ fileWriter.close();
177
+ }
178
+
179
+ // check if --debug-brk flag has been set. If positive:
180
+ // write to the file to invalidate the flag
181
+ // inform the v8Inspector to pause the main thread
182
+ File debugBreakFile = new File("/data/local/tmp", context.getPackageName() + "-debugbreak");
183
+ boolean shouldBreak = false;
184
+ if (debugBreakFile.exists() && !debugBreakFile.isDirectory() && debugBreakFile.length() == 0) {
185
+ java.io.FileWriter fileWriter = new java.io.FileWriter(debugBreakFile);
186
+ fileWriter.write("started");
187
+ fileWriter.close();
188
+
189
+ shouldBreak = true;
190
+ }
191
+
192
+ v8Inspector.waitForDebugger(shouldBreak);
193
+ } catch (IOException e) {
194
+ if (Util.isDebuggableApp(context)) {
195
+ e.printStackTrace();
196
+ }
197
+ }
198
+
199
+ // if app is in debuggable mode run livesync service
200
+ // runtime needs to be initialized before the NativeScriptSyncService is enabled because it uses runtime.runScript(...)
201
201
  initLiveSync(runtime, logger, context);
202
202
 
203
203
  waitForLiveSync(context);