codeplay-common 1.8.2 → 1.8.4

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 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,12 +1,12 @@
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
- Donate to get full code including many common functions
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
+ Donate to get full code including many common functions
12
12
  https://ko-fi.com/codeplay
@@ -1,113 +1,113 @@
1
- const fs = require("fs");
2
- const path = require("path");
3
-
4
- // Define file paths
5
- const projectFolder = path.resolve(".");
6
- const sourceSplashIcon = path.join(projectFolder, "resources", "splash_icon.png");
7
- const destinationSplashIcon = path.join(
8
- projectFolder,
9
- "android",
10
- "app",
11
- "src",
12
- "main",
13
- "res",
14
- "drawable-nodpi",
15
- "splash_icon.png"
16
- );
17
- const sourceSplashXML = path.join(projectFolder,"buildCodeplay", "splashxml", "codeplay_splashScreen.xml");
18
- const destinationSplashXML = path.join(
19
- projectFolder,
20
- "android",
21
- "app",
22
- "src",
23
- "main",
24
- "res",
25
- "values",
26
- "codeplay_splashScreen.xml"
27
- );
28
- const androidManifestPath = path.join(
29
- projectFolder,
30
- "android",
31
- "app",
32
- "src",
33
- "main",
34
- "AndroidManifest.xml"
35
- );
36
-
37
- // Helper function to copy files
38
- function copyFile(source, destination) {
39
- if (!fs.existsSync(source)) {
40
- throw new Error(`Source file not found: ${source}`);
41
- }
42
- fs.mkdirSync(path.dirname(destination), { recursive: true });
43
- fs.copyFileSync(source, destination);
44
- console.log(`Copied: ${source} -> ${destination}`);
45
- }
46
-
47
- // Helper function to update AndroidManifest.xml
48
- function updateAndroidManifest() {
49
- if (!fs.existsSync(androidManifestPath)) {
50
- throw new Error(`AndroidManifest.xml not found: ${androidManifestPath}`);
51
- }
52
-
53
- let manifestContent = fs.readFileSync(androidManifestPath, "utf-8");
54
-
55
- manifestContent = manifestContent.replace(
56
- /<activity[^>]*?>/,
57
- (match) => {
58
- let updated = match;
59
-
60
- // If android:theme is already present, update it
61
- if (updated.includes('android:theme=')) {
62
- updated = updated.replace(
63
- /android:theme="[^"]*"/,
64
- 'android:theme="@style/Theme.Codeplay.SplashScreen"'
65
- );
66
- }
67
-
68
- // If android:resizeableActivity is already present, update it
69
- if (updated.includes('android:resizeableActivity=')) {
70
- updated = updated.replace(
71
- /android:resizeableActivity="[^"]*"/,
72
- 'android:resizeableActivity="false"'
73
- );
74
- } else {
75
- // Add resizeableActivity attribute
76
- updated = updated.replace('<activity', '<activity android:resizeableActivity="false"');
77
- }
78
-
79
-
80
- // If android:screenOrientation is already present, update it
81
- if (updated.includes('android:screenOrientation=')) {
82
- updated = updated.replace(
83
- /android:screenOrientation="[^"]*"/,
84
- 'android:screenOrientation="portrait"'
85
- );
86
- } else {
87
- updated = updated.replace(
88
- '<activity',
89
- '<activity android:screenOrientation="portrait"'
90
- );
91
- }
92
-
93
-
94
-
95
- return updated;
96
- }
97
- );
98
-
99
- fs.writeFileSync(androidManifestPath, manifestContent, "utf-8");
100
- console.log(`Updated AndroidManifest.xml: ensured resizeableActivity="false" and updated theme if present.`);
101
- }
102
-
103
- // Perform the tasks
104
- try {
105
- console.log("Starting splash screen setup...");
106
- copyFile(sourceSplashIcon, destinationSplashIcon);
107
- copyFile(sourceSplashXML, destinationSplashXML);
108
- updateAndroidManifest();
109
- console.log("Splash screen setup completed.");
110
- } catch (error) {
111
- console.error(`Error: ${error.message}`);
112
- process.exit(1);
113
- }
1
+ const fs = require("fs");
2
+ const path = require("path");
3
+
4
+ // Define file paths
5
+ const projectFolder = path.resolve(".");
6
+ const sourceSplashIcon = path.join(projectFolder, "resources", "splash_icon.png");
7
+ const destinationSplashIcon = path.join(
8
+ projectFolder,
9
+ "android",
10
+ "app",
11
+ "src",
12
+ "main",
13
+ "res",
14
+ "drawable-nodpi",
15
+ "splash_icon.png"
16
+ );
17
+ const sourceSplashXML = path.join(projectFolder,"buildCodeplay", "splashxml", "codeplay_splashScreen.xml");
18
+ const destinationSplashXML = path.join(
19
+ projectFolder,
20
+ "android",
21
+ "app",
22
+ "src",
23
+ "main",
24
+ "res",
25
+ "values",
26
+ "codeplay_splashScreen.xml"
27
+ );
28
+ const androidManifestPath = path.join(
29
+ projectFolder,
30
+ "android",
31
+ "app",
32
+ "src",
33
+ "main",
34
+ "AndroidManifest.xml"
35
+ );
36
+
37
+ // Helper function to copy files
38
+ function copyFile(source, destination) {
39
+ if (!fs.existsSync(source)) {
40
+ throw new Error(`Source file not found: ${source}`);
41
+ }
42
+ fs.mkdirSync(path.dirname(destination), { recursive: true });
43
+ fs.copyFileSync(source, destination);
44
+ console.log(`Copied: ${source} -> ${destination}`);
45
+ }
46
+
47
+ // Helper function to update AndroidManifest.xml
48
+ function updateAndroidManifest() {
49
+ if (!fs.existsSync(androidManifestPath)) {
50
+ throw new Error(`AndroidManifest.xml not found: ${androidManifestPath}`);
51
+ }
52
+
53
+ let manifestContent = fs.readFileSync(androidManifestPath, "utf-8");
54
+
55
+ manifestContent = manifestContent.replace(
56
+ /<activity[^>]*?>/,
57
+ (match) => {
58
+ let updated = match;
59
+
60
+ // If android:theme is already present, update it
61
+ if (updated.includes('android:theme=')) {
62
+ updated = updated.replace(
63
+ /android:theme="[^"]*"/,
64
+ 'android:theme="@style/Theme.Codeplay.SplashScreen"'
65
+ );
66
+ }
67
+
68
+ // If android:resizeableActivity is already present, update it
69
+ if (updated.includes('android:resizeableActivity=')) {
70
+ updated = updated.replace(
71
+ /android:resizeableActivity="[^"]*"/,
72
+ 'android:resizeableActivity="false"'
73
+ );
74
+ } else {
75
+ // Add resizeableActivity attribute
76
+ updated = updated.replace('<activity', '<activity android:resizeableActivity="false"');
77
+ }
78
+
79
+
80
+ // If android:screenOrientation is already present, update it
81
+ if (updated.includes('android:screenOrientation=')) {
82
+ updated = updated.replace(
83
+ /android:screenOrientation="[^"]*"/,
84
+ 'android:screenOrientation="portrait"'
85
+ );
86
+ } else {
87
+ updated = updated.replace(
88
+ '<activity',
89
+ '<activity android:screenOrientation="portrait"'
90
+ );
91
+ }
92
+
93
+
94
+
95
+ return updated;
96
+ }
97
+ );
98
+
99
+ fs.writeFileSync(androidManifestPath, manifestContent, "utf-8");
100
+ console.log(`Updated AndroidManifest.xml: ensured resizeableActivity="false" and updated theme if present.`);
101
+ }
102
+
103
+ // Perform the tasks
104
+ try {
105
+ console.log("Starting splash screen setup...");
106
+ copyFile(sourceSplashIcon, destinationSplashIcon);
107
+ copyFile(sourceSplashXML, destinationSplashXML);
108
+ updateAndroidManifest();
109
+ console.log("Splash screen setup completed.");
110
+ } catch (error) {
111
+ console.error(`Error: ${error.message}`);
112
+ process.exit(1);
113
+ }