codeplay-common 4.11.7 โ 4.11.9
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/CHANGELOG.md +100 -96
- package/LICENSE +21 -21
- package/README.md +229 -229
- package/RELEASE_NOTES.md +21 -17
- package/files/buildCodeplay/add-splash-screen.js +255 -255
- package/files/buildCodeplay/apk-store-builder.js +97 -97
- package/files/buildCodeplay/codeplayBeforeBuild.js +42 -45
- package/files/buildCodeplay/ensure-current-build.cjs +42 -42
- package/files/buildCodeplay/fix-onesignal-plugin.js +96 -96
- package/files/buildCodeplay/ios-emi-admob-modification.js +49 -49
- package/files/buildCodeplay/manifestModification.js +38 -38
- package/files/buildCodeplay/newly added.txt +89 -89
- package/files/buildCodeplay/packageidBaseModification.js +445 -445
- package/files/buildCodeplay/project-scripts.cjs +62 -62
- package/files/buildCodeplay/release-sync.config.json +4 -4
- package/files/buildCodeplay/remove-force-kotlin-disable.js +43 -43
- package/files/buildCodeplay/setSplashAnimation.js +226 -226
- package/files/buildCodeplay/sync-admob-nextgen.js +219 -219
- package/files/buildCodeplay/versions.json +27 -27
- package/files/finalrelease +1246 -1246
- package/files/generate-ai-promo-video.js +23 -23
- package/files/ionic.config.json +6 -6
- package/files/scripts-common/generate-baseline-profile.js +46 -46
- package/files/scripts-common/run-codeplay-sync-after.js +21 -21
- package/files/scripts-common/screenshot/background-decorations.js +120 -120
- package/files/scripts-common/screenshot/frame-samples.js +117 -117
- package/files/scripts-common/setup-baseline-profile.js +291 -291
- package/files/take-screen-image.js +4382 -4382
- package/files/take-screen-video.js +644 -644
- package/package.json +27 -27
- package/scripts/ensure-current-build.test.cjs +76 -76
- package/scripts/sync-files.js +113 -113
- package/scripts/uninstall.js +2 -2
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
const fs = require("fs");
|
|
2
|
-
const path = require("path");
|
|
3
|
-
|
|
4
|
-
const pluginPath = path.join(
|
|
5
|
-
__dirname,
|
|
6
|
-
"..",
|
|
7
|
-
"node_modules",
|
|
8
|
-
"onesignal-cordova-plugin",
|
|
9
|
-
"plugin.xml"
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
if (!fs.existsSync(pluginPath)) {
|
|
13
|
-
console.log("OneSignal plugin not found, skipping patch.");
|
|
14
|
-
process.exit(0);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
console.log("OneSignal plugin patch started.");
|
|
18
|
-
|
|
19
|
-
let content = fs.readFileSync(pluginPath, "utf8");
|
|
20
|
-
|
|
21
|
-
/* ---- Prevent running twice ---- */
|
|
22
|
-
if (content.includes("buildCodeplay/fix-onesignal-plugin.js")) {
|
|
23
|
-
console.log("OneSignal plugin already patched.");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
else{
|
|
27
|
-
/* ---- Comment Kotlin dependency ---- */
|
|
28
|
-
content = content.replace(
|
|
29
|
-
'<framework src="org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10" />',
|
|
30
|
-
`<!-- Disabled: causes Kotlin version conflict with modern Gradle/Kotlin -->
|
|
31
|
-
<!-- <framework src="org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10" /> -->`
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
/* ---- Add dependencies ---- */
|
|
35
|
-
content = content.replace(
|
|
36
|
-
'<framework src="build-extras-onesignal.gradle" custom="true" type="gradleReference" />',
|
|
37
|
-
`<framework src="build-extras-onesignal.gradle" custom="true" type="gradleReference" />
|
|
38
|
-
|
|
39
|
-
<!--Newly added content through buildCodeplay/fix-onesignal-plugin.js Start-->
|
|
40
|
-
<framework src="com.fasterxml.jackson.core:jackson-core:2.17.2" />
|
|
41
|
-
<framework src="com.google.auto.value:auto-value-annotations:1.11.0" scope="provided" />
|
|
42
|
-
<!--Newly added content through buildCodeplay/fix-onesignal-plugin.js End-->`
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
fs.writeFileSync(pluginPath, content);
|
|
46
|
-
|
|
47
|
-
console.log("OneSignal plugin patched successfully.");
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
//#################### ADD THE PROPER ONESIGNAL PERMISSIN TO INFO.PLIST START ###########################
|
|
58
|
-
|
|
59
|
-
const iosPlistPath = path.join(
|
|
60
|
-
__dirname,
|
|
61
|
-
"..",
|
|
62
|
-
"ios",
|
|
63
|
-
"App",
|
|
64
|
-
"App",
|
|
65
|
-
"Info.plist"
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
console.log(iosPlistPath)
|
|
69
|
-
|
|
70
|
-
if (fs.existsSync(iosPlistPath)) {
|
|
71
|
-
|
|
72
|
-
let plist = fs.readFileSync(iosPlistPath, "utf8");
|
|
73
|
-
|
|
74
|
-
const insertBlock = `
|
|
75
|
-
<key>UIBackgroundModes</key>
|
|
76
|
-
<array>
|
|
77
|
-
<string>remote-notification</string>
|
|
78
|
-
</array>
|
|
79
|
-
`;
|
|
80
|
-
|
|
81
|
-
if (!plist.includes("UIBackgroundModes")) {
|
|
82
|
-
const lastIndex = plist.lastIndexOf("</dict>");
|
|
83
|
-
|
|
84
|
-
plist =
|
|
85
|
-
plist.slice(0, lastIndex) +
|
|
86
|
-
insertBlock +
|
|
87
|
-
"\n" +
|
|
88
|
-
plist.slice(lastIndex);
|
|
89
|
-
|
|
90
|
-
console.log("Inserted UIBackgroundModes correctly.");
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
fs.writeFileSync(iosPlistPath, plist);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
const pluginPath = path.join(
|
|
5
|
+
__dirname,
|
|
6
|
+
"..",
|
|
7
|
+
"node_modules",
|
|
8
|
+
"onesignal-cordova-plugin",
|
|
9
|
+
"plugin.xml"
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
if (!fs.existsSync(pluginPath)) {
|
|
13
|
+
console.log("OneSignal plugin not found, skipping patch.");
|
|
14
|
+
process.exit(0);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
console.log("OneSignal plugin patch started.");
|
|
18
|
+
|
|
19
|
+
let content = fs.readFileSync(pluginPath, "utf8");
|
|
20
|
+
|
|
21
|
+
/* ---- Prevent running twice ---- */
|
|
22
|
+
if (content.includes("buildCodeplay/fix-onesignal-plugin.js")) {
|
|
23
|
+
console.log("OneSignal plugin already patched.");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
else{
|
|
27
|
+
/* ---- Comment Kotlin dependency ---- */
|
|
28
|
+
content = content.replace(
|
|
29
|
+
'<framework src="org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10" />',
|
|
30
|
+
`<!-- Disabled: causes Kotlin version conflict with modern Gradle/Kotlin -->
|
|
31
|
+
<!-- <framework src="org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.10" /> -->`
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
/* ---- Add dependencies ---- */
|
|
35
|
+
content = content.replace(
|
|
36
|
+
'<framework src="build-extras-onesignal.gradle" custom="true" type="gradleReference" />',
|
|
37
|
+
`<framework src="build-extras-onesignal.gradle" custom="true" type="gradleReference" />
|
|
38
|
+
|
|
39
|
+
<!--Newly added content through buildCodeplay/fix-onesignal-plugin.js Start-->
|
|
40
|
+
<framework src="com.fasterxml.jackson.core:jackson-core:2.17.2" />
|
|
41
|
+
<framework src="com.google.auto.value:auto-value-annotations:1.11.0" scope="provided" />
|
|
42
|
+
<!--Newly added content through buildCodeplay/fix-onesignal-plugin.js End-->`
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
fs.writeFileSync(pluginPath, content);
|
|
46
|
+
|
|
47
|
+
console.log("OneSignal plugin patched successfully.");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
//#################### ADD THE PROPER ONESIGNAL PERMISSIN TO INFO.PLIST START ###########################
|
|
58
|
+
|
|
59
|
+
const iosPlistPath = path.join(
|
|
60
|
+
__dirname,
|
|
61
|
+
"..",
|
|
62
|
+
"ios",
|
|
63
|
+
"App",
|
|
64
|
+
"App",
|
|
65
|
+
"Info.plist"
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
console.log(iosPlistPath)
|
|
69
|
+
|
|
70
|
+
if (fs.existsSync(iosPlistPath)) {
|
|
71
|
+
|
|
72
|
+
let plist = fs.readFileSync(iosPlistPath, "utf8");
|
|
73
|
+
|
|
74
|
+
const insertBlock = `
|
|
75
|
+
<key>UIBackgroundModes</key>
|
|
76
|
+
<array>
|
|
77
|
+
<string>remote-notification</string>
|
|
78
|
+
</array>
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
if (!plist.includes("UIBackgroundModes")) {
|
|
82
|
+
const lastIndex = plist.lastIndexOf("</dict>");
|
|
83
|
+
|
|
84
|
+
plist =
|
|
85
|
+
plist.slice(0, lastIndex) +
|
|
86
|
+
insertBlock +
|
|
87
|
+
"\n" +
|
|
88
|
+
plist.slice(lastIndex);
|
|
89
|
+
|
|
90
|
+
console.log("Inserted UIBackgroundModes correctly.");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
fs.writeFileSync(iosPlistPath, plist);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
97
|
//#################### ADD THE PROPER ONESIGNAL PERMISSIN TO INFO.PLIST END ###########################
|
|
@@ -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.
|