codeplay-common 1.4.1 → 1.4.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.
|
@@ -10,6 +10,8 @@ const storeNames = {
|
|
|
10
10
|
"7": "AmazonStore"
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
const amazonMinSdkVersion=23;
|
|
14
|
+
|
|
13
15
|
const androidManifestPath = path.join("android", "app", "src", "main", "AndroidManifest.xml");
|
|
14
16
|
|
|
15
17
|
|
|
@@ -325,7 +327,7 @@ rl.question('Enter new versionCode (press enter to keep current): ', (newVersion
|
|
|
325
327
|
|
|
326
328
|
// Conditionally set the new file name
|
|
327
329
|
let newFileName;
|
|
328
|
-
|
|
330
|
+
let storeName = storeNames[id];
|
|
329
331
|
|
|
330
332
|
managePackages(storeName);
|
|
331
333
|
|
|
@@ -337,6 +339,7 @@ rl.question('Enter new versionCode (press enter to keep current): ', (newVersion
|
|
|
337
339
|
newFileName = `app-release-signed-${storeName}-b${finalVersionCode}-v${finalVersionName}.aab`;
|
|
338
340
|
}
|
|
339
341
|
|
|
342
|
+
//storeName="amazon"
|
|
340
343
|
const checkFullPath = path.join("AAB", newFileName); // Update to point to the new AAB directory
|
|
341
344
|
|
|
342
345
|
// Modify minSdkVersion in variables.gradle for SamsungStore
|
|
@@ -361,13 +364,15 @@ rl.question('Enter new versionCode (press enter to keep current): ', (newVersion
|
|
|
361
364
|
}
|
|
362
365
|
} else {
|
|
363
366
|
// For PlayStore and AmazonStore, ensure minSdkVersion is originalMinSdkVersion
|
|
364
|
-
if (currentMinSdkVersion !== originalMinSdkVersion) {
|
|
365
|
-
variablesGradleContent = variablesGradleContent.replace(/minSdkVersion\s*=\s*\d+/, `minSdkVersion = ${
|
|
366
|
-
console.log(`minSdkVersion reverted to ${
|
|
367
|
+
//if (currentMinSdkVersion !== originalMinSdkVersion) {
|
|
368
|
+
variablesGradleContent = variablesGradleContent.replace(/minSdkVersion\s*=\s*\d+/, `minSdkVersion = ${amazonMinSdkVersion}`);
|
|
369
|
+
console.log(`minSdkVersion reverted to ${amazonMinSdkVersion} for ${storeName}`);
|
|
367
370
|
fs.writeFileSync(variablesGradleFilePath, variablesGradleContent);
|
|
368
|
-
}
|
|
371
|
+
//}
|
|
369
372
|
}
|
|
370
373
|
|
|
374
|
+
|
|
375
|
+
|
|
371
376
|
// Run the Node.js script to modify plugin.xml
|
|
372
377
|
if (isAdmobFound) {
|
|
373
378
|
child_process.execSync('node buildCodeplay/modify-plugin-xml.js', { stdio: 'inherit' });
|
|
@@ -396,6 +401,12 @@ rl.question('Enter new versionCode (press enter to keep current): ', (newVersion
|
|
|
396
401
|
child_process.execSync('npx cap build android --androidreleasetype=AAB', { stdio: 'inherit' });
|
|
397
402
|
|
|
398
403
|
|
|
404
|
+
|
|
405
|
+
variablesGradleContent = variablesGradleContent.replace(/minSdkVersion\s*=\s*\d+/, 'minSdkVersion = 24');
|
|
406
|
+
console.log('minSdkVersion revert to 24 (default)');
|
|
407
|
+
fs.writeFileSync(variablesGradleFilePath, variablesGradleContent);
|
|
408
|
+
|
|
409
|
+
|
|
399
410
|
// Rename the output AAB file
|
|
400
411
|
const oldFilePath = path.join(aabDirectory, "app-release-signed.aab");
|
|
401
412
|
if (fs.existsSync(oldFilePath)) {
|