codeplay-common 1.6.1 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52,16 +52,36 @@ function updateAndroidManifest() {
52
52
 
53
53
  let manifestContent = fs.readFileSync(androidManifestPath, "utf-8");
54
54
 
55
- // Replace the android:theme attribute in the <activity> tag
56
55
  manifestContent = manifestContent.replace(
57
- /<activity[^>]*android:theme="[^"]*"/,
56
+ /<activity[^>]*?>/,
58
57
  (match) => {
59
- return match.replace(/android:theme="[^"]*"/, 'android:theme="@style/Theme.Codeplay.SplashScreen"');
58
+ let updated = match;
59
+
60
+ // If android:theme is already present, update it
61
+ if (updated.includes('android:theme=')) {
62
+ updated = updated.replace(
63
+ /android:theme="[^"]*"/,
64
+ 'android:theme="@style/Theme.Codeplay.SplashScreen"'
65
+ );
66
+ }
67
+
68
+ // If android:resizeableActivity is already present, update it
69
+ if (updated.includes('android:resizeableActivity=')) {
70
+ updated = updated.replace(
71
+ /android:resizeableActivity="[^"]*"/,
72
+ 'android:resizeableActivity="false"'
73
+ );
74
+ } else {
75
+ // Add resizeableActivity attribute
76
+ updated = updated.replace('<activity', '<activity android:resizeableActivity="false"');
77
+ }
78
+
79
+ return updated;
60
80
  }
61
81
  );
62
82
 
63
83
  fs.writeFileSync(androidManifestPath, manifestContent, "utf-8");
64
- console.log(`Updated AndroidManifest.xml with new theme.`);
84
+ console.log(`Updated AndroidManifest.xml: ensured resizeableActivity="false" and updated theme if present.`);
65
85
  }
66
86
 
67
87
  // Perform the tasks
@@ -216,20 +216,20 @@ const checkIsAdsDisableByReturnStatement=()=>{
216
216
 
217
217
 
218
218
 
219
- const addPermission_AD_ID=()=>{
219
+ const addPermission_AD_ID=async()=>{
220
220
 
221
221
  const admobPluginXmlPath = path.join('node_modules', 'emi-indo-cordova-plugin-admob', 'plugin.xml');
222
222
 
223
223
 
224
- fs.access(admobPluginXmlPath, fs.constants.F_OK, (err) => {
225
- if (err) {
226
- isAdmobFound = false;
227
- } else {
228
- isAdmobFound = true;
229
- }
230
- });
231
-
224
+ let isAdmobFound = false;
225
+ try {
226
+ await fs.promises.access(admobPluginXmlPath, fs.constants.F_OK);
227
+ isAdmobFound = true;
228
+ } catch (err) {
229
+ isAdmobFound = false;
230
+ }
232
231
 
232
+
233
233
  if (isAdmobFound) {
234
234
  // Check if AndroidManifest.xml exists
235
235
  if (fs.existsSync(androidManifestPath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",