codeplay-common 4.7.1 → 4.7.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.
- package/.gitattributes +2 -2
- package/LICENSE +21 -21
- package/README.md +120 -120
- package/files/buildCodeplay/codeplayBeforeBuild-6.3.js +58 -0
- package/files/buildCodeplay/release-sync.config.json +4 -4
- package/files/finalrelease +49 -49
- package/files/generate-ai-promo-video.js +23 -23
- package/files/iap-install-2.js +145 -145
- package/files/ionic.config.json +6 -6
- package/files/scripts/setup-baseline-profile.js +262 -262
- package/files/take-screen-video.js +644 -644
- package/package.json +15 -15
- package/scripts/sync-files.js +103 -103
- package/scripts/uninstall.js +109 -109
package/.gitattributes
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
# Auto detect text files and perform LF normalization
|
|
2
|
-
* text=auto
|
|
1
|
+
# Auto detect text files and perform LF normalization
|
|
2
|
+
* text=auto
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Merbin Joe
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Merbin Joe
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
# codeplay-common
|
|
2
|
-
Everything automatted in Capacitor apps, easy to maintain many apps in capacitor. It will reduce your 40% of work, with common file code.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Easy add splashscreen and set animation
|
|
6
|
-
Admob id automatically from capacitor.config.json file
|
|
7
|
-
Make three build file for different store as per our requirement
|
|
8
|
-
Based on store install various IAP plugins
|
|
9
|
-
Make it to ionic project
|
|
10
|
-
|
|
11
|
-
## Agent instructions
|
|
12
|
-
|
|
13
|
-
Agent instructions are updated during `npm run build`, not during npm installation.
|
|
14
|
-
The build script reads the `agents` version from
|
|
15
|
-
`https://htmlcodeplay.com/code-play-plugin/versions.json` and downloads the matching
|
|
16
|
-
`agents-<version>.zip` archive when the project has no agent instructions or the
|
|
17
|
-
server version is newer.
|
|
18
|
-
|
|
19
|
-
The ZIP root must contain `AGENTS.md` and `AGENTS/`. These are copied directly to
|
|
20
|
-
the project root. The installed version is stored in `AGENTS/.codeplay-version`.
|
|
21
|
-
Existing files with matching names are replaced; project-only files with other
|
|
22
|
-
names inside `AGENTS/` are preserved.
|
|
23
|
-
|
|
24
|
-
For example, publish `agents-1.1.zip` and add this entry to the server's
|
|
25
|
-
`versions.json`:
|
|
26
|
-
|
|
27
|
-
```json
|
|
28
|
-
"agents": "1.1"
|
|
29
|
-
```
|
|
30
|
-
|
|
1
|
+
# codeplay-common
|
|
2
|
+
Everything automatted in Capacitor apps, easy to maintain many apps in capacitor. It will reduce your 40% of work, with common file code.
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Easy add splashscreen and set animation
|
|
6
|
+
Admob id automatically from capacitor.config.json file
|
|
7
|
+
Make three build file for different store as per our requirement
|
|
8
|
+
Based on store install various IAP plugins
|
|
9
|
+
Make it to ionic project
|
|
10
|
+
|
|
11
|
+
## Agent instructions
|
|
12
|
+
|
|
13
|
+
Agent instructions are updated during `npm run build`, not during npm installation.
|
|
14
|
+
The build script reads the `agents` version from
|
|
15
|
+
`https://htmlcodeplay.com/code-play-plugin/versions.json` and downloads the matching
|
|
16
|
+
`agents-<version>.zip` archive when the project has no agent instructions or the
|
|
17
|
+
server version is newer.
|
|
18
|
+
|
|
19
|
+
The ZIP root must contain `AGENTS.md` and `AGENTS/`. These are copied directly to
|
|
20
|
+
the project root. The installed version is stored in `AGENTS/.codeplay-version`.
|
|
21
|
+
Existing files with matching names are replaced; project-only files with other
|
|
22
|
+
names inside `AGENTS/` are preserved.
|
|
23
|
+
|
|
24
|
+
For example, publish `agents-1.1.zip` and add this entry to the server's
|
|
25
|
+
`versions.json`:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
"agents": "1.1"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
31
|
Donate to get full code including many common functions
|
|
32
32
|
https://ko-fi.com/codeplay
|
|
33
33
|
|
|
@@ -37,93 +37,93 @@ Version 4.6.1
|
|
|
37
37
|
|
|
38
38
|
4.2.8
|
|
39
39
|
baseline profile code modifications
|
|
40
|
-
|
|
41
|
-
Version 4.2.3
|
|
42
|
-
Added build warning confirmation when android.ORIENTATION is not "auto" or android.RESIZEABLE_ACTIVITY is not true.
|
|
43
|
-
|
|
44
|
-
Version 4.2.2
|
|
45
|
-
Added "bannerDisabledPages" property and its default value
|
|
46
|
-
The admob configuration default value priority is updated
|
|
47
|
-
|
|
48
|
-
Version 4.2.1
|
|
49
|
-
Updated AdMob nextgen file validation to match admob-emi-nextgen file names.
|
|
50
|
-
|
|
51
|
-
Version 4.2.0
|
|
52
|
-
Firebase related automatic changes updated
|
|
53
|
-
|
|
54
|
-
Version 4.1.9
|
|
55
|
-
Added AdMob nextgen 1.7 validation/default support for "overlappingHeight", "bannerTypeAndroidLandscape", and "bannerTypeiOSLandscape".
|
|
56
|
-
|
|
57
|
-
Version 4.1.8
|
|
58
|
-
"consentDebug: false" is added
|
|
59
|
-
|
|
60
|
-
Version 4.1.7
|
|
61
|
-
admob configuration automatically added.
|
|
62
|
-
|
|
63
|
-
Version 4.1.6
|
|
64
|
-
"setup-baseline-profile.js" modification, duplicate validation error fixed
|
|
65
|
-
|
|
66
|
-
Version 4.1.5
|
|
67
|
-
While isTesting is true it is not validated from our new configuration admob file, now it is solved
|
|
68
|
-
|
|
69
|
-
Version 4.1.4
|
|
70
|
-
hardcoded version is removed for the admob-emi-nextgen
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Version 4.1.3
|
|
74
|
-
"consentDebug": false automatically adds if not
|
|
75
|
-
|
|
76
|
-
Version 4.1.2
|
|
77
|
-
Speedup
|
|
78
|
-
|
|
79
|
-
Version 4.1.1
|
|
80
|
-
Auto admob integration updated
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
version 4.0.9
|
|
84
|
-
packageJson.scripts["ionic:serve"] = "cross-env NODE_ENV=development vite"; this line updated in "sync-files.js"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
version 4.0.8
|
|
88
|
-
safearea plugin is checked and removed automatically
|
|
89
|
-
Automatically added following in capacitor.config.json file
|
|
90
|
-
"SystemBars": {
|
|
91
|
-
"insetsHandling": "css"
|
|
92
|
-
}
|
|
93
|
-
patchFile() method is removed
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
Version 4.0.6
|
|
99
|
-
IAP related some automatic variable creation and validation
|
|
100
|
-
Fetch from vite.config.json file
|
|
101
|
-
'import.meta.env.VITE_APP_UNIQUE_ID': JSON.stringify(APP_UNIQUE_ID),
|
|
102
|
-
'import.meta.env.VITE_ANDROID_ANALYTICS_ENABLED': JSON.stringify(ANDROID_ANALYTICS_ENABLED),
|
|
103
|
-
'import.meta.env.VITE_IOS_ANALYTICS_ENABLED': JSON.stringify(IOS_ANALYTICS_ENABLED),
|
|
104
|
-
'import.meta.env.VITE_IAP_DESIGN': JSON.stringify(IAP_DESIGN),
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
Version 4.0.5
|
|
108
|
-
In "files\buildCodeplay\packageidBaseModification-1.4.js" SCHEDULE_EXACT_ALARM permission added for the app unique id 2 (resume generator app)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
Version 4.0.4
|
|
112
|
-
patchFile(); method is disabled, Due to "@capacitor/android:8.4.2" this update. I think it is realted to safearea issue fixed in this latest version, file in "SystemBars.java"
|
|
113
|
-
|
|
114
|
-
Version 4.0.3
|
|
115
|
-
Old admob check performs through plugin location, but not it is validated from capacitor.config.json
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
Version: 4.0.2
|
|
119
|
-
After check & install/download the latest version, the re-check is cancelled now
|
|
120
|
-
|
|
121
|
-
Version: 4.0.1
|
|
122
|
-
Base profile script added
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
"version": "",
|
|
126
|
-
Version : 4.0.0 (Previous version 3.2.19)
|
|
127
|
-
1) In here we are completly remove the admob-emi and use "capacitor-admob-nextgen"
|
|
128
|
-
2) Removed "modify-plugin-xml.js"
|
|
129
|
-
3)
|
|
40
|
+
|
|
41
|
+
Version 4.2.3
|
|
42
|
+
Added build warning confirmation when android.ORIENTATION is not "auto" or android.RESIZEABLE_ACTIVITY is not true.
|
|
43
|
+
|
|
44
|
+
Version 4.2.2
|
|
45
|
+
Added "bannerDisabledPages" property and its default value
|
|
46
|
+
The admob configuration default value priority is updated
|
|
47
|
+
|
|
48
|
+
Version 4.2.1
|
|
49
|
+
Updated AdMob nextgen file validation to match admob-emi-nextgen file names.
|
|
50
|
+
|
|
51
|
+
Version 4.2.0
|
|
52
|
+
Firebase related automatic changes updated
|
|
53
|
+
|
|
54
|
+
Version 4.1.9
|
|
55
|
+
Added AdMob nextgen 1.7 validation/default support for "overlappingHeight", "bannerTypeAndroidLandscape", and "bannerTypeiOSLandscape".
|
|
56
|
+
|
|
57
|
+
Version 4.1.8
|
|
58
|
+
"consentDebug: false" is added
|
|
59
|
+
|
|
60
|
+
Version 4.1.7
|
|
61
|
+
admob configuration automatically added.
|
|
62
|
+
|
|
63
|
+
Version 4.1.6
|
|
64
|
+
"setup-baseline-profile.js" modification, duplicate validation error fixed
|
|
65
|
+
|
|
66
|
+
Version 4.1.5
|
|
67
|
+
While isTesting is true it is not validated from our new configuration admob file, now it is solved
|
|
68
|
+
|
|
69
|
+
Version 4.1.4
|
|
70
|
+
hardcoded version is removed for the admob-emi-nextgen
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
Version 4.1.3
|
|
74
|
+
"consentDebug": false automatically adds if not
|
|
75
|
+
|
|
76
|
+
Version 4.1.2
|
|
77
|
+
Speedup
|
|
78
|
+
|
|
79
|
+
Version 4.1.1
|
|
80
|
+
Auto admob integration updated
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
version 4.0.9
|
|
84
|
+
packageJson.scripts["ionic:serve"] = "cross-env NODE_ENV=development vite"; this line updated in "sync-files.js"
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
version 4.0.8
|
|
88
|
+
safearea plugin is checked and removed automatically
|
|
89
|
+
Automatically added following in capacitor.config.json file
|
|
90
|
+
"SystemBars": {
|
|
91
|
+
"insetsHandling": "css"
|
|
92
|
+
}
|
|
93
|
+
patchFile() method is removed
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
Version 4.0.6
|
|
99
|
+
IAP related some automatic variable creation and validation
|
|
100
|
+
Fetch from vite.config.json file
|
|
101
|
+
'import.meta.env.VITE_APP_UNIQUE_ID': JSON.stringify(APP_UNIQUE_ID),
|
|
102
|
+
'import.meta.env.VITE_ANDROID_ANALYTICS_ENABLED': JSON.stringify(ANDROID_ANALYTICS_ENABLED),
|
|
103
|
+
'import.meta.env.VITE_IOS_ANALYTICS_ENABLED': JSON.stringify(IOS_ANALYTICS_ENABLED),
|
|
104
|
+
'import.meta.env.VITE_IAP_DESIGN': JSON.stringify(IAP_DESIGN),
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
Version 4.0.5
|
|
108
|
+
In "files\buildCodeplay\packageidBaseModification-1.4.js" SCHEDULE_EXACT_ALARM permission added for the app unique id 2 (resume generator app)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
Version 4.0.4
|
|
112
|
+
patchFile(); method is disabled, Due to "@capacitor/android:8.4.2" this update. I think it is realted to safearea issue fixed in this latest version, file in "SystemBars.java"
|
|
113
|
+
|
|
114
|
+
Version 4.0.3
|
|
115
|
+
Old admob check performs through plugin location, but not it is validated from capacitor.config.json
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
Version: 4.0.2
|
|
119
|
+
After check & install/download the latest version, the re-check is cancelled now
|
|
120
|
+
|
|
121
|
+
Version: 4.0.1
|
|
122
|
+
Base profile script added
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
"version": "",
|
|
126
|
+
Version : 4.0.0 (Previous version 3.2.19)
|
|
127
|
+
1) In here we are completly remove the admob-emi and use "capacitor-admob-nextgen"
|
|
128
|
+
2) Removed "modify-plugin-xml.js"
|
|
129
|
+
3)
|
|
@@ -1270,6 +1270,7 @@ const androidAppBuildGradlePath = path.join(process.cwd(), 'android', 'app', 'bu
|
|
|
1270
1270
|
const AMAZON_WINDOW_EXTENSIONS_DEPENDENCY = 'implementation "androidx.window.extensions.core:core:1.0.0"';
|
|
1271
1271
|
const AMAZON_WINDOW_EXTENSIONS_DEPENDENCY_PATTERN = /^[ \t]*implementation\s+["']androidx\.window\.extensions\.core:core:[^"']+["'][ \t]*(?:\r?\n)?/gm;
|
|
1272
1272
|
const infoPlistPath = path.join(process.cwd(), 'ios', 'App', 'App', 'Info.plist');
|
|
1273
|
+
const iosSceneDelegatePath = path.join(process.cwd(), 'ios', 'App', 'App', 'SceneDelegate.swift');
|
|
1273
1274
|
const resourcesPath = path.join(process.cwd(), 'resources', 'res');
|
|
1274
1275
|
const androidResPath = path.join(process.cwd(), 'android', 'app', 'src', 'main', 'res');
|
|
1275
1276
|
const localNotificationsPluginPath = path.join(process.cwd(), 'node_modules', '@capacitor', 'local-notifications');
|
|
@@ -1593,6 +1594,62 @@ function updateInfoPlist(admobConfig) {
|
|
|
1593
1594
|
console.log('AdMob IDs and additional configurations successfully updated in Info.plist');
|
|
1594
1595
|
}
|
|
1595
1596
|
|
|
1597
|
+
function updateIOSSceneDelegateForATT() {
|
|
1598
|
+
if (!fileExists(iosSceneDelegatePath)) {
|
|
1599
|
+
console.warn('SceneDelegate.swift not found. Skipping the iOS ATT scene update.');
|
|
1600
|
+
return;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
let content = fs.readFileSync(iosSceneDelegatePath, 'utf8');
|
|
1604
|
+
if (content.includes('ATTrackingManager.requestTrackingAuthorization')) return;
|
|
1605
|
+
|
|
1606
|
+
const newline = content.includes('\r\n') ? '\r\n' : '\n';
|
|
1607
|
+
const sceneClass = /class SceneDelegate\s*:\s*[^\{]+\{/;
|
|
1608
|
+
if (!sceneClass.test(content) || !/import UIKit\r?\n/.test(content) || !content.trimEnd().endsWith('}')) {
|
|
1609
|
+
console.warn('SceneDelegate.swift has an unexpected structure. Skipping the iOS ATT scene update.');
|
|
1610
|
+
return;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
if (!content.includes('import AppTrackingTransparency')) {
|
|
1614
|
+
content = content.replace(/import UIKit\r?\n/, (match) => `${match}import AppTrackingTransparency${newline}`);
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
if (!content.includes('isTrackingAuthorizationRequestScheduled')) {
|
|
1618
|
+
content = content.replace(sceneClass, (match) =>
|
|
1619
|
+
`${match}${newline} private var isTrackingAuthorizationRequestScheduled = false`
|
|
1620
|
+
);
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
const requestBody = [
|
|
1624
|
+
' if ATTrackingManager.trackingAuthorizationStatus == .notDetermined &&',
|
|
1625
|
+
' !isTrackingAuthorizationRequestScheduled {',
|
|
1626
|
+
' isTrackingAuthorizationRequestScheduled = true',
|
|
1627
|
+
'',
|
|
1628
|
+
' DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak self] in',
|
|
1629
|
+
' self?.isTrackingAuthorizationRequestScheduled = false',
|
|
1630
|
+
'',
|
|
1631
|
+
' guard UIApplication.shared.applicationState == .active,',
|
|
1632
|
+
' ATTrackingManager.trackingAuthorizationStatus == .notDetermined else { return }',
|
|
1633
|
+
'',
|
|
1634
|
+
' ATTrackingManager.requestTrackingAuthorization { _ in }',
|
|
1635
|
+
' }',
|
|
1636
|
+
' }',
|
|
1637
|
+
].join(newline);
|
|
1638
|
+
|
|
1639
|
+
const activeSceneMethod = /func sceneDidBecomeActive\s*\(\s*_ scene:\s*UIScene\s*\)\s*\{/;
|
|
1640
|
+
if (activeSceneMethod.test(content)) {
|
|
1641
|
+
content = content.replace(activeSceneMethod, (match) => `${match}${newline}${requestBody}`);
|
|
1642
|
+
} else {
|
|
1643
|
+
const classEnd = content.lastIndexOf('}');
|
|
1644
|
+
content = `${content.slice(0, classEnd).trimEnd()}${newline}${newline}` +
|
|
1645
|
+
` func sceneDidBecomeActive(_ scene: UIScene) {${newline}${requestBody}${newline} }${newline}` +
|
|
1646
|
+
content.slice(classEnd);
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
fs.writeFileSync(iosSceneDelegatePath, content, 'utf8');
|
|
1650
|
+
console.log('iOS SceneDelegate updated to request ATT when the app becomes active.');
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1596
1653
|
|
|
1597
1654
|
try {
|
|
1598
1655
|
if (!fileExists(configPath)) {
|
|
@@ -1622,6 +1679,7 @@ try {
|
|
|
1622
1679
|
|
|
1623
1680
|
if (fileExists(iosPlatformPath)) {
|
|
1624
1681
|
updateInfoPlist(_admobConfig);
|
|
1682
|
+
updateIOSSceneDelegateForATT();
|
|
1625
1683
|
}
|
|
1626
1684
|
}
|
|
1627
1685
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"url": "https://htmlcodeplay.com/codeplay/api/v1/release/sync",
|
|
3
|
-
"token": "b_TiY0Lu7q7Yb0Kx9djVxA6ST8k4CFiwFQNxgci7AAU"
|
|
4
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"url": "https://htmlcodeplay.com/codeplay/api/v1/release/sync",
|
|
3
|
+
"token": "b_TiY0Lu7q7Yb0Kx9djVxA6ST8k4CFiwFQNxgci7AAU"
|
|
4
|
+
}
|
package/files/finalrelease
CHANGED
|
@@ -7,7 +7,7 @@ node finalrelease "1,2,7"
|
|
|
7
7
|
|
|
8
8
|
import { existsSync, readFileSync, readdirSync, promises, constants, writeFileSync, unlinkSync, mkdirSync, renameSync } from 'fs';
|
|
9
9
|
import { join, resolve } from 'path';
|
|
10
|
-
import { execSync, execFileSync } from 'child_process';
|
|
10
|
+
import { execSync, execFileSync } from 'child_process';
|
|
11
11
|
import { createInterface } from 'readline';
|
|
12
12
|
|
|
13
13
|
import { fileURLToPath } from 'url';
|
|
@@ -179,49 +179,49 @@ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
|
179
179
|
|
|
180
180
|
const _appUniqueId = config.android?.APP_UNIQUE_ID;
|
|
181
181
|
const _appName=config.appName;
|
|
182
|
-
const _appPackageId=config.appId;
|
|
183
|
-
|
|
184
|
-
const releaseSyncConfigPath = join(__dirname, 'buildCodeplay', 'release-sync.config.json');
|
|
185
|
-
let releaseSyncConfig = {};
|
|
186
|
-
if (existsSync(releaseSyncConfigPath)) {
|
|
187
|
-
try {
|
|
188
|
-
releaseSyncConfig = JSON.parse(readFileSync(releaseSyncConfigPath, 'utf8'));
|
|
189
|
-
} catch (error) {
|
|
190
|
-
console.warn(`⚠️ Could not read ${releaseSyncConfigPath}: ${error.message}`);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
const RELEASE_SYNC_URL = process.env.CODEPLAY_RELEASE_SYNC_URL || releaseSyncConfig.url || 'https://htmlcodeplay.com/codeplay/api/v1/release/sync';
|
|
194
|
-
const RELEASE_SYNC_TOKEN = process.env.CODEPLAY_RELEASE_SYNC_TOKEN || releaseSyncConfig.token || '';
|
|
195
|
-
const RELEASE_PLATFORM_IDS = { PlayStore: 1, SamsungStore: 13, AmazonStore: 17, MiStore: 15, HuaweiStore: 12, OppoStore: 14, VivoStore: 16 };
|
|
196
|
-
|
|
197
|
-
function syncReleaseToCodeplay(storeName, finalVersionName, finalVersionCode, releasedDate) {
|
|
198
|
-
if (!RELEASE_SYNC_TOKEN) {
|
|
199
|
-
console.warn(`⚠️ Codeplay release sync skipped: add a token to ${releaseSyncConfigPath}.`);
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
const payload = JSON.stringify({
|
|
203
|
-
app_name: _appName,
|
|
204
|
-
package_id: _appPackageId,
|
|
205
|
-
version_name: String(finalVersionName),
|
|
206
|
-
version_code: String(finalVersionCode),
|
|
207
|
-
released_date: releasedDate,
|
|
208
|
-
language_id: 0,
|
|
209
|
-
language_name: 'Capacitor+ Framework 7',
|
|
210
|
-
notes: 'Automated release update',
|
|
211
|
-
status: 1,
|
|
212
|
-
folder_name: path.basename(process.cwd()),
|
|
213
|
-
app_unique_id: String(_appUniqueId || ''),
|
|
214
|
-
platform_id: RELEASE_PLATFORM_IDS[storeName],
|
|
215
|
-
});
|
|
216
|
-
try {
|
|
217
|
-
const response = execFileSync('curl.exe', ['-sS', '--fail-with-body', '-X', 'POST', RELEASE_SYNC_URL,
|
|
218
|
-
'-H', 'Content-Type: application/json', '-H', `X-Release-Token: ${RELEASE_SYNC_TOKEN}`, '--data-binary', payload],
|
|
219
|
-
{ encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
|
|
220
|
-
console.log(`✅ Codeplay sync (${storeName}): ${response.trim()}`);
|
|
221
|
-
} catch (error) {
|
|
222
|
-
console.warn(`⚠️ Codeplay sync failed for ${storeName}; continuing release builds: ${error.message}`);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
182
|
+
const _appPackageId=config.appId;
|
|
183
|
+
|
|
184
|
+
const releaseSyncConfigPath = join(__dirname, 'buildCodeplay', 'release-sync.config.json');
|
|
185
|
+
let releaseSyncConfig = {};
|
|
186
|
+
if (existsSync(releaseSyncConfigPath)) {
|
|
187
|
+
try {
|
|
188
|
+
releaseSyncConfig = JSON.parse(readFileSync(releaseSyncConfigPath, 'utf8'));
|
|
189
|
+
} catch (error) {
|
|
190
|
+
console.warn(`⚠️ Could not read ${releaseSyncConfigPath}: ${error.message}`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const RELEASE_SYNC_URL = process.env.CODEPLAY_RELEASE_SYNC_URL || releaseSyncConfig.url || 'https://htmlcodeplay.com/codeplay/api/v1/release/sync';
|
|
194
|
+
const RELEASE_SYNC_TOKEN = process.env.CODEPLAY_RELEASE_SYNC_TOKEN || releaseSyncConfig.token || '';
|
|
195
|
+
const RELEASE_PLATFORM_IDS = { PlayStore: 1, SamsungStore: 13, AmazonStore: 17, MiStore: 15, HuaweiStore: 12, OppoStore: 14, VivoStore: 16 };
|
|
196
|
+
|
|
197
|
+
function syncReleaseToCodeplay(storeName, finalVersionName, finalVersionCode, releasedDate) {
|
|
198
|
+
if (!RELEASE_SYNC_TOKEN) {
|
|
199
|
+
console.warn(`⚠️ Codeplay release sync skipped: add a token to ${releaseSyncConfigPath}.`);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
const payload = JSON.stringify({
|
|
203
|
+
app_name: _appName,
|
|
204
|
+
package_id: _appPackageId,
|
|
205
|
+
version_name: String(finalVersionName),
|
|
206
|
+
version_code: String(finalVersionCode),
|
|
207
|
+
released_date: releasedDate,
|
|
208
|
+
language_id: 0,
|
|
209
|
+
language_name: 'Capacitor+ Framework 7',
|
|
210
|
+
notes: 'Automated release update',
|
|
211
|
+
status: 1,
|
|
212
|
+
folder_name: path.basename(process.cwd()),
|
|
213
|
+
app_unique_id: String(_appUniqueId || ''),
|
|
214
|
+
platform_id: RELEASE_PLATFORM_IDS[storeName],
|
|
215
|
+
});
|
|
216
|
+
try {
|
|
217
|
+
const response = execFileSync('curl.exe', ['-sS', '--fail-with-body', '-X', 'POST', RELEASE_SYNC_URL,
|
|
218
|
+
'-H', 'Content-Type: application/json', '-H', `X-Release-Token: ${RELEASE_SYNC_TOKEN}`, '--data-binary', payload],
|
|
219
|
+
{ encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
|
|
220
|
+
console.log(`✅ Codeplay sync (${storeName}): ${response.trim()}`);
|
|
221
|
+
} catch (error) {
|
|
222
|
+
console.warn(`⚠️ Codeplay sync failed for ${storeName}; continuing release builds: ${error.message}`);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
225
|
|
|
226
226
|
const FLOWCHART_API_APP_ID = 228;
|
|
227
227
|
const FLOWCHART_SHARED_PATH = join('public', 'src', 'shared.js');
|
|
@@ -1036,11 +1036,11 @@ rl.question('Enter new versionCode (press enter to keep current): ', (newVersion
|
|
|
1036
1036
|
const checkFullPath = join("AAB", newFileName.replace(/\.aab$/, `.${newExt}`));
|
|
1037
1037
|
|
|
1038
1038
|
// Rename the output file
|
|
1039
|
-
if (existsSync(oldFilePath)) {
|
|
1040
|
-
renameSync(oldFilePath, checkFullPath);
|
|
1041
|
-
console.log(`✅ Renamed output ${newExt.toUpperCase()} file to: ${path.basename(checkFullPath)}`);
|
|
1042
|
-
syncReleaseToCodeplay(storeName, finalVersionName, finalVersionCode, new Date().toISOString().slice(0, 10));
|
|
1043
|
-
} else {
|
|
1039
|
+
if (existsSync(oldFilePath)) {
|
|
1040
|
+
renameSync(oldFilePath, checkFullPath);
|
|
1041
|
+
console.log(`✅ Renamed output ${newExt.toUpperCase()} file to: ${path.basename(checkFullPath)}`);
|
|
1042
|
+
syncReleaseToCodeplay(storeName, finalVersionName, finalVersionCode, new Date().toISOString().slice(0, 10));
|
|
1043
|
+
} else {
|
|
1044
1044
|
console.error(`❌ ${newExt.toUpperCase()} file not found after build.`);
|
|
1045
1045
|
}
|
|
1046
1046
|
|
|
@@ -86,8 +86,8 @@ const analysisFrameDirectory = path.join(temporaryDirectory, 'ai-analysis');
|
|
|
86
86
|
const endCardBannerPath = path.join(outputVideoDirectory, `${appFilePrefix}-ai-end-card-banner.png`);
|
|
87
87
|
const promoCopySchemaPath = path.join(temporaryDirectory, 'promo-copy-schema.json');
|
|
88
88
|
const promoCopyResultPath = path.join(temporaryDirectory, 'promo-copy-result.json');
|
|
89
|
-
const ffmpegFallbackDirectory = String(process.env.FFMPEG_BIN || '').trim()
|
|
90
|
-
|| path.join(projectDirectory, 'tools', 'ffmpeg');
|
|
89
|
+
const ffmpegFallbackDirectory = String(process.env.FFMPEG_BIN || '').trim()
|
|
90
|
+
|| path.join(projectDirectory, 'tools', 'ffmpeg');
|
|
91
91
|
const minimumSceneCount = 7;
|
|
92
92
|
const minimumSourceDuration = 12;
|
|
93
93
|
let expectedDuration = 34;
|
|
@@ -209,15 +209,15 @@ async function ensureEndCardBanner() {
|
|
|
209
209
|
+ '- Keep all logos and badge text sharp, correctly proportioned, and completely visible.\n'
|
|
210
210
|
+ '- Match the background colors and visual style to the actual app icon.\n'
|
|
211
211
|
+ '- Create a polished, professional background related to the app’s purpose.\n'
|
|
212
|
-
+ '- Keep the background subtle so it does not compete with the icon, title, feature text, or download badges.\n'
|
|
212
|
+
+ '- Keep the background subtle so it does not compete with the icon, title, feature text, or download badges.\n'
|
|
213
213
|
+ '- Use a balanced landscape composition:\n'
|
|
214
214
|
+ ' - Large actual app icon on the left.\n'
|
|
215
215
|
+ ' - App Store badge followed by Google Play badge on the right.\n'
|
|
216
216
|
+ ' - Maintain comfortable margins and clear space around every element.\n'
|
|
217
|
-
+ '- Add the application title prominently.\n'
|
|
218
|
-
+ '- Add concise promotional text describing the application’s actual features, presenting each feature one by one.\n'
|
|
219
|
-
+ '- Keep the title and feature text sharp, readable, accurate, and visually balanced with the icon and download badges.\n'
|
|
220
|
-
+ '- Do not invent unsupported features or add unrelated marketing text.\n'
|
|
217
|
+
+ '- Add the application title prominently.\n'
|
|
218
|
+
+ '- Add concise promotional text describing the application’s actual features, presenting each feature one by one.\n'
|
|
219
|
+
+ '- Keep the title and feature text sharp, readable, accurate, and visually balanced with the icon and download badges.\n'
|
|
220
|
+
+ '- Do not invent unsupported features or add unrelated marketing text.\n'
|
|
221
221
|
+ '- Do not add watermarks, fake UI, generated symbols, or unrelated decorations.\n'
|
|
222
222
|
+ '- Rounded corners and a subtle shadow may be applied around the app icon, but its internal artwork must remain unchanged.\n'
|
|
223
223
|
+ '- Use image generation only for the background.\n'
|
|
@@ -467,12 +467,12 @@ function commandExists(command) {
|
|
|
467
467
|
return !result.error && result.status === 0;
|
|
468
468
|
}
|
|
469
469
|
|
|
470
|
-
function getExecutable(command) {
|
|
471
|
-
const executableName = process.platform === 'win32' ? `${command}.exe` : command;
|
|
472
|
-
const fallbackPath = path.join(ffmpegFallbackDirectory, executableName);
|
|
473
|
-
if (fs.existsSync(fallbackPath)) return fallbackPath;
|
|
474
|
-
return commandExists(command) ? command : '';
|
|
475
|
-
}
|
|
470
|
+
function getExecutable(command) {
|
|
471
|
+
const executableName = process.platform === 'win32' ? `${command}.exe` : command;
|
|
472
|
+
const fallbackPath = path.join(ffmpegFallbackDirectory, executableName);
|
|
473
|
+
if (fs.existsSync(fallbackPath)) return fallbackPath;
|
|
474
|
+
return commandExists(command) ? command : '';
|
|
475
|
+
}
|
|
476
476
|
|
|
477
477
|
function detectRedundantStaticRanges(ffmpegCommand, inputPath, sourceDuration) {
|
|
478
478
|
const minimumStaticDuration = Math.max(2, Math.min(4, sourceDuration / 60));
|
|
@@ -640,7 +640,7 @@ function resolvePromoLayout(requestedLayout) {
|
|
|
640
640
|
}
|
|
641
641
|
|
|
642
642
|
function getPythonExecutable() {
|
|
643
|
-
for (const candidate of ['py', 'python', 'python3']) {
|
|
643
|
+
for (const candidate of ['py', 'python', 'python3']) {
|
|
644
644
|
const result = spawnSync(candidate, ['-m', 'edge_tts', '--version'], {
|
|
645
645
|
encoding: 'utf8',
|
|
646
646
|
windowsHide: true,
|
|
@@ -915,7 +915,7 @@ Rules:
|
|
|
915
915
|
- footer_keywords must contain exactly 3 distinct, natural app-search phrases, each 2-24 characters.
|
|
916
916
|
- Generate a YouTube upload title and description from the same verified features.
|
|
917
917
|
- YouTube title: 40-100 characters, include ${JSON.stringify(appName)} and one strong natural search phrase, without clickbait.
|
|
918
|
-
- YouTube description: 350-1500 characters with readable paragraphs. Put the clearest app summary and primary search phrase in the opening two lines, explain the demonstrated features, add a simple call to action, then insert a newline and finish with exactly 3 relevant hashtags on that separate final line. The hashtags must not be appended to the preceding paragraph.
|
|
918
|
+
- YouTube description: 350-1500 characters with readable paragraphs. Put the clearest app summary and primary search phrase in the opening two lines, explain the demonstrated features, add a simple call to action, then insert a newline and finish with exactly 3 relevant hashtags on that separate final line. The hashtags must not be appended to the preceding paragraph.
|
|
919
919
|
- Do not add download links or URLs; the script will append the verified Google Play URL built from the configured package ID. Do not add chapter timestamps or unsupported availability claims.
|
|
920
920
|
- Keep YouTube text natural and useful; do not repeat keywords unnaturally.
|
|
921
921
|
- Avoid prices, ratings, awards, competitor names, unsupported superlatives, and words such as best, guaranteed, or free.
|
|
@@ -1025,14 +1025,14 @@ function validatePromoCopy(value) {
|
|
|
1025
1025
|
throw new Error(`The final scene must mention the app name ${JSON.stringify(appName)}.`);
|
|
1026
1026
|
}
|
|
1027
1027
|
|
|
1028
|
-
const youtubeTitle = cleanGeneratedString(value.youtube.title);
|
|
1029
|
-
let youtubeDescription = cleanGeneratedDescription(value.youtube.description);
|
|
1030
|
-
const trailingHashtagGroup = youtubeDescription.match(
|
|
1031
|
-
/(?:^|\s)(#[\p{L}\p{N}_]+\s+#[\p{L}\p{N}_]+\s+#[\p{L}\p{N}_]+)\s*$/u,
|
|
1032
|
-
);
|
|
1033
|
-
if (trailingHashtagGroup) {
|
|
1034
|
-
youtubeDescription = `${youtubeDescription.slice(0, trailingHashtagGroup.index).trimEnd()}\n${trailingHashtagGroup[1]}`;
|
|
1035
|
-
}
|
|
1028
|
+
const youtubeTitle = cleanGeneratedString(value.youtube.title);
|
|
1029
|
+
let youtubeDescription = cleanGeneratedDescription(value.youtube.description);
|
|
1030
|
+
const trailingHashtagGroup = youtubeDescription.match(
|
|
1031
|
+
/(?:^|\s)(#[\p{L}\p{N}_]+\s+#[\p{L}\p{N}_]+\s+#[\p{L}\p{N}_]+)\s*$/u,
|
|
1032
|
+
);
|
|
1033
|
+
if (trailingHashtagGroup) {
|
|
1034
|
+
youtubeDescription = `${youtubeDescription.slice(0, trailingHashtagGroup.index).trimEnd()}\n${trailingHashtagGroup[1]}`;
|
|
1035
|
+
}
|
|
1036
1036
|
if (youtubeTitle.length < 40 || youtubeTitle.length > 100) {
|
|
1037
1037
|
throw new Error('YouTube title must be 40-100 characters.');
|
|
1038
1038
|
}
|