From fafcd7092e06ff91de82ebbdcc72c81fa23156dd Mon Sep 17 00:00:00 2001 From: Mason Le <43195241+MasonLe2497@users.noreply.github.com> Date: Mon, 19 Jun 2023 17:03:25 +0700 Subject: [PATCH] =?UTF-8?q?feat(android):=C2=A0=F0=9F=8C=9F=C2=A0add=20sup?= =?UTF-8?q?port=20for=20React=20Native=200.73?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/android/build.gradle b/android/build.gradle index cbc90ab9..67661919 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,7 +21,31 @@ if (isNewArchitectureEnabled()) { apply plugin: "com.facebook.react" } +def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger() +def shouldUseNameSpace = agpVersion >= 7 +def PACKAGE_PROP = "package=\"com.zoontek.rnbootsplashw\"" +def manifestOutFile = file("${projectDir}/src/main/AndroidManifest.xml") +def manifestContent = manifestOutFile.getText() +if(shouldUseNameSpace){ + manifestContent = manifestContent.replaceAll( + PACKAGE_PROP, + '' + ) +} else { + if(!manifestContent.contains("$PACKAGE_PROP")){ + manifestContent = manifestContent.replace( + '