codeplay-common 4.11.7 → 4.11.8

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 (33) hide show
  1. package/CHANGELOG.md +99 -96
  2. package/LICENSE +21 -21
  3. package/README.md +229 -229
  4. package/RELEASE_NOTES.md +20 -17
  5. package/files/buildCodeplay/add-splash-screen.js +255 -255
  6. package/files/buildCodeplay/apk-store-builder.js +97 -97
  7. package/files/buildCodeplay/codeplayBeforeBuild.js +40 -45
  8. package/files/buildCodeplay/ensure-current-build.cjs +42 -42
  9. package/files/buildCodeplay/fix-onesignal-plugin.js +96 -96
  10. package/files/buildCodeplay/ios-emi-admob-modification.js +49 -49
  11. package/files/buildCodeplay/manifestModification.js +38 -38
  12. package/files/buildCodeplay/newly added.txt +89 -89
  13. package/files/buildCodeplay/packageidBaseModification.js +445 -445
  14. package/files/buildCodeplay/project-scripts.cjs +62 -62
  15. package/files/buildCodeplay/release-sync.config.json +4 -4
  16. package/files/buildCodeplay/remove-force-kotlin-disable.js +43 -43
  17. package/files/buildCodeplay/setSplashAnimation.js +226 -226
  18. package/files/buildCodeplay/sync-admob-nextgen.js +219 -219
  19. package/files/buildCodeplay/versions.json +27 -27
  20. package/files/finalrelease +1246 -1246
  21. package/files/generate-ai-promo-video.js +23 -23
  22. package/files/ionic.config.json +6 -6
  23. package/files/scripts-common/generate-baseline-profile.js +46 -46
  24. package/files/scripts-common/run-codeplay-sync-after.js +21 -21
  25. package/files/scripts-common/screenshot/background-decorations.js +120 -120
  26. package/files/scripts-common/screenshot/frame-samples.js +117 -117
  27. package/files/scripts-common/setup-baseline-profile.js +291 -291
  28. package/files/take-screen-image.js +4382 -4382
  29. package/files/take-screen-video.js +644 -644
  30. package/package.json +27 -27
  31. package/scripts/ensure-current-build.test.cjs +76 -76
  32. package/scripts/sync-files.js +113 -113
  33. package/scripts/uninstall.js +2 -2
