pushwoosh-cordova-plugin 8.3.58 → 8.3.59

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.
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- module.exports = function(context) {
7
- const platforms = context.opts.platforms;
8
-
9
- if (platforms.indexOf('android') === -1) {
10
- return;
11
- }
12
-
13
- const platformRoot = path.join(context.opts.projectRoot, 'platforms/android');
14
- const wrapperDir = path.join(platformRoot, 'gradle/wrapper');
15
- const wrapperPropsPath = path.join(wrapperDir, 'gradle-wrapper.properties');
16
-
17
- // Create wrapper directory if it doesn't exist
18
- if (!fs.existsSync(wrapperDir)) {
19
- fs.mkdirSync(wrapperDir, { recursive: true });
20
- }
21
-
22
- // Write gradle-wrapper.properties with Gradle 8.7
23
- const wrapperContent = `distributionBase=GRADLE_USER_HOME
24
- distributionPath=wrapper/dists
25
- distributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-all.zip
26
- networkTimeout=10000
27
- validateDistributionUrl=true
28
- zipStoreBase=GRADLE_USER_HOME
29
- zipStorePath=wrapper/dists
30
- `;
31
-
32
- fs.writeFileSync(wrapperPropsPath, wrapperContent, 'utf8');
33
- console.log('[Hook] Created gradle-wrapper.properties with Gradle 8.7');
34
- };
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- module.exports = function(context) {
7
- const platforms = context.opts.platforms;
8
-
9
- if (platforms.indexOf('android') === -1) {
10
- return;
11
- }
12
-
13
- const platformRoot = path.join(context.opts.projectRoot, 'platforms/android');
14
- const configPath = path.join(platformRoot, 'cdv-gradle-config.json');
15
-
16
- if (!fs.existsSync(configPath)) {
17
- console.log('[Hook] cdv-gradle-config.json not found, skipping AGP fix');
18
- return;
19
- }
20
-
21
- try {
22
- const configContent = fs.readFileSync(configPath, 'utf8');
23
- const config = JSON.parse(configContent);
24
-
25
- // Fix AGP version to 8.5.1 (compatible with Android Studio)
26
- if (config.AGP_VERSION !== '8.5.1') {
27
- config.AGP_VERSION = '8.5.1';
28
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf8');
29
- console.log('[Hook] Fixed AGP version to 8.5.1 in cdv-gradle-config.json');
30
- } else {
31
- console.log('[Hook] AGP version already correct (8.5.1)');
32
- }
33
- } catch (error) {
34
- console.error('[Hook] Error fixing AGP version:', error.message);
35
- }
36
- };
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- module.exports = function(context) {
7
- const platforms = context.opts.platforms;
8
-
9
- if (platforms.indexOf('android') === -1) {
10
- return;
11
- }
12
-
13
- const projectRoot = context.opts.projectRoot;
14
- const sourceFile = path.join(projectRoot, 'google-services.json');
15
- const targetFile = path.join(projectRoot, 'platforms/android/app/google-services.json');
16
-
17
- if (fs.existsSync(sourceFile)) {
18
- fs.copyFileSync(sourceFile, targetFile);
19
- console.log('[Hook] Copied google-services.json to platforms/android/app/');
20
- } else {
21
- console.log('[Hook] Warning: google-services.json not found in project root');
22
- }
23
- };
@@ -1,43 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- module.exports = function(context) {
7
- const platforms = context.opts.platforms;
8
-
9
- if (platforms.indexOf('ios') === -1) {
10
- return;
11
- }
12
-
13
- const iosPlatformRoot = path.join(context.opts.projectRoot, 'platforms', 'ios');
14
- const podfilePath = path.join(iosPlatformRoot, 'Podfile');
15
-
16
- if (!fs.existsSync(podfilePath)) {
17
- console.log('[Hook] Podfile not found, skipping VoIP pod injection');
18
- return;
19
- }
20
-
21
- let podfileContent = fs.readFileSync(podfilePath, 'utf8');
22
-
23
- // Check if PushwooshVoIP already added
24
- if (podfileContent.includes("pod 'PushwooshVoIP'")) {
25
- console.log('[Hook] PushwooshVoIP pod already present in Podfile');
26
- return;
27
- }
28
-
29
- // Find the target block and add PushwooshVoIP pod
30
- const targetRegex = /(target\s+'[^']+'\s+do[\s\S]*?pod\s+'Pushwoosh'[^\n]*\n)/;
31
-
32
- if (targetRegex.test(podfileContent)) {
33
- podfileContent = podfileContent.replace(
34
- targetRegex,
35
- "$1 pod 'PushwooshXCFramework/PushwooshVoIP'\n"
36
- );
37
-
38
- fs.writeFileSync(podfilePath, podfileContent, 'utf8');
39
- console.log('[Hook] Added PushwooshVoIP pod to Podfile');
40
- } else {
41
- console.log('[Hook] Could not find Pushwoosh pod in Podfile, skipping VoIP pod injection');
42
- }
43
- };
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- module.exports = function(context) {
7
- const platforms = context.opts.platforms;
8
-
9
- if (platforms.indexOf('android') !== -1) {
10
- const androidPlatformRoot = path.join(context.opts.projectRoot, 'platforms', 'android');
11
- const localPropertiesPath = path.join(androidPlatformRoot, 'local.properties');
12
-
13
- // Android SDK path - adjust if needed
14
- const sdkPath = process.env.ANDROID_HOME ||
15
- process.env.ANDROID_SDK_ROOT ||
16
- path.join(process.env.HOME, 'Library', 'Android', 'sdk');
17
-
18
- const content = `## This file must *NOT* be checked into Version Control Systems,
19
- # as it contains information specific to your local configuration.
20
- #
21
- # Location of the SDK. This is only used by Gradle.
22
- sdk.dir=${sdkPath}
23
- `;
24
-
25
- fs.writeFileSync(localPropertiesPath, content, 'utf8');
26
- console.log('[Hook] Created local.properties with sdk.dir=' + sdkPath);
27
- }
28
- };