cordova-plugin-appice 2.0.2 → 2.0.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.
@@ -1,75 +1,75 @@
1
- #!/usr/bin/env node
2
-
3
- module.exports = function(context) {
4
-
5
- var fs = require('fs');
6
- var path = require('path');
7
- var shell = require('shelljs');
8
-
9
- const cordovaCommon = context.requireCordovaModule('cordova-common');
10
- const appConfig = new cordovaCommon.ConfigParser('config.xml');
11
- var appName = appConfig.name();
12
-
13
- var platformRoot = path.join(context.opts.projectRoot, 'platforms/ios');
14
- var pluginsFirebaseRoot = path.join(context.opts.projectRoot, 'plugins/cordova-plugin-firebasex');
15
- var pluginsAppiceRoot = path.join(context.opts.projectRoot, 'plugins/cordova-plugin-appice');
16
- var APPICE_FIREBASE_UPDATE = appConfig.getPlatformPreference("APPICE_FIREBASE_UPDATE", "ios");
17
- var APPICE_APPLICATIONCLASS_INCLUDE= appConfig.getPlatformPreference("APPICE_APPLICATIONCLASS_INCLUDE", "ios");
18
- var SSL_PINNING=appConfig.getPlatformPreference("SSL_PINNING", "ios");
19
-
20
- var firebaseFile1 = path.join(platformRoot, '/'+appName+'/Plugins/cordova-plugin-firebasex/AppDelegate+FirebasePlugin.m');
21
- if (fs.existsSync(firebaseFile1)) {
22
- try {
23
- shell.rm('-Rf', firebaseFile1);
24
- } catch(err) {
25
- }
26
- }
27
-
28
- var modifiedFile1 = path.join(pluginsAppiceRoot, '/src/firebase/original/ios/AppDelegate+FirebasePlugin.m');
29
- try {
30
- shell.cp('-f', modifiedFile1, firebaseFile1);
31
- } catch(err) {
32
- }
33
-
34
- var firebaseFile2 = path.join(pluginsFirebaseRoot, '/src/ios/AppDelegate+FirebasePlugin.m');
35
- if (fs.existsSync(firebaseFile2)) {
36
- try {
37
- shell.rm('-Rf', firebaseFile2);
38
- } catch(err) {
39
- }
40
- }
41
-
42
- try {
43
- shell.cp('-f', modifiedFile1, firebaseFile2);
44
- } catch(err) {
45
- }
46
-
47
- if(SSL_PINNING === "true"){
48
- console.log("appName : "+appName);
49
- var get_info_plist=path.join(platformRoot,appName+ '/'+appName+'-Info.plist');
50
- if(fs.existsSync(get_info_plist)){
51
- console.log("ssl");
52
- try{
53
- fs.readFile(get_info_plist, 'utf8', function (err,data) {
54
- if (err) {
55
- throw new Error('Unable to find Plist: ' + err);
56
- }
57
- ///for removing SSL pinning
58
- var SSL_PINNING_key = '<key>APPICE_SSL_PINNING</key>\n<true/>';
59
- if (data.indexOf(SSL_PINNING_key) == -1) {
60
- var result = data.replace('APPICE_SSL_PINNING','');
61
- fs.writeFile(get_info_plist, result, 'utf8', function (err) {
62
- if (err) {
63
- throw new Error('Unable to write into Plist: ' + err);
64
- }
65
- });
66
-
67
- }
68
- });
69
- }
70
- catch(err) {
71
- }
72
- }
73
-
74
- }
1
+ #!/usr/bin/env node
2
+
3
+ module.exports = function(context) {
4
+
5
+ var fs = require('fs');
6
+ var path = require('path');
7
+ var shell = require('shelljs');
8
+
9
+ const cordovaCommon = context.requireCordovaModule('cordova-common');
10
+ const appConfig = new cordovaCommon.ConfigParser('config.xml');
11
+ var appName = appConfig.name();
12
+
13
+ var platformRoot = path.join(context.opts.projectRoot, 'platforms/ios');
14
+ var pluginsFirebaseRoot = path.join(context.opts.projectRoot, 'plugins/cordova-plugin-firebasex');
15
+ var pluginsAppiceRoot = path.join(context.opts.projectRoot, 'plugins/cordova-plugin-appice');
16
+ var APPICE_FIREBASE_UPDATE = appConfig.getPlatformPreference("APPICE_FIREBASE_UPDATE", "ios");
17
+ var APPICE_APPLICATIONCLASS_INCLUDE= appConfig.getPlatformPreference("APPICE_APPLICATIONCLASS_INCLUDE", "ios");
18
+ var SSL_PINNING=appConfig.getPlatformPreference("SSL_PINNING", "ios");
19
+
20
+ var firebaseFile1 = path.join(platformRoot, '/'+appName+'/Plugins/cordova-plugin-firebasex/AppDelegate+FirebasePlugin.m');
21
+ if (fs.existsSync(firebaseFile1)) {
22
+ try {
23
+ shell.rm('-Rf', firebaseFile1);
24
+ } catch(err) {
25
+ }
26
+ }
27
+
28
+ var modifiedFile1 = path.join(pluginsAppiceRoot, '/src/firebase/original/ios/AppDelegate+FirebasePlugin.m');
29
+ try {
30
+ shell.cp('-f', modifiedFile1, firebaseFile1);
31
+ } catch(err) {
32
+ }
33
+
34
+ var firebaseFile2 = path.join(pluginsFirebaseRoot, '/src/ios/AppDelegate+FirebasePlugin.m');
35
+ if (fs.existsSync(firebaseFile2)) {
36
+ try {
37
+ shell.rm('-Rf', firebaseFile2);
38
+ } catch(err) {
39
+ }
40
+ }
41
+
42
+ try {
43
+ shell.cp('-f', modifiedFile1, firebaseFile2);
44
+ } catch(err) {
45
+ }
46
+
47
+ if(SSL_PINNING === "true"){
48
+ console.log("appName : "+appName);
49
+ var get_info_plist=path.join(platformRoot,appName+ '/'+appName+'-Info.plist');
50
+ if(fs.existsSync(get_info_plist)){
51
+ console.log("ssl");
52
+ try{
53
+ fs.readFile(get_info_plist, 'utf8', function (err,data) {
54
+ if (err) {
55
+ throw new Error('Unable to find Plist: ' + err);
56
+ }
57
+ ///for removing SSL pinning
58
+ var SSL_PINNING_key = '<key>APPICE_SSL_PINNING</key>\n<true/>';
59
+ if (data.indexOf(SSL_PINNING_key) == -1) {
60
+ var result = data.replace('APPICE_SSL_PINNING','');
61
+ fs.writeFile(get_info_plist, result, 'utf8', function (err) {
62
+ if (err) {
63
+ throw new Error('Unable to write into Plist: ' + err);
64
+ }
65
+ });
66
+
67
+ }
68
+ });
69
+ }
70
+ catch(err) {
71
+ }
72
+ }
73
+
74
+ }
75
75
  }
package/src/build.gradle CHANGED
@@ -1,6 +1,6 @@
1
- allprojects {
2
- apply from: 'repositories.gradle'
3
- repositories {
4
- maven { url "https://jitpack.io" }
5
- }
1
+ allprojects {
2
+ apply from: 'repositories.gradle'
3
+ repositories {
4
+ maven { url "https://jitpack.io" }
5
+ }
6
6
  }