codeplay-common 3.2.8 → 3.2.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/.gitattributes +2 -2
- package/LICENSE +21 -21
- package/README.md +11 -11
- package/files/buildCodeplay/add-splash-screen-1.6.js +254 -254
- package/files/buildCodeplay/apk-store-builder.js +91 -91
- package/files/buildCodeplay/codeplayBeforeBuild-6.1.js +2606 -2601
- package/files/buildCodeplay/fix-onesignal-plugin.js +46 -46
- package/files/buildCodeplay/ios-emi-admob-modification.js +52 -52
- package/files/buildCodeplay/manifestModification.js +33 -33
- package/files/buildCodeplay/modify-plugin-xml.js +36 -36
- package/files/buildCodeplay/packageidBaseModification-1.4.js +420 -420
- package/files/buildCodeplay/remove-force-kotlin-disable.js +45 -45
- package/files/buildCodeplay/setSplashAnimation-1.2.js +170 -170
- package/files/buildCodeplay/splashxml/codeplay_splashScreen.xml +11 -11
- package/files/buildCodeplay/versions.json +25 -25
- package/files/finalrelease +960 -960
- package/files/iap-install-2.js +145 -145
- package/files/ionic.config.json +6 -6
- package/package.json +16 -16
- package/scripts/sync-files.js +86 -86
- package/scripts/uninstall.js +77 -77
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
const { spawn } = require("child_process");
|
|
2
|
-
const path = require("path");
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
|
|
5
|
-
// Paths
|
|
6
|
-
//const projectRoot = path.join(__dirname, "..");
|
|
7
|
-
const projectRoot = process.cwd();
|
|
8
|
-
const androidPath = path.join(projectRoot, "android");
|
|
9
|
-
const capacitorConfigPath = path.join(projectRoot, "capacitor.config.json");
|
|
10
|
-
|
|
11
|
-
// Read capacitor.config.json
|
|
12
|
-
if (!fs.existsSync(capacitorConfigPath)) {
|
|
13
|
-
console.error("❌ capacitor.config.json not found!");
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const config = JSON.parse(fs.readFileSync(capacitorConfigPath, "utf8"));
|
|
18
|
-
|
|
19
|
-
const buildOptions = config.android?.buildOptions;
|
|
20
|
-
|
|
21
|
-
if (!buildOptions) {
|
|
22
|
-
console.error("❌ android.buildOptions not found in capacitor.config.json");
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Resolve keystore path (relative → absolute)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const storePassword = buildOptions.keystorePassword;
|
|
30
|
-
const keyAlias = buildOptions.keystoreAlias;
|
|
31
|
-
const keyPassword = buildOptions.keystoreAliasPassword;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const rawKeystorePath = buildOptions.keystorePath;
|
|
39
|
-
|
|
40
|
-
// First try normal resolve
|
|
41
|
-
let keystorePath = path.resolve(projectRoot, rawKeystorePath);
|
|
42
|
-
|
|
43
|
-
// If not found, try trimming one "../"
|
|
44
|
-
if (!fs.existsSync(keystorePath)) {
|
|
45
|
-
console.log("⚠️ Keystore not found, attempting path correction...");
|
|
46
|
-
|
|
47
|
-
const trimmedPath = rawKeystorePath.replace(/^\.\.\//, "");
|
|
48
|
-
keystorePath = path.resolve(projectRoot, trimmedPath);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Final validation
|
|
52
|
-
if (!fs.existsSync(keystorePath)) {
|
|
53
|
-
console.error("❌ Keystore file not found even after correction:", keystorePath);
|
|
54
|
-
process.exit(1);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
console.log("🔐 Using keystore:", keystorePath);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
// Gradle args
|
|
69
|
-
const args = [
|
|
70
|
-
"/c",
|
|
71
|
-
"gradlew.bat",
|
|
72
|
-
"assembleRelease",
|
|
73
|
-
`-Pandroid.injected.signing.store.file=${keystorePath}`,
|
|
74
|
-
`-Pandroid.injected.signing.store.password=${storePassword}`,
|
|
75
|
-
`-Pandroid.injected.signing.key.alias=${keyAlias}`,
|
|
76
|
-
`-Pandroid.injected.signing.key.password=${keyPassword}`,
|
|
77
|
-
];
|
|
78
|
-
|
|
79
|
-
// Run Gradle
|
|
80
|
-
const gradle = spawn("cmd.exe", args, {
|
|
81
|
-
cwd: androidPath,
|
|
82
|
-
stdio: "inherit",
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
gradle.on("close", (code) => {
|
|
86
|
-
if (code === 0) {
|
|
87
|
-
console.log("\n✅ Signed APK Generated Successfully!");
|
|
88
|
-
} else {
|
|
89
|
-
console.log("\n❌ Build Failed with code:", code);
|
|
90
|
-
process.exit(code);
|
|
91
|
-
}
|
|
1
|
+
const { spawn } = require("child_process");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
|
|
5
|
+
// Paths
|
|
6
|
+
//const projectRoot = path.join(__dirname, "..");
|
|
7
|
+
const projectRoot = process.cwd();
|
|
8
|
+
const androidPath = path.join(projectRoot, "android");
|
|
9
|
+
const capacitorConfigPath = path.join(projectRoot, "capacitor.config.json");
|
|
10
|
+
|
|
11
|
+
// Read capacitor.config.json
|
|
12
|
+
if (!fs.existsSync(capacitorConfigPath)) {
|
|
13
|
+
console.error("❌ capacitor.config.json not found!");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const config = JSON.parse(fs.readFileSync(capacitorConfigPath, "utf8"));
|
|
18
|
+
|
|
19
|
+
const buildOptions = config.android?.buildOptions;
|
|
20
|
+
|
|
21
|
+
if (!buildOptions) {
|
|
22
|
+
console.error("❌ android.buildOptions not found in capacitor.config.json");
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Resolve keystore path (relative → absolute)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const storePassword = buildOptions.keystorePassword;
|
|
30
|
+
const keyAlias = buildOptions.keystoreAlias;
|
|
31
|
+
const keyPassword = buildOptions.keystoreAliasPassword;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
const rawKeystorePath = buildOptions.keystorePath;
|
|
39
|
+
|
|
40
|
+
// First try normal resolve
|
|
41
|
+
let keystorePath = path.resolve(projectRoot, rawKeystorePath);
|
|
42
|
+
|
|
43
|
+
// If not found, try trimming one "../"
|
|
44
|
+
if (!fs.existsSync(keystorePath)) {
|
|
45
|
+
console.log("⚠️ Keystore not found, attempting path correction...");
|
|
46
|
+
|
|
47
|
+
const trimmedPath = rawKeystorePath.replace(/^\.\.\//, "");
|
|
48
|
+
keystorePath = path.resolve(projectRoot, trimmedPath);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Final validation
|
|
52
|
+
if (!fs.existsSync(keystorePath)) {
|
|
53
|
+
console.error("❌ Keystore file not found even after correction:", keystorePath);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
console.log("🔐 Using keystore:", keystorePath);
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
// Gradle args
|
|
69
|
+
const args = [
|
|
70
|
+
"/c",
|
|
71
|
+
"gradlew.bat",
|
|
72
|
+
"assembleRelease",
|
|
73
|
+
`-Pandroid.injected.signing.store.file=${keystorePath}`,
|
|
74
|
+
`-Pandroid.injected.signing.store.password=${storePassword}`,
|
|
75
|
+
`-Pandroid.injected.signing.key.alias=${keyAlias}`,
|
|
76
|
+
`-Pandroid.injected.signing.key.password=${keyPassword}`,
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
// Run Gradle
|
|
80
|
+
const gradle = spawn("cmd.exe", args, {
|
|
81
|
+
cwd: androidPath,
|
|
82
|
+
stdio: "inherit",
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
gradle.on("close", (code) => {
|
|
86
|
+
if (code === 0) {
|
|
87
|
+
console.log("\n✅ Signed APK Generated Successfully!");
|
|
88
|
+
} else {
|
|
89
|
+
console.log("\n❌ Build Failed with code:", code);
|
|
90
|
+
process.exit(code);
|
|
91
|
+
}
|
|
92
92
|
});
|