Skip to content

Commit 598d1e8

Browse files
committed
add exception handling in network agent callbacks
update project template code to pass an additional parameter to StaticConfig
1 parent 7a3873b commit 598d1e8

3 files changed

Lines changed: 205 additions & 161 deletions

File tree

build-artifacts/project-template-gradle/src/main/java/com/tns/RuntimeHelper.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,15 @@ public static Runtime initRuntime(Application app) {
124124
e.printStackTrace();
125125
}
126126

127+
boolean isDebuggable = Util.isDebuggableApp(app);
127128
StaticConfiguration config = new StaticConfiguration(logger, appName, nativeLibDir, rootDir,
128-
appDir, classLoader, dexDir, dexThumb, appConfig);
129+
appDir, classLoader, dexDir, dexThumb, appConfig, isDebuggable);
129130

130131
runtime = Runtime.initializeRuntimeWithConfiguration(config);
131-
if (Util.isDebuggableApp(app)) {
132+
if (isDebuggable) {
132133
try {
133134
v8Inspector = new AndroidJsV8Inspector(app, logger);
134135
v8Inspector.start();
135-
File debugBreakFile = new File("/data/local/tmp", app.getPackageName() + "-debugger-started");
136-
if (debugBreakFile.exists() && !debugBreakFile.isDirectory() && debugBreakFile.length() == 0) {
137-
java.io.FileWriter fileWriter = new java.io.FileWriter(debugBreakFile);
138-
fileWriter.write("started");
139-
fileWriter.close();
140-
}
141136
} catch (IOException e) {
142137
e.printStackTrace();
143138
}

0 commit comments

Comments
 (0)