@@ -1,49 +1,49 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const replaceEmiPluginCode=()=>
5
- {
6
- // path to your .m file
7
- const filePath = path.join(__dirname, '../ios/capacitor-cordova-ios-plugins/sourcesstatic/EmiIndoCordovaPluginAdmob/emiAdmobPlugin.m');
8
- const nextGenPackagePath = path.join(__dirname, '../node_modules/capacitor-admob-nextgen/package.json');
9
-
10
-
11
- if (fs.existsSync(filePath)) {
12
- let fileContent = fs.readFileSync(filePath, 'utf8');
13
-
14
- // match the hideBannerAd method
15
- const methodRegex = /(- \(void\)hideBannerAd:[\s\S]*?\{)([\s\S]*?)(^\})/m;
16
-
17
- const match = fileContent.match(methodRegex);
18
-
19
- if (match) {
20
- const methodBody = match[2];
21
-
22
- // replace only if the line is not already commented
23
- const modifiedMethodBody = methodBody.replace(
24
- /^(\s*)(?!\/\/)\[self\s+resetWebViewHeight\];/m,
25
- '$1//[self resetWebViewHeight];'
26
- );
27
-
28
- const updatedFileContent =
29
- fileContent.slice(0, match.index) +
30
- match[1] +
31
- modifiedMethodBody +
32
- match[3] +
33
- fileContent.slice(match.index + match[0].length);
34
-
35
- fs.writeFileSync(filePath, updatedFileContent, 'utf8');
36
- console.log(
37
- '✅ Successfully ensured [self resetWebViewHeight]; is commented only inside hideBannerAd in emiAdmobPlugin.m'
38
- );
39
- } else {
40
- console.log('⚠️ hideBannerAd method not found.');
41
- }
42
- } else if (fs.existsSync(nextGenPackagePath)) {
43
- console.log('ℹ️ Skipping legacy iOS EMI AdMob patch. capacitor-admob-nextgen does not use emiAdmobPlugin.m.');
44
- } else {
45
- console.log('ℹ️ emiAdmobPlugin.m file not found, skipping modification.');
46
- }
47
- }
48
-
49
- replaceEmiPluginCode();
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const replaceEmiPluginCode=()=>
5
+ {
6
+ // path to your .m file
7
+ const filePath = path.join(__dirname, '../ios/capacitor-cordova-ios-plugins/sourcesstatic/EmiIndoCordovaPluginAdmob/emiAdmobPlugin.m');
8
+ const nextGenPackagePath = path.join(__dirname, '../node_modules/capacitor-admob-nextgen/package.json');
9
+
10
+
11
+ if (fs.existsSync(filePath)) {
12
+ let fileContent = fs.readFileSync(filePath, 'utf8');
13
+
14
+ // match the hideBannerAd method
15
+ const methodRegex = /(- \(void\)hideBannerAd:[\s\S]*?\{)([\s\S]*?)(^\})/m;
16
+
17
+ const match = fileContent.match(methodRegex);
18
+
19
+ if (match) {
20
+ const methodBody = match[2];
21
+
22
+ // replace only if the line is not already commented
23
+ const modifiedMethodBody = methodBody.replace(
24
+ /^(\s*)(?!\/\/)\[self\s+resetWebViewHeight\];/m,
25
+ '$1//[self resetWebViewHeight];'
26
+ );
27
+
28
+ const updatedFileContent =
29
+ fileContent.slice(0, match.index) +
30
+ match[1] +
31
+ modifiedMethodBody +
32
+ match[3] +
33
+ fileContent.slice(match.index + match[0].length);
34
+
35
+ fs.writeFileSync(filePath, updatedFileContent, 'utf8');
36
+ console.log(
37
+ '✅ Successfully ensured [self resetWebViewHeight]; is commented only inside hideBannerAd in emiAdmobPlugin.m'
38
+ );
39
+ } else {
40
+ console.log('⚠️ hideBannerAd method not found.');
41
+ }
42
+ } else if (fs.existsSync(nextGenPackagePath)) {
43
+ console.log('ℹ️ Skipping legacy iOS EMI AdMob patch. capacitor-admob-nextgen does not use emiAdmobPlugin.m.');
44
+ } else {
45
+ console.log('ℹ️ emiAdmobPlugin.m file not found, skipping modification.');
46
+ }
47
+ }
48
+
49
+ replaceEmiPluginCode();
@@ -1,38 +1,38 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const plist = require('plist');
4
- const { syncAndroidR8Rules } = require('./fix-optimize-builld/restore-android-r8-rules.cjs');
5
-
6
- syncAndroidR8Rules(process.cwd(), { installGradleHook: true });
7
-
8
- const { readFileSync } = require("fs");
9
-
10
-
11
-
12
-
13
-
14
-
15
- const addToolAttribute=()=>{
16
- //const platformRoot = path.join(context.opts.projectRoot, 'android');
17
- //const manifestPath = path.join(platformRoot, 'capacitor-cordova-android-plugins/src/main/AndroidManifest.xml');
18
-
19
- const manifestPath = path.resolve(process.cwd(), 'android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml');
20
-
21
- if (fs.existsSync(manifestPath)) {
22
- let manifest = fs.readFileSync(manifestPath, 'utf8');
23
-
24
- // Check if xmlns:tools exists
25
- if (!manifest.includes('xmlns:tools="http://schemas.android.com/tools"')) {
26
- // Add the tools namespace to the <manifest> tag.
27
- manifest = manifest.replace('<manifest', '<manifest xmlns:tools="http://schemas.android.com/tools"');
28
- fs.writeFileSync(manifestPath, manifest, 'utf8');
29
- console.log('✅ Added xmlns:tools to AndroidManifest.xml');
30
- } else {
31
- console.log('ℹ️ xmlns:tools already exists, skipping...');
32
- }
33
- } else {
34
- console.log('ℹ️ capacitor-cordova-android-plugins AndroidManifest.xml not found, skipping tools namespace update.');
35
- }
36
- };
37
-
38
- addToolAttribute()
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const plist = require('plist');
4
+ const { syncAndroidR8Rules } = require('./fix-optimize-builld/restore-android-r8-rules.cjs');
5
+
6
+ syncAndroidR8Rules(process.cwd(), { installGradleHook: true });
7
+
8
+ const { readFileSync } = require("fs");
9
+
10
+
11
+
12
+
13
+
14
+
15
+ const addToolAttribute=()=>{
16
+ //const platformRoot = path.join(context.opts.projectRoot, 'android');
17
+ //const manifestPath = path.join(platformRoot, 'capacitor-cordova-android-plugins/src/main/AndroidManifest.xml');
18
+
19
+ const manifestPath = path.resolve(process.cwd(), 'android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml');
20
+
21
+ if (fs.existsSync(manifestPath)) {
22
+ let manifest = fs.readFileSync(manifestPath, 'utf8');
23
+
24
+ // Check if xmlns:tools exists
25
+ if (!manifest.includes('xmlns:tools="http://schemas.android.com/tools"')) {
26
+ // Add the tools namespace to the <manifest> tag.
27
+ manifest = manifest.replace('<manifest', '<manifest xmlns:tools="http://schemas.android.com/tools"');
28
+ fs.writeFileSync(manifestPath, manifest, 'utf8');
29
+ console.log('✅ Added xmlns:tools to AndroidManifest.xml');
30
+ } else {
31
+ console.log('ℹ️ xmlns:tools already exists, skipping...');
32
+ }
33
+ } else {
34
+ console.log('ℹ️ capacitor-cordova-android-plugins AndroidManifest.xml not found, skipping tools namespace update.');
35
+ }
36
+ };
37
+
38
+ addToolAttribute()
@@ -1,90 +1,90 @@
1
- Note: This changes are added with my old(current) code. Might we need to integrate this features into our new optimized code.
2
-
3
- 1) If no import(saveToGalleryAndSaveAnyFile) found it through error issue is fixed
4
- // iOS Checks
5
- /* if (isMac && !iosImportFound) {
6
- console.warn(`⚠️ WARNING: You're on macOS but no iOS version (saveToGalleryAndSaveAnyFile-x.x-ios.js) found.`);
7
- process.exit(1);
8
- } else if (isMac && iosImportFound) {
9
- console.log('✅ iOS version detected for macOS build.');
10
- } else if (!iosImportFound) {
11
- console.log('✅ No iOS-specific imports detected for non-macOS.');
12
- } */
13
-
14
- // ✅ Only care if iOS import is found in NON-mac systems
15
- if (iosImportFound && !isMac) {
16
- console.error(`\n❌ ERROR: iOS-specific file is imported in non-macOS environment.`);
17
- process.exit(1);
18
- } else if (iosImportFound && isMac) {
19
- console.log('✅ iOS import detected (valid for macOS build).');
20
- } else {
21
- console.log('✅ No iOS-specific imports found (this is totally fine).');
22
- }
23
-
24
-
25
- 2) Statusbar color set in app startup is checked and through erro
26
-
27
- const STATUSBAR_FILE = path.resolve(__dirname, '../src/js/common-configuration.js');
28
- const STATUSBAR_REGEX = /^(?!\s*\/\/).*Capacitor\.Plugins\.StatusBar\.setStyle/m;
29
-
30
-
31
- const ONESIGNAL_OLD_FILES = [
32
- path.resolve(__dirname, '../src/js/onesignal-settings.js')
33
- ];
34
- const ONESIGNAL_VERSION_REGEX = /^onesignal-\d+(\.\d+)*\.js$/;
35
-
36
- ....
37
- ....
38
- ....
39
-
40
-
41
- const JS_ROOT = path.resolve(__dirname, '../src/js');
42
- const ONESIGNAL_DIR = path.join(JS_ROOT, 'onesignal');
43
-
44
- // 🚨 Block old OneSignal file locations (ONLY in src/js root)
45
- if (path.dirname(dir) === JS_ROOT) {
46
-
47
- // ❌ onesignal-settings.js
48
- if (ONESIGNAL_OLD_FILES.includes(dir)) {
49
- console.error(`\n❌ ERROR: onesignal-settings.js should not be in src/js/`);
50
- console.error(`📁 Move it to: src/js/onesignal/`);
51
- console.error(`📄 File: ${dir}\n`);
52
- process.exit(1);
53
- }
54
-
55
- // ❌ onesignal-x.x.js
56
- if (ONESIGNAL_VERSION_REGEX.test(baseName)) {
57
- console.error(`\n❌ ERROR: ${baseName} should not be in src/js/`);
58
- console.error(`📁 Move it to: src/js/onesignal/`);
59
- console.error(`📄 File: ${dir}\n`);
60
- process.exit(1);
61
- }
62
- }
63
-
64
- // 🚨 Special check ONLY for common-configuration.js
65
- if (dir === STATUSBAR_FILE) {
66
- let content = fs.readFileSync(dir, 'utf8');
67
-
68
- // 🧹 Remove ALL comments (single-line + multi-line)
69
- const contentWithoutComments = content
70
- .replace(/\/\/.*$/gm, '') // remove // comments
71
- .replace(/\/\*[\s\S]*?\*\//g, ''); // remove /* */ comments
72
-
73
- // ✅ Now check only real code
74
- if (contentWithoutComments.includes('Capacitor.Plugins.StatusBar.setStyle')) {
75
- console.error(`\n❌ ERROR: StatusBar.setStyle should NOT be used in common-configuration.js`);
76
- console.error(`🚫 iOS status bar is controlled via other methods. Remove this line.`);
77
- console.error(`📄 File: ${dir}\n`);
78
- process.exit(1);
79
- }
80
- }
81
-
82
-
83
- 3) Modification in "fix-onesignal-plugin.js" file
84
- Search following and that whole block added for add permission to "info.plist" file
85
- INFO.PLIST START
86
-
87
- 4) In "codeplayBeforeBuild-6.1.js" file following whole method is replaced. Due to add ads related permission to info.plist file
88
- updateInfoPlist()
89
-
1
+ Note: This changes are added with my old(current) code. Might we need to integrate this features into our new optimized code.
2
+
3
+ 1) If no import(saveToGalleryAndSaveAnyFile) found it through error issue is fixed
4
+ // iOS Checks
5
+ /* if (isMac && !iosImportFound) {
6
+ console.warn(`⚠️ WARNING: You're on macOS but no iOS version (saveToGalleryAndSaveAnyFile-x.x-ios.js) found.`);
7
+ process.exit(1);
8
+ } else if (isMac && iosImportFound) {
9
+ console.log('✅ iOS version detected for macOS build.');
10
+ } else if (!iosImportFound) {
11
+ console.log('✅ No iOS-specific imports detected for non-macOS.');
12
+ } */
13
+
14
+ // ✅ Only care if iOS import is found in NON-mac systems
15
+ if (iosImportFound && !isMac) {
16
+ console.error(`\n❌ ERROR: iOS-specific file is imported in non-macOS environment.`);
17
+ process.exit(1);
18
+ } else if (iosImportFound && isMac) {
19
+ console.log('✅ iOS import detected (valid for macOS build).');
20
+ } else {
21
+ console.log('✅ No iOS-specific imports found (this is totally fine).');
22
+ }
23
+
24
+
25
+ 2) Statusbar color set in app startup is checked and through erro
26
+
27
+ const STATUSBAR_FILE = path.resolve(__dirname, '../src/js/common-configuration.js');
28
+ const STATUSBAR_REGEX = /^(?!\s*\/\/).*Capacitor\.Plugins\.StatusBar\.setStyle/m;
29
+
30
+
31
+ const ONESIGNAL_OLD_FILES = [
32
+ path.resolve(__dirname, '../src/js/onesignal-settings.js')
33
+ ];
34
+ const ONESIGNAL_VERSION_REGEX = /^onesignal-\d+(\.\d+)*\.js$/;
35
+
36
+ ....
37
+ ....
38
+ ....
39
+
40
+
41
+ const JS_ROOT = path.resolve(__dirname, '../src/js');
42
+ const ONESIGNAL_DIR = path.join(JS_ROOT, 'onesignal');
43
+
44
+ // 🚨 Block old OneSignal file locations (ONLY in src/js root)
45
+ if (path.dirname(dir) === JS_ROOT) {
46
+
47
+ // ❌ onesignal-settings.js
48
+ if (ONESIGNAL_OLD_FILES.includes(dir)) {
49
+ console.error(`\n❌ ERROR: onesignal-settings.js should not be in src/js/`);
50
+ console.error(`📁 Move it to: src/js/onesignal/`);
51
+ console.error(`📄 File: ${dir}\n`);
52
+ process.exit(1);
53
+ }
54
+
55
+ // ❌ onesignal-x.x.js
56
+ if (ONESIGNAL_VERSION_REGEX.test(baseName)) {
57
+ console.error(`\n❌ ERROR: ${baseName} should not be in src/js/`);
58
+ console.error(`📁 Move it to: src/js/onesignal/`);
59
+ console.error(`📄 File: ${dir}\n`);
60
+ process.exit(1);
61
+ }
62
+ }
63
+
64
+ // 🚨 Special check ONLY for common-configuration.js
65
+ if (dir === STATUSBAR_FILE) {
66
+ let content = fs.readFileSync(dir, 'utf8');
67
+
68
+ // 🧹 Remove ALL comments (single-line + multi-line)
69
+ const contentWithoutComments = content
70
+ .replace(/\/\/.*$/gm, '') // remove // comments
71
+ .replace(/\/\*[\s\S]*?\*\//g, ''); // remove /* */ comments
72
+
73
+ // ✅ Now check only real code
74
+ if (contentWithoutComments.includes('Capacitor.Plugins.StatusBar.setStyle')) {
75
+ console.error(`\n❌ ERROR: StatusBar.setStyle should NOT be used in common-configuration.js`);
76
+ console.error(`🚫 iOS status bar is controlled via other methods. Remove this line.`);
77
+ console.error(`📄 File: ${dir}\n`);
78
+ process.exit(1);
79
+ }
80
+ }
81
+
82
+
83
+ 3) Modification in "fix-onesignal-plugin.js" file
84
+ Search following and that whole block added for add permission to "info.plist" file
85
+ INFO.PLIST START
86
+
87
+ 4) In "codeplayBeforeBuild-6.1.js" file following whole method is replaced. Due to add ads related permission to info.plist file
88
+ updateInfoPlist()
89
+
90
90
  5) The "checkPackageVersion()" metod is updated. Now check the "codeplay-common" latest version and uninstall/install automatically.