File tree 1 file changed +8
-4
lines changed
mode/src/processing/mode/android
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -324,32 +324,36 @@ protected void load(boolean forceNew) {
324
324
try {
325
325
xml = new XML (manifestFile );
326
326
327
+ boolean saveOld = false ;
328
+
327
329
XML app = xml .getChild ("application" );
328
330
String icon = app .getString ("android:icon" );
329
331
if (icon .equals ("@drawable/icon" )) {
330
332
// Manifest file generated with older version of the mode, replace icon and save
331
333
app .setString ("android:icon" , "@mipmap/ic_launcher" );
332
- if (! forceNew ) save () ;
334
+ saveOld = true ;
333
335
}
334
336
335
337
XML activity = app .getChild ("activity" );
336
338
XML service = app .getChild ("service" );
337
339
if (activity != null && activity .getString ("android:name" ).equals (".MainActivity" )) {
338
340
addExportedAttrib (activity );
339
- if (! forceNew ) save () ;
341
+ saveOld = true ;
340
342
}
341
343
if (service != null && service .getString ("android:name" ).equals (".MainService" )) {
342
344
addExportedAttrib (service );
343
- if (! forceNew ) save () ;
345
+ saveOld = true ;
344
346
}
345
347
346
348
XML usesSDK = xml .getChild ("uses-sdk" );
347
349
if (usesSDK != null ) {
348
350
// Manifest file generated with older version of the mode, uses-sdk is no longer needed in manifest
349
351
xml .removeChild (usesSDK );
350
- if (! forceNew ) save () ;
352
+ saveOld = true ;
351
353
}
352
354
355
+ if (saveOld && !forceNew ) save ();
356
+
353
357
} catch (Exception e ) {
354
358
e .printStackTrace ();
355
359
System .err .println ("Problem reading AndroidManifest.xml, creating a new version" );
You can’t perform that action at this time.
0 commit comments