From e53ffd7da5992f1d06686f730c4204bc80749a75 Mon Sep 17 00:00:00 2001 From: Mason Le <43195241+MasonLe2497@users.noreply.github.com> Date: Mon, 19 Jun 2023 18:12:43 +0700 Subject: [PATCH 1/2] =?UTF-8?q?feat(android):=20=F0=9F=8C=9F=20add=20suppo?= =?UTF-8?q?rt=20for=20React=20Native=200.73?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 2 +- android/src/main/AndroidManifest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index e424f12..515d164 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion safeExtGet('compileSdkVersion', 28) - + namespace = "org.reactnative.maskedview" defaultConfig { minSdkVersion safeExtGet('minSdkVersion', 16) targetSdkVersion safeExtGet('targetSdkVersion', 28) diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 8e9ce44..a2f47b6 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,2 +1,2 @@ - + From 15d8b358f03c493ab1992d766f86e8c297cbbf83 Mon Sep 17 00:00:00 2001 From: Mason Le <43195241+MasonLe2497@users.noreply.github.com> Date: Wed, 21 Jun 2023 10:46:29 +0700 Subject: [PATCH 2/2] feat(android): add support RN <0.71 and RN 0.73 --- android/build.gradle | 27 ++++++++++++++++++++++++++- android/src/main/AndroidManifest.xml | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 515d164..ed87f73 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -17,9 +17,34 @@ buildscript { apply plugin: 'com.android.library' +def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger() +def shouldUseNameSpace = agpVersion >= 7 +def PACKAGE_PROP = "package=\"org.reactnative.maskedview\"" +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( + ' +