codeplay-common 4.11.34 → 4.11.37

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 (47) hide show
  1. package/CHANGELOG.md +115 -115
  2. package/LICENSE +21 -21
  3. package/README.md +6 -0
  4. package/RELEASE_NOTES.md +110 -110
  5. package/files/buildCodeplay/HUAWEI-PRIVACY.md +9 -9
  6. package/files/buildCodeplay/add-splash-screen.js +256 -256
  7. package/files/buildCodeplay/apk-store-builder.js +97 -97
  8. package/files/buildCodeplay/fix-onesignal-plugin.js +96 -96
  9. package/files/buildCodeplay/fix-optimize-builld/android-r8-rules.cjs +31 -31
  10. package/files/buildCodeplay/fix-optimize-builld/ffmpeg-jni-rules.cjs +28 -28
  11. package/files/buildCodeplay/fix-optimize-builld/fix-optimize-build.gradle +9 -9
  12. package/files/buildCodeplay/fix-optimize-builld/restore-android-r8-rules.cjs +30 -30
  13. package/files/buildCodeplay/huawei-privacy.cjs +102 -92
  14. package/files/buildCodeplay/iap-alias.cjs +116 -108
  15. package/files/buildCodeplay/ios-emi-admob-modification.js +24 -24
  16. package/files/buildCodeplay/manifestModification.js +38 -38
  17. package/files/buildCodeplay/migrate-system-bars.cjs +122 -122
  18. package/files/buildCodeplay/packageidBaseModification.js +528 -528
  19. package/files/buildCodeplay/project-scripts.cjs +69 -69
  20. package/files/buildCodeplay/ruads.cjs +10 -1
  21. package/files/buildCodeplay/setSplashAnimation.js +228 -228
  22. package/files/buildCodeplay/setup-ruads.cjs +9 -2
  23. package/files/buildCodeplay/splash-setup.cjs +88 -88
  24. package/files/buildCodeplay/splashxml/codeplay_splashScreen.xml +11 -11
  25. package/files/buildCodeplay/sync-admob-nextgen.js +219 -219
  26. package/files/buildCodeplay/tests/huawei-live-reload.test.cjs +60 -0
  27. package/files/buildCodeplay/tests/huawei-multiple-entries.test.cjs +80 -0
  28. package/files/buildCodeplay/tests/huawei-vite.test.cjs +38 -35
  29. package/files/buildCodeplay/versions.json +28 -28
  30. package/files/finalrelease +1365 -1365
  31. package/files/generate-ai-promo-video.js +23 -23
  32. package/files/ionic.config.json +6 -6
  33. package/files/scripts-common/run-codeplay-sync-after.js +21 -21
  34. package/files/scripts-common/screenshot/background-decorations.js +120 -120
  35. package/files/scripts-common/screenshot/frame-samples.js +117 -117
  36. package/files/scripts-common/setup-baseline-profile.js +291 -291
  37. package/files/take-screen-video.js +644 -644
  38. package/package.json +1 -1
  39. package/runtime/splash-ready.mjs +52 -52
  40. package/scripts/iap-alias.test.cjs +117 -78
  41. package/scripts/ruads-install.test.cjs +20 -3
  42. package/scripts/splash-setup.test.cjs +142 -142
  43. package/scripts/sync-files.js +119 -119
  44. package/scripts/system-bars-package.test.cjs +37 -37
  45. package/scripts/system-bars.test.cjs +93 -93
  46. package/scripts/uninstall.js +2 -2
  47. package/scripts/vite-build-settings.test.cjs +1 -0
