@@ -142,14 +142,18 @@ public static Runtime initRuntime(Context context) {
142142 if (logger .isEnabled ()) {
143143 logger .write ("Error while getting current proxy thumb" );
144144 }
145- e .printStackTrace ();
145+ if (Util .isDebuggableApp (context )) {
146+ e .printStackTrace ();
147+ }
146148 }
147149
148150 String nativeLibDir = null ;
149151 try {
150152 nativeLibDir = context .getPackageManager ().getApplicationInfo (appName , 0 ).nativeLibraryDir ;
151153 } catch (NameNotFoundException e ) {
152- e .printStackTrace ();
154+ if (Util .isDebuggableApp (context )) {
155+ e .printStackTrace ();
156+ }
153157 }
154158
155159 boolean isDebuggable = Util .isDebuggableApp (context );
@@ -186,7 +190,9 @@ public static Runtime initRuntime(Context context) {
186190
187191 v8Inspector .waitForDebugger (shouldBreak );
188192 } catch (IOException e ) {
189- e .printStackTrace ();
193+ if (Util .isDebuggableApp (context )) {
194+ e .printStackTrace ();
195+ }
190196 }
191197
192198 // if app is in debuggable mode run livesync service
@@ -213,7 +219,9 @@ public static Runtime initRuntime(Context context) {
213219 if (logger .isEnabled ()) {
214220 logger .write ("Cannot initialize application instance." );
215221 }
216- e .printStackTrace ();
222+ if (Util .isDebuggableApp (context )) {
223+ e .printStackTrace ();
224+ }
217225 }
218226
219227 if (appConfig .handleTimeZoneChanges ()) {
@@ -320,15 +328,25 @@ public static void initLiveSync(Runtime runtime, Logger logger, Context context)
320328 Method startServerMethod = NativeScriptSyncService .getMethod ("startServer" );
321329 startServerMethod .invoke (syncService );
322330 } catch (ClassNotFoundException e ) {
323- e .printStackTrace ();
331+ if (Util .isDebuggableApp (context )) {
332+ e .printStackTrace ();
333+ }
324334 } catch (NoSuchMethodException e ) {
325- e .printStackTrace ();
335+ if (Util .isDebuggableApp (context )) {
336+ e .printStackTrace ();
337+ }
326338 } catch (IllegalAccessException e ) {
327- e .printStackTrace ();
339+ if (Util .isDebuggableApp (context )) {
340+ e .printStackTrace ();
341+ }
328342 } catch (InvocationTargetException e ) {
329- e .printStackTrace ();
343+ if (Util .isDebuggableApp (context )) {
344+ e .printStackTrace ();
345+ }
330346 } catch (InstantiationException e ) {
331- e .printStackTrace ();
347+ if (Util .isDebuggableApp (context )) {
348+ e .printStackTrace ();
349+ }
332350 }
333351 }
334352
0 commit comments