codeplay-common 1.7.7 → 1.7.8

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
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
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
+ }