cordova-plugin-mserviceinterface-2.0 1.0.51 → 1.0.52
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/package.json +1 -1
- package/plugin.xml +3 -3
- package/src/android/backgroundNotification.java +14 -14
- package/src/android/mInterface.java +305 -282
- package/src/android/mInterfaceService.java +68 -140
- package/src/android/mInterfaceUtil.java +116 -118
- package/src/ios/mInterface.m +2 -1
package/package.json
CHANGED
package/plugin.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
3
3
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
4
|
id="cordova-plugin-mserviceinterface-2.0"
|
|
5
|
-
version="1.0.
|
|
5
|
+
version="1.0.52">
|
|
6
6
|
<name>mserviceinterface-2.0</name>
|
|
7
7
|
<description>This plugin establishes the connection to the native interface and performs the requested task.</description>
|
|
8
8
|
<author>selfservit@gmail.com</author>
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
</js-module>
|
|
20
20
|
<platform name="android">
|
|
21
21
|
<framework src="src/android/doubleogradle.gradle" custom="true" type="gradleReference"/>
|
|
22
|
-
<framework src="com.google.android.gms:play-services-location:
|
|
22
|
+
<framework src="com.google.android.gms:play-services-location:21.0.1" />
|
|
23
|
+
<framework src="androidx.exifinterface:exifinterface:1.3.5" />
|
|
23
24
|
<framework src="com.android.support:support-v4:28.0.0" />
|
|
24
25
|
<framework src="com.google.zxing:core:3.3.2" />
|
|
25
26
|
<framework src="com.journeyapps:zxing-android-embedded:3.6.0@aar" />
|
|
@@ -46,7 +47,6 @@
|
|
|
46
47
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
47
48
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
48
49
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
|
49
|
-
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
|
50
50
|
</config-file>
|
|
51
51
|
<config-file target="AndroidManifest.xml" parent="/manifest/application">
|
|
52
52
|
<service android:name="com.selfservit.util.mInterfaceService" android:foregroundServiceType="location" android:enabled="true" android:exported="true"/>
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
package com.selfservit.util;
|
|
2
2
|
|
|
3
|
+
import static com.selfservit.util.mInterfaceUtil.decrypt;
|
|
4
|
+
|
|
3
5
|
import android.content.Context;
|
|
4
|
-
import android.os.Build;
|
|
5
|
-
import android.os.Environment;
|
|
6
6
|
import android.util.Log;
|
|
7
|
+
|
|
7
8
|
import com.onesignal.OSNotification;
|
|
8
9
|
import com.onesignal.OSNotificationReceivedEvent;
|
|
9
10
|
import com.onesignal.OneSignal;
|
|
10
11
|
|
|
11
12
|
import org.json.JSONException;
|
|
12
13
|
import org.json.JSONObject;
|
|
14
|
+
|
|
13
15
|
import java.io.BufferedReader;
|
|
14
16
|
import java.io.File;
|
|
15
17
|
import java.io.FileReader;
|
|
16
18
|
import java.io.FileWriter;
|
|
17
19
|
import java.io.IOException;
|
|
18
|
-
import java.math.BigInteger;
|
|
19
|
-
import java.text.SimpleDateFormat;
|
|
20
20
|
import java.util.Date;
|
|
21
21
|
import java.util.Locale;
|
|
22
|
-
import static com.selfservit.util.mInterfaceUtil.decrypt;
|
|
23
|
-
|
|
24
|
-
import androidx.annotation.RequiresApi;
|
|
25
|
-
import androidx.core.app.NotificationCompat;
|
|
26
22
|
|
|
27
23
|
public class backgroundNotification implements OneSignal.OSRemoteNotificationReceivedHandler {
|
|
28
24
|
|
|
@@ -53,7 +49,10 @@ public class backgroundNotification implements OneSignal.OSRemoteNotificationRec
|
|
|
53
49
|
if (!subKey.equals("")) {
|
|
54
50
|
fileDirectory = new File(mInterfaceUtil.rootDirectory + "/" + baseDirectory[(baseDirectory.length - 1)] + "/" + clientID + "/" + countryCode + "/" + "content_store" + "/" + "msvMsg" + "/" + "history"+ "/" + packageName + "/" + key + "/" + subKey);
|
|
55
51
|
if (!fileDirectory.exists()) {
|
|
56
|
-
fileDirectory.mkdirs();
|
|
52
|
+
boolean success = fileDirectory.mkdirs();
|
|
53
|
+
if (!success) {
|
|
54
|
+
System.out.println("Directory not created");
|
|
55
|
+
}
|
|
57
56
|
}
|
|
58
57
|
notificationsFile = new File(fileDirectory, subKey + ".txt");
|
|
59
58
|
|
|
@@ -76,7 +75,7 @@ public class backgroundNotification implements OneSignal.OSRemoteNotificationRec
|
|
|
76
75
|
fw.write(mInterfaceUtil.encrypt(notificationStr));
|
|
77
76
|
fw.close();
|
|
78
77
|
} catch (Exception e) {
|
|
79
|
-
|
|
78
|
+
e.printStackTrace();
|
|
80
79
|
}
|
|
81
80
|
} else {
|
|
82
81
|
System.out.println("Does not Exists");
|
|
@@ -84,17 +83,18 @@ public class backgroundNotification implements OneSignal.OSRemoteNotificationRec
|
|
|
84
83
|
FileWriter fw = new FileWriter(notificationsFile);
|
|
85
84
|
fw.write(mInterfaceUtil.encrypt(","+ notification.getAdditionalData().getString("msgBody")));
|
|
86
85
|
fw.close();
|
|
87
|
-
} catch (IOException e1) {
|
|
86
|
+
} catch (IOException | JSONException e1) {
|
|
88
87
|
e1.printStackTrace();
|
|
89
|
-
} catch (JSONException e) {
|
|
90
|
-
e.printStackTrace();
|
|
91
88
|
}
|
|
92
89
|
}
|
|
93
90
|
}
|
|
94
91
|
} else {
|
|
95
92
|
fileDirectory = new File(mInterfaceUtil.rootDirectory + "/" + baseDirectory[(baseDirectory.length - 1)] + "/" + clientID + "/" + countryCode + "/" + "notifications" + "/" + "unread");
|
|
96
93
|
if (!fileDirectory.exists()) {
|
|
97
|
-
fileDirectory.mkdirs();
|
|
94
|
+
boolean success = fileDirectory.mkdirs();
|
|
95
|
+
if (!success) {
|
|
96
|
+
System.out.println("Directory not created");
|
|
97
|
+
}
|
|
98
98
|
}
|
|
99
99
|
notificationsFile = new File(fileDirectory, notification.getNotificationId() + ".json");
|
|
100
100
|
Date date = new Date();
|