codeplay-common 4.11.35 → 4.11.38

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 (63) hide show
  1. package/CHANGELOG.md +115 -115
  2. package/LICENSE +21 -21
  3. package/README.md +408 -374
  4. package/RELEASE_NOTES.md +97 -97
  5. package/files/buildCodeplay/HUAWEI-PRIVACY.md +9 -9
  6. package/files/buildCodeplay/add-splash-screen.js +255 -255
  7. package/files/buildCodeplay/apk-store-builder.js +97 -97
  8. package/files/buildCodeplay/codeplayBeforeBuild.js +4793 -4793
  9. package/files/buildCodeplay/disabled-ads.mjs +53 -53
  10. package/files/buildCodeplay/ensure-current-build.cjs +42 -42
  11. package/files/buildCodeplay/fix-onesignal-plugin.js +96 -96
  12. package/files/buildCodeplay/huawei-privacy-entry.js +135 -135
  13. package/files/buildCodeplay/huawei-privacy.cjs +102 -92
  14. package/files/buildCodeplay/huawei-privacy.css +22 -22
  15. package/files/buildCodeplay/iap-alias.cjs +116 -116
  16. package/files/buildCodeplay/ios-ad-consent.cjs +56 -56
  17. package/files/buildCodeplay/ios-emi-admob-modification.js +49 -49
  18. package/files/buildCodeplay/manifestModification.js +38 -38
  19. package/files/buildCodeplay/migrate-system-bars.cjs +122 -122
  20. package/files/buildCodeplay/newly added.txt +89 -89
  21. package/files/buildCodeplay/non-google-billing.pro +3 -3
  22. package/files/buildCodeplay/packageidBaseModification.js +528 -528
  23. package/files/buildCodeplay/project-scripts.cjs +69 -69
  24. package/files/buildCodeplay/release-sync.config.json +4 -4
  25. package/files/buildCodeplay/remove-force-kotlin-disable.js +43 -43
  26. package/files/buildCodeplay/ruads.cjs +220 -211
  27. package/files/buildCodeplay/saf-mediastore-dependency.cjs +21 -21
  28. package/files/buildCodeplay/setSplashAnimation.js +226 -226
  29. package/files/buildCodeplay/setup-ruads.cjs +62 -55
  30. package/files/buildCodeplay/splashxml/codeplay_splashScreen.xml +11 -11
  31. package/files/buildCodeplay/store-billing.cjs +43 -43
  32. package/files/buildCodeplay/sync-admob-nextgen.js +219 -219
  33. package/files/buildCodeplay/tests/huawei-live-reload.test.cjs +60 -0
  34. package/files/buildCodeplay/tests/huawei-multiple-entries.test.cjs +80 -0
  35. package/files/buildCodeplay/tests/huawei-privacy.test.cjs +49 -49
  36. package/files/buildCodeplay/tests/huawei-vite.test.cjs +38 -35
  37. package/files/buildCodeplay/versions.json +28 -28
  38. package/files/finalrelease +1365 -1365
  39. package/files/generate-ai-promo-video.js +23 -23
  40. package/files/ionic.config.json +6 -6
  41. package/files/scripts-common/collect-startup-profile.js +134 -0
  42. package/files/scripts-common/generate-baseline-profile.js +194 -22
  43. package/files/scripts-common/run-codeplay-sync-after.js +21 -21
  44. package/files/scripts-common/screenshot/background-decorations.js +120 -120
  45. package/files/scripts-common/screenshot/frame-samples.js +117 -117
  46. package/files/scripts-common/setup-baseline-profile.js +291 -291
  47. package/files/take-screen-image.js +4414 -4414
  48. package/files/take-screen-video.js +644 -644
  49. package/package.json +29 -29
  50. package/runtime/vk-ads/vk-ad-configuration.json +39 -39
  51. package/scripts/baseline-profile.test.cjs +189 -0
  52. package/scripts/ensure-current-build.test.cjs +76 -76
  53. package/scripts/iap-alias.test.cjs +117 -117
  54. package/scripts/ios-ad-consent.test.cjs +99 -99
  55. package/scripts/ruads-install.test.cjs +197 -180
  56. package/scripts/ruads-policy.test.cjs +174 -174
  57. package/scripts/saf-mediastore-dependency.test.cjs +44 -44
  58. package/scripts/squeezeback-config.test.cjs +78 -78
  59. package/scripts/sync-files.js +120 -120
  60. package/scripts/system-bars-package.test.cjs +38 -38
  61. package/scripts/system-bars.test.cjs +93 -93
  62. package/scripts/uninstall.js +2 -2
  63. package/scripts/vite-build-settings.test.cjs +93 -92
