codeplay-common 1.4.1 → 1.4.2

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
 
@@ -259,11 +261,11 @@ const rl = readline.createInterface({
259
261
 
260
262
  // Ask for new versionCode
261
263
  rl.question('Enter new versionCode (press enter to keep current): ', (newVersionCode) => {
262
- const finalVersionCode = newVersionCode || versionCode; // Use existing if no input
264
+ const finalVersionCode = versionCode; // Use existing if no input
263
265
 
264
266
  // Ask for new versionName
265
267
  rl.question('Enter new versionName (press enter to keep current): ', (newVersionName) => {
266
- const finalVersionName = newVersionName || versionName; // Use existing if no input
268
+ const finalVersionName = versionName; // Use existing if no input
267
269
 
268
270
  // Log the final version details
269
271
  console.log(`📦 Final versionCode: ${finalVersionCode}`);
@@ -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
- const storeName = storeNames[id];
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 = ${originalMinSdkVersion}`);
366
- console.log(`minSdkVersion reverted to ${originalMinSdkVersion} for ${storeName}`);
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)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",