codeplay-common 2.1.12 → 2.1.14
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 +248 -248
- package/files/buildCodeplay/codeplayBeforeBuild-5.1.js +1230 -1230
- package/files/buildCodeplay/ios-emi-admob-modification.js +52 -52
- package/files/buildCodeplay/modify-plugin-xml.js +36 -36
- package/files/buildCodeplay/packageidBaseModification-1.3.js +270 -270
- package/files/buildCodeplay/setSplashAnimation-1.2.js +170 -170
- package/files/buildCodeplay/splashxml/codeplay_splashScreen.xml +11 -11
- package/files/finalrelease +835 -835
- 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,52 +1,52 @@
|
|
|
1
|
-
/* EMI PLUGIN one line comment START */
|
|
2
|
-
|
|
3
|
-
//Note : Call showBannerAd() method after hideBannerAd(), the inset space are not set properly (The banner ad overlap the content). So hide a line in emiAdmobPlugin.m file "//[self resetWebViewHeight];"
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
const path = require('path');
|
|
6
|
-
|
|
7
|
-
const replaceEmiPluginCode=()=>
|
|
8
|
-
{
|
|
9
|
-
debugger;
|
|
10
|
-
// path to your .m file
|
|
11
|
-
const filePath = path.join(__dirname, '../ios/capacitor-cordova-ios-plugins/sourcesstatic/EmiIndoCordovaPluginAdmob/emiAdmobPlugin.m');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (fs.existsSync(filePath)) {
|
|
15
|
-
let fileContent = fs.readFileSync(filePath, 'utf8');
|
|
16
|
-
|
|
17
|
-
// match the hideBannerAd method
|
|
18
|
-
const methodRegex = /(- \(void\)hideBannerAd:[\s\S]*?\{)([\s\S]*?)(^\})/m;
|
|
19
|
-
|
|
20
|
-
const match = fileContent.match(methodRegex);
|
|
21
|
-
|
|
22
|
-
if (match) {
|
|
23
|
-
const methodBody = match[2];
|
|
24
|
-
|
|
25
|
-
// replace only if the line is not already commented
|
|
26
|
-
const modifiedMethodBody = methodBody.replace(
|
|
27
|
-
/^(\s*)(?!\/\/)\[self\s+resetWebViewHeight\];/m,
|
|
28
|
-
'$1//[self resetWebViewHeight];'
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
const updatedFileContent =
|
|
32
|
-
fileContent.slice(0, match.index) +
|
|
33
|
-
match[1] +
|
|
34
|
-
modifiedMethodBody +
|
|
35
|
-
match[3] +
|
|
36
|
-
fileContent.slice(match.index + match[0].length);
|
|
37
|
-
|
|
38
|
-
fs.writeFileSync(filePath, updatedFileContent, 'utf8');
|
|
39
|
-
console.log(
|
|
40
|
-
'✅ Successfully ensured [self resetWebViewHeight]; is commented only inside hideBannerAd in emiAdmobPlugin.m'
|
|
41
|
-
);
|
|
42
|
-
} else {
|
|
43
|
-
console.log('⚠️ hideBannerAd method not found.');
|
|
44
|
-
}
|
|
45
|
-
} else {
|
|
46
|
-
console.log('ℹ️ emiAdmobPlugin.m file not found, skipping modification.');
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
replaceEmiPluginCode();
|
|
51
|
-
|
|
52
|
-
/* EMI PLUGIN one line comment END */
|
|
1
|
+
/* EMI PLUGIN one line comment START */
|
|
2
|
+
|
|
3
|
+
//Note : Call showBannerAd() method after hideBannerAd(), the inset space are not set properly (The banner ad overlap the content). So hide a line in emiAdmobPlugin.m file "//[self resetWebViewHeight];"
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
const replaceEmiPluginCode=()=>
|
|
8
|
+
{
|
|
9
|
+
debugger;
|
|
10
|
+
// path to your .m file
|
|
11
|
+
const filePath = path.join(__dirname, '../ios/capacitor-cordova-ios-plugins/sourcesstatic/EmiIndoCordovaPluginAdmob/emiAdmobPlugin.m');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
if (fs.existsSync(filePath)) {
|
|
15
|
+
let fileContent = fs.readFileSync(filePath, 'utf8');
|
|
16
|
+
|
|
17
|
+
// match the hideBannerAd method
|
|
18
|
+
const methodRegex = /(- \(void\)hideBannerAd:[\s\S]*?\{)([\s\S]*?)(^\})/m;
|
|
19
|
+
|
|
20
|
+
const match = fileContent.match(methodRegex);
|
|
21
|
+
|
|
22
|
+
if (match) {
|
|
23
|
+
const methodBody = match[2];
|
|
24
|
+
|
|
25
|
+
// replace only if the line is not already commented
|
|
26
|
+
const modifiedMethodBody = methodBody.replace(
|
|
27
|
+
/^(\s*)(?!\/\/)\[self\s+resetWebViewHeight\];/m,
|
|
28
|
+
'$1//[self resetWebViewHeight];'
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const updatedFileContent =
|
|
32
|
+
fileContent.slice(0, match.index) +
|
|
33
|
+
match[1] +
|
|
34
|
+
modifiedMethodBody +
|
|
35
|
+
match[3] +
|
|
36
|
+
fileContent.slice(match.index + match[0].length);
|
|
37
|
+
|
|
38
|
+
fs.writeFileSync(filePath, updatedFileContent, 'utf8');
|
|
39
|
+
console.log(
|
|
40
|
+
'✅ Successfully ensured [self resetWebViewHeight]; is commented only inside hideBannerAd in emiAdmobPlugin.m'
|
|
41
|
+
);
|
|
42
|
+
} else {
|
|
43
|
+
console.log('⚠️ hideBannerAd method not found.');
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
console.log('ℹ️ emiAdmobPlugin.m file not found, skipping modification.');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
replaceEmiPluginCode();
|
|
51
|
+
|
|
52
|
+
/* EMI PLUGIN one line comment END */
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
// Path to the plugin.xml file
|
|
5
|
-
const pluginXmlPath = path.join('node_modules', 'emi-indo-cordova-plugin-admob', 'plugin.xml');
|
|
6
|
-
|
|
7
|
-
// Get the store ID from the environment variable
|
|
8
|
-
const storeId = process.env.VITE_STORE_ID || '1';
|
|
9
|
-
|
|
10
|
-
// Determine the framework to use based on storeId
|
|
11
|
-
const framework = storeId === '7'
|
|
12
|
-
? '<framework src="com.google.android.gms:play-services-ads:$PLAY_SERVICES_VERSION" />'
|
|
13
|
-
: '<framework src="com.google.android.gms:play-services-ads-lite:24.6.0" />';
|
|
14
|
-
|
|
15
|
-
// Read and modify the plugin.xml file
|
|
16
|
-
fs.readFile(pluginXmlPath, 'utf8', (err, data) => {
|
|
17
|
-
if (err) {
|
|
18
|
-
console.error('Error reading plugin.xml:', err);
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Replace the existing framework line with the selected one
|
|
23
|
-
const modifiedData = data.replace(
|
|
24
|
-
/<framework src="com.google.android.gms:play-services-ads.*" \/>\n/,
|
|
25
|
-
`${framework}\n`
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
// Write the modified content back to plugin.xml
|
|
29
|
-
fs.writeFile(pluginXmlPath, modifiedData, 'utf8', (err) => {
|
|
30
|
-
if (err) {
|
|
31
|
-
console.error('Error writing plugin.xml:', err);
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
console.log('plugin.xml updated successfully.');
|
|
35
|
-
});
|
|
36
|
-
});
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
// Path to the plugin.xml file
|
|
5
|
+
const pluginXmlPath = path.join('node_modules', 'emi-indo-cordova-plugin-admob', 'plugin.xml');
|
|
6
|
+
|
|
7
|
+
// Get the store ID from the environment variable
|
|
8
|
+
const storeId = process.env.VITE_STORE_ID || '1';
|
|
9
|
+
|
|
10
|
+
// Determine the framework to use based on storeId
|
|
11
|
+
const framework = storeId === '7'
|
|
12
|
+
? '<framework src="com.google.android.gms:play-services-ads:$PLAY_SERVICES_VERSION" />'
|
|
13
|
+
: '<framework src="com.google.android.gms:play-services-ads-lite:24.6.0" />';
|
|
14
|
+
|
|
15
|
+
// Read and modify the plugin.xml file
|
|
16
|
+
fs.readFile(pluginXmlPath, 'utf8', (err, data) => {
|
|
17
|
+
if (err) {
|
|
18
|
+
console.error('Error reading plugin.xml:', err);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Replace the existing framework line with the selected one
|
|
23
|
+
const modifiedData = data.replace(
|
|
24
|
+
/<framework src="com.google.android.gms:play-services-ads.*" \/>\n/,
|
|
25
|
+
`${framework}\n`
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// Write the modified content back to plugin.xml
|
|
29
|
+
fs.writeFile(pluginXmlPath, modifiedData, 'utf8', (err) => {
|
|
30
|
+
if (err) {
|
|
31
|
+
console.error('Error writing plugin.xml:', err);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
console.log('plugin.xml updated successfully.');
|
|
35
|
+
});
|
|
36
|
+
});
|