Skip to content

Commit ae2066b

Browse files
PanayotCankovvchimev
authored and
vchimev
committed
Do not force LaunchScreen when adding AndroidManifest.xml in old projects
1 parent 9ba7ae5 commit ae2066b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/services/android-project-service.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,16 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
586586
if (alreadyHasAndroidManifest) {
587587
this.backupOriginalAndroidManifest(originalAndroidManifestFilePath).wait();
588588
}
589-
this.$fs.copyFile(templateAndroidManifest, originalAndroidManifestFilePath).wait();
589+
590+
let content = this.$fs.readText(templateAndroidManifest).wait();
591+
592+
// We do not want to force launch screens on old projects.
593+
let themeMeta = `<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />`;
594+
content = content
595+
.replace(`\n\t\t\tandroid:theme="@style/LaunchScreenTheme">\n`, `>\n\t\t\t<!-- android:theme="@style/LaunchScreenTheme" -->\n`)
596+
.replace(themeMeta, "<!-- " + themeMeta + " -->");
597+
598+
this.$fs.writeFile(originalAndroidManifestFilePath, content).wait();
590599
} catch (e) {
591600
this.$logger.trace(`Copying template's ${this.platformData.configurationFileName} failed. `, e);
592601
this.revertBackupOfOriginalAndroidManifest(originalAndroidManifestFilePath).wait();

0 commit comments

Comments
 (0)