codeplay-common 3.0.5 → 3.0.6

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.
Files changed (2) hide show
  1. package/files/finalrelease +39 -19
  2. package/package.json +1 -1
@@ -26,6 +26,9 @@ import path from 'path';
26
26
  "7": "AmazonStore"
27
27
  }; */
28
28
 
29
+
30
+ const isOnlyOneAPK = true; // 🔥 change to false for normal behavior
31
+
29
32
  const storeNames = {
30
33
  "1": "PlayStore",
31
34
  "2": "SamsungStore",
@@ -463,6 +466,12 @@ if (storeIdArg) {
463
466
  }
464
467
 
465
468
 
469
+ // 🔥 If only one APK mode, override APK storeIds
470
+ /* if (isOnlyOneAPK) {
471
+ console.log("⚡ isOnlyOneAPK enabled → Only MiStore (3) will be used for APK build");
472
+ storeIds = ["3"]; // Only MiStore
473
+ } */
474
+
466
475
  // Store the original minSdkVersion globally
467
476
  let originalMinSdkVersion;
468
477
 
@@ -584,32 +593,40 @@ rl.question('Enter new versionCode (press enter to keep current): ', (newVersion
584
593
  process.env.VITE_STORE_ID = id;
585
594
 
586
595
  // Conditionally set the new file name
587
- let newFileName;
588
- let storeName = storeNames[id];
589
-
590
- debugger;
596
+ let newFileName;
597
+ let storeName = storeNames[id];
591
598
 
592
599
 
593
- managePackages(storeName);
600
+ if (
601
+ isOnlyOneAPK &&
602
+ ["OppoStore", "VivoStore"].includes(storeName)
603
+ ) {
604
+ console.log(`⏭ Skipping ${storeName} because isOnlyOneAPK is enabled`);
605
+ return; // skip this iteration only
606
+ }
594
607
 
595
- if (storeName === "SamsungStore") {
596
- // For SamsungStore, rename to versionCode value only
597
- //newFileName = `${finalVersionCode}.aab`;
598
- newFileName=`${_appUniqueId}_${_appName.replaceAll(" ","_")}-${(storeName.toUpperCase()).replace("STORE","")}-b${finalVersionCode}-v${finalVersionName.replace(/\./g,'_')}.aab`
599
- } else {
600
- // For other stores, use the standard naming format
601
- //newFileName = `app-release-signed-${storeName}-b${finalVersionCode}-v${finalVersionName}.aab`;
602
608
 
603
- newFileName=`${_appUniqueId}_${_appName.replaceAll(" ","_")}-${(storeName.toUpperCase()).replace("STORE","")}-b${finalVersionCode}-v${finalVersionName}.aab`
609
+ managePackages(storeName);
604
610
 
611
+ // 🔥 Only change filename logic — nothing else touched
612
+ if (isOnlyOneAPK && ["MiStore","OppoStore","VivoStore"].includes(storeName)) {
605
613
 
606
- /*
607
- const _appUniqueId = config.android?.APP_UNIQUE_ID;
608
- const _appName=config.appName;
609
- const _appPackageId=config.appId;
610
- */
614
+ newFileName =
615
+ `${_appUniqueId}_${_appName.replaceAll(" ","_")}-VI_MI_OPPO-b${finalVersionCode}-v${finalVersionName.replace(/\./g,'_')}.aab`;
611
616
 
612
- }
617
+ }
618
+ else if (storeName === "SamsungStore") {
619
+
620
+ newFileName =
621
+ `${_appUniqueId}_${_appName.replaceAll(" ","_")}-${(storeName.toUpperCase()).replace("STORE","")}-b${finalVersionCode}-v${finalVersionName.replace(/\./g,'_')}.aab`;
622
+
623
+ }
624
+ else {
625
+
626
+ newFileName =
627
+ `${_appUniqueId}_${_appName.replaceAll(" ","_")}-${(storeName.toUpperCase()).replace("STORE","")}-b${finalVersionCode}-v${finalVersionName}.aab`;
628
+
629
+ }
613
630
 
614
631
  //storeName="amazon"
615
632
  const checkFullPath = join("AAB", newFileName); // Update to point to the new AAB directory
@@ -664,6 +681,9 @@ rl.question('Enter new versionCode (press enter to keep current): ', (newVersion
664
681
  // Run the Vite build
665
682
  execSync(`npm run build:storeid${id}`, { stdio: 'inherit' });
666
683
 
684
+
685
+
686
+
667
687
 
668
688
 
669
689
  // Copy the built files to the appropriate folder
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",