@@ -1,69 +1,69 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const tasks = {
4
- 'before-build': 'node buildCodeplay/codeplayBeforeBuild.js',
5
- 'package-id': 'node buildCodeplay/packageidBaseModification.js',
6
- 'splash': 'node buildCodeplay/add-splash-screen.js',
7
- 'splash-animation': 'node buildCodeplay/setSplashAnimation.js',
8
- 'manifest': 'node buildCodeplay/manifestModification.js',
9
- 'admob-sync': 'node buildCodeplay/sync-admob-nextgen.js',
10
- 'apk': 'node buildCodeplay/apk-store-builder.js',
11
- 'final-release': 'node finalrelease',
12
- };
13
- const syncAfter = `${tasks.splash} && ${tasks['splash-animation']} && ${tasks.manifest} && node scripts-common/setup-baseline-profile.js`;
14
- function updateBuildScripts(scripts) {
15
- const next = { ...scripts };
16
- for (const key of Object.keys(next)) {
17
- if (typeof next[key] !== 'string') continue;
18
- next[key] = next[key].replace(/(^|[\s"'=])(\.\/)?scripts\//g, '$1$2scripts-common/');
19
- next[key] = next[key].replace(/node\s+node_modules\/codeplay-common\/scripts\/run\.cjs\s+([\w-]+)/g, (match, task) => tasks[task] || (task === 'sync-after' ? syncAfter : match))
20
- .replace(/buildCodeplay\/(codeplayBeforeBuild|packageidBaseModification|add-splash-screen|setSplashAnimation)-\d+(?:\.\d+)*\.(?:js|mjs)/g, 'buildCodeplay/$1.js')
21
- .replace(/node\s+iap-install-\d+(?:\.\d+)*\.js/g, tasks['before-build']);
22
- }
23
- if (!next.build) next.build = `${tasks['before-build']} && ${tasks['package-id']} && cross-env NODE_ENV=production vite build --logLevel warn`;
24
- else if (!next.build.includes(tasks['before-build'])) next.build = `${tasks['before-build']} && ${next.build}`;
25
- for (const id of [1, 2, 3, 4, 5, 7, 8, 10]) {
26
- const key = `build:storeid${id}`;
27
- if (!next[key]) next[key] = `vite build --mode storeid${id}`;
28
- if (!next[key].includes(tasks['before-build'])) next[key] = `cross-env VITE_STORE_ID=${id} ${tasks['before-build']} && cross-env VITE_STORE_ID=${id} ${next[key]}`;
29
- if (!next[key].includes(tasks['package-id'])) next[key] = next[key].replace(tasks['before-build'], `${tasks['before-build']} && ${tasks['package-id']}`);
30
- }
31
- if (next['build:storeid6'] && !next['build:storeid6'].includes(tasks['before-build'])) next['build:storeid6'] = `cross-env CODEPLAY_BUILD_PLATFORM=ios VITE_STORE_ID=6 ${tasks['before-build']} && cross-env VITE_STORE_ID=6 ${next['build:storeid6']}`;
32
- next['build:ios'] = next['build:ios'] || 'cross-env CODEPLAY_BUILD_PLATFORM=ios VITE_STORE_ID=6 npm run build';
33
- if (!/VITE_STORE_ID=6\b/.test(next['build:ios'])) next['build:ios'] = next['build:ios'].replace('CODEPLAY_BUILD_PLATFORM=ios ', 'CODEPLAY_BUILD_PLATFORM=ios VITE_STORE_ID=6 ');
34
- next['capacitor:sync:after'] = next['capacitor:sync:after'] || syncAfter;
35
- const safDependency = 'node buildCodeplay/saf-mediastore-dependency.cjs';
36
- for (const hook of ['capacitor:sync:before', 'capacitor:update:before']) {
37
- if (!(next[hook] || '').includes(safDependency)) {
38
- next[hook] = next[hook] ? `${safDependency} && ${next[hook]}` : safDependency;
39
- }
40
- }
41
- next['build-capacitor-android'] = next['build-capacitor-android'] || 'npm run build && npx cap copy android';
42
- next['build-capacitor-ios'] = next['build-capacitor-ios']
43
- ? next['build-capacitor-ios'].replace(/^(?:cross-env\s+NODE_ENV=production\s+)?vite\s+build(?=\s*&&\s*npx\s+cap\s+copy\s+ios\b)/, 'npm run build:ios')
44
- : 'npm run build:ios && npx cap copy ios';
45
- next['ionic:build'] = next['ionic:build'] || 'npm run build';
46
- next['ionic:serve'] = next['ionic:serve'] || 'cross-env NODE_ENV=development vite';
47
- next['baseline-profile:setup'] = next['baseline-profile:setup'] || 'node scripts-common/setup-baseline-profile.js';
48
- const r8Command = next['android:r8-rules'];
49
- if (!r8Command || r8Command === 'node buildCodeplay/android-r8-rules.cjs' || /^node\s+(?:\.\/)?(?:Scripts|scripts|scripts-common)\/restore-android-r8-rules\.cjs$/.test(r8Command)) {
50
- next['android:r8-rules'] = 'node buildCodeplay/fix-optimize-builld/restore-android-r8-rules.cjs';
51
- }
52
- if (!next['baseline-profile:generate'] || next['baseline-profile:generate'] === 'cd android && gradlew.bat :app:generateBaselineProfile --console=plain') {
53
- next['baseline-profile:generate'] = 'node scripts-common/generate-baseline-profile.js';
54
- }
55
- next.release = next.release || 'node finalrelease';
56
- return next;
57
- }
58
- function removeVersionedBuildScripts(projectRoot) {
59
- const directory = path.resolve(projectRoot, 'buildCodeplay');
60
- if (!fs.existsSync(directory)) return;
61
- if (fs.lstatSync(directory).isSymbolicLink()) throw new Error('Refusing to clean a linked buildCodeplay directory.');
62
- for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
63
- if (!entry.isFile() || (entry.name !== 'sync-startup.cjs' && !/^(?:codeplayBeforeBuild|packageidBaseModification|add-splash-screen|setSplashAnimation)-\d+(?:\.\d+)*\.(?:js|mjs)$/.test(entry.name))) continue;
64
- const target = path.resolve(directory, entry.name);
65
- if (path.dirname(target) !== directory) throw new Error('Invalid legacy build path.');
66
- fs.unlinkSync(target);
67
- }
68
- }
69
- module.exports = { updateBuildScripts, removeVersionedBuildScripts };
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const tasks = {
4
+ 'before-build': 'node buildCodeplay/codeplayBeforeBuild.js',
5
+ 'package-id': 'node buildCodeplay/packageidBaseModification.js',
6
+ 'splash': 'node buildCodeplay/add-splash-screen.js',
7
+ 'splash-animation': 'node buildCodeplay/setSplashAnimation.js',
8
+ 'manifest': 'node buildCodeplay/manifestModification.js',
9
+ 'admob-sync': 'node buildCodeplay/sync-admob-nextgen.js',
10
+ 'apk': 'node buildCodeplay/apk-store-builder.js',
11
+ 'final-release': 'node finalrelease',
12
+ };
13
+ const syncAfter = `${tasks.splash} && ${tasks['splash-animation']} && ${tasks.manifest} && node scripts-common/setup-baseline-profile.js`;
14
+ function updateBuildScripts(scripts) {
15
+ const next = { ...scripts };
16
+ for (const key of Object.keys(next)) {
17
+ if (typeof next[key] !== 'string') continue;
18
+ next[key] = next[key].replace(/(^|[\s"'=])(\.\/)?scripts\//g, '$1$2scripts-common/');
19
+ next[key] = next[key].replace(/node\s+node_modules\/codeplay-common\/scripts\/run\.cjs\s+([\w-]+)/g, (match, task) => tasks[task] || (task === 'sync-after' ? syncAfter : match))
20
+ .replace(/buildCodeplay\/(codeplayBeforeBuild|packageidBaseModification|add-splash-screen|setSplashAnimation)-\d+(?:\.\d+)*\.(?:js|mjs)/g, 'buildCodeplay/$1.js')
21
+ .replace(/node\s+iap-install-\d+(?:\.\d+)*\.js/g, tasks['before-build']);
22
+ }
23
+ if (!next.build) next.build = `${tasks['before-build']} && ${tasks['package-id']} && cross-env NODE_ENV=production vite build --logLevel warn`;
24
+ else if (!next.build.includes(tasks['before-build'])) next.build = `${tasks['before-build']} && ${next.build}`;
25
+ for (const id of [1, 2, 3, 4, 5, 7, 8, 10]) {
26
+ const key = `build:storeid${id}`;
27
+ if (!next[key]) next[key] = `vite build --mode storeid${id}`;
28
+ if (!next[key].includes(tasks['before-build'])) next[key] = `cross-env VITE_STORE_ID=${id} ${tasks['before-build']} && cross-env VITE_STORE_ID=${id} ${next[key]}`;
29
+ if (!next[key].includes(tasks['package-id'])) next[key] = next[key].replace(tasks['before-build'], `${tasks['before-build']} && ${tasks['package-id']}`);
30
+ }
31
+ if (next['build:storeid6'] && !next['build:storeid6'].includes(tasks['before-build'])) next['build:storeid6'] = `cross-env CODEPLAY_BUILD_PLATFORM=ios VITE_STORE_ID=6 ${tasks['before-build']} && cross-env VITE_STORE_ID=6 ${next['build:storeid6']}`;
32
+ next['build:ios'] = next['build:ios'] || 'cross-env CODEPLAY_BUILD_PLATFORM=ios VITE_STORE_ID=6 npm run build';
33
+ if (!/VITE_STORE_ID=6\b/.test(next['build:ios'])) next['build:ios'] = next['build:ios'].replace('CODEPLAY_BUILD_PLATFORM=ios ', 'CODEPLAY_BUILD_PLATFORM=ios VITE_STORE_ID=6 ');
34
+ next['capacitor:sync:after'] = next['capacitor:sync:after'] || syncAfter;
35
+ const safDependency = 'node buildCodeplay/saf-mediastore-dependency.cjs';
36
+ for (const hook of ['capacitor:sync:before', 'capacitor:update:before']) {
37
+ if (!(next[hook] || '').includes(safDependency)) {
38
+ next[hook] = next[hook] ? `${safDependency} && ${next[hook]}` : safDependency;
39
+ }
40
+ }
41
+ next['build-capacitor-android'] = next['build-capacitor-android'] || 'npm run build && npx cap copy android';
42
+ next['build-capacitor-ios'] = next['build-capacitor-ios']
43
+ ? next['build-capacitor-ios'].replace(/^(?:cross-env\s+NODE_ENV=production\s+)?vite\s+build(?=\s*&&\s*npx\s+cap\s+copy\s+ios\b)/, 'npm run build:ios')
44
+ : 'npm run build:ios && npx cap copy ios';
45
+ next['ionic:build'] = next['ionic:build'] || 'npm run build';
46
+ next['ionic:serve'] = next['ionic:serve'] || 'cross-env NODE_ENV=development vite';
47
+ next['baseline-profile:setup'] = next['baseline-profile:setup'] || 'node scripts-common/setup-baseline-profile.js';
48
+ const r8Command = next['android:r8-rules'];
49
+ if (!r8Command || r8Command === 'node buildCodeplay/android-r8-rules.cjs' || /^node\s+(?:\.\/)?(?:Scripts|scripts|scripts-common)\/restore-android-r8-rules\.cjs$/.test(r8Command)) {
50
+ next['android:r8-rules'] = 'node buildCodeplay/fix-optimize-builld/restore-android-r8-rules.cjs';
51
+ }
52
+ if (!next['baseline-profile:generate'] || next['baseline-profile:generate'] === 'cd android && gradlew.bat :app:generateBaselineProfile --console=plain') {
53
+ next['baseline-profile:generate'] = 'node scripts-common/generate-baseline-profile.js';
54
+ }
55
+ next.release = next.release || 'node finalrelease';
56
+ return next;
57
+ }
58
+ function removeVersionedBuildScripts(projectRoot) {
59
+ const directory = path.resolve(projectRoot, 'buildCodeplay');
60
+ if (!fs.existsSync(directory)) return;
61
+ if (fs.lstatSync(directory).isSymbolicLink()) throw new Error('Refusing to clean a linked buildCodeplay directory.');
62
+ for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
63
+ if (!entry.isFile() || (entry.name !== 'sync-startup.cjs' && !/^(?:codeplayBeforeBuild|packageidBaseModification|add-splash-screen|setSplashAnimation)-\d+(?:\.\d+)*\.(?:js|mjs)$/.test(entry.name))) continue;
64
+ const target = path.resolve(directory, entry.name);
65
+ if (path.dirname(target) !== directory) throw new Error('Invalid legacy build path.');
66
+ fs.unlinkSync(target);
67
+ }
68
+ }
69
+ module.exports = { updateBuildScripts, removeVersionedBuildScripts };
@@ -1,4 +1,4 @@
1
- {
2
- "url": "https://htmlcodeplay.com/codeplay/api/v1/release/sync",
3
- "token": ""
4
- }
1
+ {
2
+ "url": "https://htmlcodeplay.com/codeplay/api/v1/release/sync",
3
+ "token": ""
4
+ }
@@ -1,43 +1,43 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const legacyPluginXmlPath = path.resolve(
5
- __dirname,
6
- '../node_modules/emi-indo-cordova-plugin-admob/plugin.xml'
7
- );
8
-
9
- const nextGenPackagePath = path.resolve(
10
- __dirname,
11
- '../node_modules/capacitor-admob-nextgen/package.json'
12
- );
13
-
14
- if (!fs.existsSync(legacyPluginXmlPath)) {
15
- if (fs.existsSync(nextGenPackagePath)) {
16
- console.log('ℹ️ Skipping legacy Kotlin patch. capacitor-admob-nextgen is installed and does not use plugin.xml.');
17
- process.exit(0);
18
- }
19
-
20
- console.log('ℹ️ Legacy AdMob plugin.xml not found, skipping Kotlin patch.');
21
- process.exit(0);
22
- }
23
-
24
- fs.readFile(legacyPluginXmlPath, 'utf8', (err, data) => {
25
- if (err) {
26
- console.error('Error reading plugin.xml:', err);
27
- process.exit(1);
28
- }
29
-
30
- const modifiedData = data.replace(
31
- /<framework\s+src="src\/android\/force-kotlin\.gradle"\s+custom="true"\s+type="gradleReference"\s*\/>\s*\n?/g,
32
- ''
33
- );
34
-
35
- fs.writeFile(legacyPluginXmlPath, modifiedData, 'utf8', (writeErr) => {
36
- if (writeErr) {
37
- console.error('Error writing plugin.xml:', writeErr);
38
- process.exit(1);
39
- }
40
-
41
- console.log('plugin.xml updated successfully.');
42
- });
43
- });
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ const legacyPluginXmlPath = path.resolve(
5
+ __dirname,
6
+ '../node_modules/emi-indo-cordova-plugin-admob/plugin.xml'
7
+ );
8
+
9
+ const nextGenPackagePath = path.resolve(
10
+ __dirname,
11
+ '../node_modules/capacitor-admob-nextgen/package.json'
12
+ );
13
+
14
+ if (!fs.existsSync(legacyPluginXmlPath)) {
15
+ if (fs.existsSync(nextGenPackagePath)) {
16
+ console.log('ℹ️ Skipping legacy Kotlin patch. capacitor-admob-nextgen is installed and does not use plugin.xml.');
17
+ process.exit(0);
18
+ }
19
+
20
+ console.log('ℹ️ Legacy AdMob plugin.xml not found, skipping Kotlin patch.');
21
+ process.exit(0);
22
+ }
23
+
24
+ fs.readFile(legacyPluginXmlPath, 'utf8', (err, data) => {
25
+ if (err) {
26
+ console.error('Error reading plugin.xml:', err);
27
+ process.exit(1);
28
+ }
29
+
30
+ const modifiedData = data.replace(
31
+ /<framework\s+src="src\/android\/force-kotlin\.gradle"\s+custom="true"\s+type="gradleReference"\s*\/>\s*\n?/g,
32
+ ''
33
+ );
34
+
35
+ fs.writeFile(legacyPluginXmlPath, modifiedData, 'utf8', (writeErr) => {
36
+ if (writeErr) {
37
+ console.error('Error writing plugin.xml:', writeErr);
38
+ process.exit(1);
39
+ }
40
+
41
+ console.log('plugin.xml updated successfully.');
42
+ });
43
+ });