@@ -1,117 +1,117 @@
1
- const fs = require('node:fs');
2
- const path = require('node:path');
3
- const sharp = require('sharp');
4
-
5
- const frameStyles = {
6
- android: {
7
- graphite: { label: 'A · Graphite Android', detail: 'Slim dark bezel', outer: '#151a24', edge: '#626d7f', inner: '#080b12', radius: 47 },
8
- cobalt: { label: 'B · Cobalt Android', detail: 'Blue accent bezel', outer: '#1945bc', edge: '#8aa9ff', inner: '#07102f', radius: 43 },
9
- },
10
- ios: {
11
- titanium: { label: 'C · Titanium iPhone', detail: 'Light metal edge', outer: '#c7ced6', edge: '#eef2f6', inner: '#222936', radius: 53 },
12
- midnight: { label: 'D · Midnight iPhone', detail: 'Dark rounded edge', outer: '#202333', edge: '#586076', inner: '#080b12', radius: 53 },
13
- },
14
- };
15
-
16
- function getStatusBarSvg(platform, time) {
17
- if (platform === 'ios') {
18
- return `<rect x="12" y="22" width="316" height="40" fill="#f5f7fc"/>
19
- <text x="29" y="47" font-family="Arial,sans-serif" font-size="14" font-weight="700" fill="#050505">${time}</text>
20
- <circle cx="246" cy="40" r="2" fill="#c5c7cb"/><circle cx="254" cy="40" r="2" fill="#c5c7cb"/>
21
- <circle cx="262" cy="40" r="2" fill="#c5c7cb"/><circle cx="270" cy="40" r="2" fill="#c5c7cb"/>
22
- <path d="M275 35 Q284 27 293 35 M278 39 Q284 34 290 39 M282 43 Q284 41 286 43" fill="none" stroke="#050505" stroke-width="2.5" stroke-linecap="round"/>
23
- <rect x="295" y="33" width="17" height="13" rx="3" fill="none" stroke="#a7aaae" stroke-width="1.5"/>
24
- <rect x="297" y="35" width="13" height="9" rx="2" fill="#050505"/>
25
- <rect x="313" y="37" width="2" height="5" rx="1" fill="#a7aaae"/>`;
26
- }
27
-
28
- return `<rect x="12" y="22" width="316" height="40" fill="#9075ed"/>
29
- <text x="29" y="47" font-family="Arial,sans-serif" font-size="14" fill="#ffffff">${time}</text>
30
- <circle cx="86" cy="41" r="5" fill="none" stroke="#ffffff" stroke-width="1.2"/>
31
- <circle cx="84" cy="40" r="0.8" fill="#ffffff"/><circle cx="88" cy="40" r="0.8" fill="#ffffff"/>
32
- <g transform="translate(-15,0)">
33
- <text x="200" y="36" font-family="Arial,sans-serif" font-size="7" font-weight="700" fill="#ffffff">0.26</text>
34
- <text x="200" y="44" font-family="Arial,sans-serif" font-size="6" font-weight="700" fill="#ffffff">KB/s</text>
35
- <path d="M222 43 L235 33 L235 43 Z M242 43 L254 33 L254 43 Z" fill="#ffffff"/>
36
- <text x="257" y="39" font-family="Arial,sans-serif" font-size="7" font-weight="700" fill="#ffffff">Vo</text>
37
- <text x="257" y="46" font-family="Arial,sans-serif" font-size="6" font-weight="700" fill="#ffffff">WiFi</text>
38
- <path d="M274 35 Q283 27 292 35 M277 39 Q283 34 289 39 M281 43 Q283 41 285 43" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round"/>
39
- <rect x="296" y="34" width="19" height="11" rx="2" fill="none" stroke="#ffffff" stroke-width="1.4"/>
40
- <path d="M305 33 L301 40 L306 40 L304 46 L312 38 L307 38 L310 33 Z" fill="#ffffff"/>
41
- <text x="317" y="43" font-family="Arial,sans-serif" font-size="7" fill="#ffffff">87%</text>
42
- </g>`;
43
- }
44
-
45
- function createFallbackScreenshot(platform) {
46
- const width = platform === 'ios' ? 1320 : 1080;
47
- const height = platform === 'ios' ? 2868 : 2400;
48
- const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}">
49
- <rect width="100%" height="100%" fill="#f5f7fc"/>
50
- <rect x="8%" y="26%" width="84%" height="20%" rx="60" fill="#d7ddff"/>
51
- <text x="50%" y="37%" text-anchor="middle" font-family="Arial,sans-serif" font-size="62" font-weight="700" fill="#4446c6">Image Compressor</text>
52
- <rect x="8%" y="62%" width="84%" height="8%" rx="55" fill="#5145e7"/>
53
- <text x="50%" y="67%" text-anchor="middle" font-family="Arial,sans-serif" font-size="42" font-weight="700" fill="#ffffff">Select images</text>
54
- </svg>`;
55
- return sharp(Buffer.from(svg)).png().toBuffer();
56
- }
57
-
58
- async function getSampleScreenshot(autoScreenshotDirectory, platform) {
59
- const directory = path.join(autoScreenshotDirectory, 'Store-image-Screenshot', platform === 'ios' ? 'iPhone' : 'Android');
60
- if (fs.existsSync(directory)) {
61
- const screenshot = fs.readdirSync(directory).filter((name) => /\.png$/i.test(name)).sort()[0];
62
- if (screenshot) return fs.readFileSync(path.join(directory, screenshot));
63
- }
64
- return createFallbackScreenshot(platform);
65
- }
66
-
67
- function createSampleCard(style, platform, screenshotUrl, index) {
68
- const screenRadius = platform === 'ios' ? 40 : 34;
69
- const sampleTime = platform === 'ios' ? (index ? '12:21' : '12:20') : (index ? '10:56' : '10:55');
70
- const camera = platform === 'ios'
71
- ? '<rect x="130" y="27" width="80" height="24" rx="12" fill="#05070b"/>'
72
- : '';
73
- const navigation = platform === 'android'
74
- ? '<rect x="12" y="717" width="316" height="16" fill="#f4f7f8"/><rect x="107" y="725" width="126" height="3" rx="1.5" fill="#7a7b7c"/>'
75
- : '';
76
-
77
- return `<g transform="translate(${index * 510},0)">
78
- <rect x="12" y="12" width="486" height="926" rx="25" fill="#ffffff" stroke="#dce2ee"/>
79
- <text x="35" y="52" fill="#172137" font-family="Arial,sans-serif" font-size="24" font-weight="700">${style.label}</text>
80
- <text x="35" y="80" fill="#6c7890" font-family="Arial,sans-serif" font-size="14">${style.detail} · ${platform === 'ios' ? 'iOS' : 'Android'} status bar</text>
81
- <g transform="translate(85,115)">
82
- <rect x="1" y="7" width="338" height="753" rx="47" fill="#0a1225" opacity="0.2"/>
83
- <rect x="1" y="1" width="338" height="753" rx="${style.radius}" fill="${style.outer}" stroke="${style.edge}" stroke-width="2"/>
84
- <rect x="7" y="7" width="326" height="741" rx="${style.radius - 5}" fill="${style.inner}"/>
85
- <clipPath id="screen-${index}"><rect x="12" y="22" width="316" height="711" rx="${screenRadius}"/></clipPath>
86
- <g clip-path="url(#screen-${index})">
87
- <rect x="12" y="22" width="316" height="711" fill="#f5f7fc"/>
88
- <image href="${screenshotUrl}" x="12" y="62" width="316" height="671" preserveAspectRatio="xMidYMin slice"/>
89
- ${getStatusBarSvg(platform, sampleTime)}
90
- ${navigation}
91
- </g>
92
- ${camera}
93
- <rect x="338" y="177" width="4" height="66" rx="2" fill="${style.edge}"/>
94
- </g>
95
- </g>`;
96
- }
97
-
98
- async function createFrameSamples(autoScreenshotDirectory) {
99
- fs.mkdirSync(autoScreenshotDirectory, { recursive: true });
100
- const paths = [];
101
-
102
- for (const platform of ['android', 'ios']) {
103
- const screenshot = await getSampleScreenshot(autoScreenshotDirectory, platform);
104
- const screenshotUrl = `data:image/png;base64,${screenshot.toString('base64')}`;
105
- const cards = Object.values(frameStyles[platform])
106
- .map((style, index) => createSampleCard(style, platform, screenshotUrl, index))
107
- .join('');
108
- const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="1020" height="950" viewBox="0 0 1020 950"><rect width="1020" height="950" fill="#eef2f9"/>${cards}</svg>`;
109
- const output = path.join(autoScreenshotDirectory, `${platform}-frame-options.png`);
110
- await sharp(Buffer.from(svg)).png().toFile(output);
111
- paths.push(output);
112
- }
113
-
114
- return paths;
115
- }
116
-
117
- module.exports = { frameStyles, createFrameSamples };
1
+ const fs = require('node:fs');
2
+ const path = require('node:path');
3
+ const sharp = require('sharp');
4
+
5
+ const frameStyles = {
6
+ android: {
7
+ graphite: { label: 'A · Graphite Android', detail: 'Slim dark bezel', outer: '#151a24', edge: '#626d7f', inner: '#080b12', radius: 47 },
8
+ cobalt: { label: 'B · Cobalt Android', detail: 'Blue accent bezel', outer: '#1945bc', edge: '#8aa9ff', inner: '#07102f', radius: 43 },
9
+ },
10
+ ios: {
11
+ titanium: { label: 'C · Titanium iPhone', detail: 'Light metal edge', outer: '#c7ced6', edge: '#eef2f6', inner: '#222936', radius: 53 },
12
+ midnight: { label: 'D · Midnight iPhone', detail: 'Dark rounded edge', outer: '#202333', edge: '#586076', inner: '#080b12', radius: 53 },
13
+ },
14
+ };
15
+
16
+ function getStatusBarSvg(platform, time) {
17
+ if (platform === 'ios') {
18
+ return `<rect x="12" y="22" width="316" height="40" fill="#f5f7fc"/>
19
+ <text x="29" y="47" font-family="Arial,sans-serif" font-size="14" font-weight="700" fill="#050505">${time}</text>
20
+ <circle cx="246" cy="40" r="2" fill="#c5c7cb"/><circle cx="254" cy="40" r="2" fill="#c5c7cb"/>
21
+ <circle cx="262" cy="40" r="2" fill="#c5c7cb"/><circle cx="270" cy="40" r="2" fill="#c5c7cb"/>
22
+ <path d="M275 35 Q284 27 293 35 M278 39 Q284 34 290 39 M282 43 Q284 41 286 43" fill="none" stroke="#050505" stroke-width="2.5" stroke-linecap="round"/>
23
+ <rect x="295" y="33" width="17" height="13" rx="3" fill="none" stroke="#a7aaae" stroke-width="1.5"/>
24
+ <rect x="297" y="35" width="13" height="9" rx="2" fill="#050505"/>
25
+ <rect x="313" y="37" width="2" height="5" rx="1" fill="#a7aaae"/>`;
26
+ }
27
+
28
+ return `<rect x="12" y="22" width="316" height="40" fill="#9075ed"/>
29
+ <text x="29" y="47" font-family="Arial,sans-serif" font-size="14" fill="#ffffff">${time}</text>
30
+ <circle cx="86" cy="41" r="5" fill="none" stroke="#ffffff" stroke-width="1.2"/>
31
+ <circle cx="84" cy="40" r="0.8" fill="#ffffff"/><circle cx="88" cy="40" r="0.8" fill="#ffffff"/>
32
+ <g transform="translate(-15,0)">
33
+ <text x="200" y="36" font-family="Arial,sans-serif" font-size="7" font-weight="700" fill="#ffffff">0.26</text>
34
+ <text x="200" y="44" font-family="Arial,sans-serif" font-size="6" font-weight="700" fill="#ffffff">KB/s</text>
35
+ <path d="M222 43 L235 33 L235 43 Z M242 43 L254 33 L254 43 Z" fill="#ffffff"/>
36
+ <text x="257" y="39" font-family="Arial,sans-serif" font-size="7" font-weight="700" fill="#ffffff">Vo</text>
37
+ <text x="257" y="46" font-family="Arial,sans-serif" font-size="6" font-weight="700" fill="#ffffff">WiFi</text>
38
+ <path d="M274 35 Q283 27 292 35 M277 39 Q283 34 289 39 M281 43 Q283 41 285 43" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round"/>
39
+ <rect x="296" y="34" width="19" height="11" rx="2" fill="none" stroke="#ffffff" stroke-width="1.4"/>
40
+ <path d="M305 33 L301 40 L306 40 L304 46 L312 38 L307 38 L310 33 Z" fill="#ffffff"/>
41
+ <text x="317" y="43" font-family="Arial,sans-serif" font-size="7" fill="#ffffff">87%</text>
42
+ </g>`;
43
+ }
44
+
45
+ function createFallbackScreenshot(platform) {
46
+ const width = platform === 'ios' ? 1320 : 1080;
47
+ const height = platform === 'ios' ? 2868 : 2400;
48
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}">
49
+ <rect width="100%" height="100%" fill="#f5f7fc"/>
50
+ <rect x="8%" y="26%" width="84%" height="20%" rx="60" fill="#d7ddff"/>
51
+ <text x="50%" y="37%" text-anchor="middle" font-family="Arial,sans-serif" font-size="62" font-weight="700" fill="#4446c6">Image Compressor</text>
52
+ <rect x="8%" y="62%" width="84%" height="8%" rx="55" fill="#5145e7"/>
53
+ <text x="50%" y="67%" text-anchor="middle" font-family="Arial,sans-serif" font-size="42" font-weight="700" fill="#ffffff">Select images</text>
54
+ </svg>`;
55
+ return sharp(Buffer.from(svg)).png().toBuffer();
56
+ }
57
+
58
+ async function getSampleScreenshot(autoScreenshotDirectory, platform) {
59
+ const directory = path.join(autoScreenshotDirectory, 'Store-image-Screenshot', platform === 'ios' ? 'iPhone' : 'Android');
60
+ if (fs.existsSync(directory)) {
61
+ const screenshot = fs.readdirSync(directory).filter((name) => /\.png$/i.test(name)).sort()[0];
62
+ if (screenshot) return fs.readFileSync(path.join(directory, screenshot));
63
+ }
64
+ return createFallbackScreenshot(platform);
65
+ }
66
+
67
+ function createSampleCard(style, platform, screenshotUrl, index) {
68
+ const screenRadius = platform === 'ios' ? 40 : 34;
69
+ const sampleTime = platform === 'ios' ? (index ? '12:21' : '12:20') : (index ? '10:56' : '10:55');
70
+ const camera = platform === 'ios'
71
+ ? '<rect x="130" y="27" width="80" height="24" rx="12" fill="#05070b"/>'
72
+ : '';
73
+ const navigation = platform === 'android'
74
+ ? '<rect x="12" y="717" width="316" height="16" fill="#f4f7f8"/><rect x="107" y="725" width="126" height="3" rx="1.5" fill="#7a7b7c"/>'
75
+ : '';
76
+
77
+ return `<g transform="translate(${index * 510},0)">
78
+ <rect x="12" y="12" width="486" height="926" rx="25" fill="#ffffff" stroke="#dce2ee"/>
79
+ <text x="35" y="52" fill="#172137" font-family="Arial,sans-serif" font-size="24" font-weight="700">${style.label}</text>
80
+ <text x="35" y="80" fill="#6c7890" font-family="Arial,sans-serif" font-size="14">${style.detail} · ${platform === 'ios' ? 'iOS' : 'Android'} status bar</text>
81
+ <g transform="translate(85,115)">
82
+ <rect x="1" y="7" width="338" height="753" rx="47" fill="#0a1225" opacity="0.2"/>
83
+ <rect x="1" y="1" width="338" height="753" rx="${style.radius}" fill="${style.outer}" stroke="${style.edge}" stroke-width="2"/>
84
+ <rect x="7" y="7" width="326" height="741" rx="${style.radius - 5}" fill="${style.inner}"/>
85
+ <clipPath id="screen-${index}"><rect x="12" y="22" width="316" height="711" rx="${screenRadius}"/></clipPath>
86
+ <g clip-path="url(#screen-${index})">
87
+ <rect x="12" y="22" width="316" height="711" fill="#f5f7fc"/>
88
+ <image href="${screenshotUrl}" x="12" y="62" width="316" height="671" preserveAspectRatio="xMidYMin slice"/>
89
+ ${getStatusBarSvg(platform, sampleTime)}
90
+ ${navigation}
91
+ </g>
92
+ ${camera}
93
+ <rect x="338" y="177" width="4" height="66" rx="2" fill="${style.edge}"/>
94
+ </g>
95
+ </g>`;
96
+ }
97
+
98
+ async function createFrameSamples(autoScreenshotDirectory) {
99
+ fs.mkdirSync(autoScreenshotDirectory, { recursive: true });
100
+ const paths = [];
101
+
102
+ for (const platform of ['android', 'ios']) {
103
+ const screenshot = await getSampleScreenshot(autoScreenshotDirectory, platform);
104
+ const screenshotUrl = `data:image/png;base64,${screenshot.toString('base64')}`;
105
+ const cards = Object.values(frameStyles[platform])
106
+ .map((style, index) => createSampleCard(style, platform, screenshotUrl, index))
107
+ .join('');
108
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="1020" height="950" viewBox="0 0 1020 950"><rect width="1020" height="950" fill="#eef2f9"/>${cards}</svg>`;
109
+ const output = path.join(autoScreenshotDirectory, `${platform}-frame-options.png`);
110
+ await sharp(Buffer.from(svg)).png().toFile(output);
111
+ paths.push(output);
112
+ }
113
+
114
+ return paths;
115
+ }
116
+
117
+ module.exports = { frameStyles, createFrameSamples };