cordova-plugin-mserviceinterface-2.0 1.0.22 → 1.0.26
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 +28 -28
- package/plugin.xml +153 -153
- package/src/android/CallbackProgressDialog.java +53 -53
- package/src/android/FileProvider.java +7 -7
- package/src/android/backgroundNotification.java +120 -120
- package/src/android/doubleogradle.gradle +5 -5
- package/src/android/mInterface.java +2087 -2065
- package/src/android/mInterfaceReceiver.java +59 -59
- package/src/android/mInterfaceService.java +749 -749
- package/src/android/mInterfaceUtil.java +1686 -1686
- package/src/android/res/xml/network_security_config.xml +8 -8
- package/src/android/res/xml/opener_paths.xml +16 -16
- package/src/ios/InternetConnection.h +64 -64
- package/src/ios/InternetConnection.m +242 -242
- package/src/ios/SSZipArchive.h +146 -146
- package/src/ios/SSZipArchive.m +1180 -1180
- package/src/ios/SSZipCommon.h +66 -66
- package/src/ios/UICKeyChainStore.h +64 -64
- package/src/ios/UICKeyChainStore.m +434 -434
- package/src/ios/XMLConverter.h +61 -61
- package/src/ios/XMLConverter.m +243 -243
- package/src/ios/ZipArchive.h +19 -19
- package/src/ios/aes/aes.h +270 -270
- package/src/ios/aes/aes_ni.c +687 -687
- package/src/ios/aes/aes_ni.h +59 -59
- package/src/ios/aes/aescrypt.c +301 -301
- package/src/ios/aes/aeskey.c +554 -554
- package/src/ios/aes/aesopt.h +776 -776
- package/src/ios/aes/aestab.c +418 -418
- package/src/ios/aes/aestab.h +173 -173
- package/src/ios/aes/brg_endian.h +127 -127
- package/src/ios/aes/brg_types.h +191 -191
- package/src/ios/aes/fileenc.c +145 -145
- package/src/ios/aes/fileenc.h +121 -121
- package/src/ios/aes/hmac.c +209 -209
- package/src/ios/aes/hmac.h +119 -119
- package/src/ios/aes/prng.c +155 -155
- package/src/ios/aes/prng.h +82 -82
- package/src/ios/aes/pwd2key.c +181 -181
- package/src/ios/aes/pwd2key.h +45 -45
- package/src/ios/aes/sha1.c +283 -283
- package/src/ios/aes/sha1.h +72 -72
- package/src/ios/mInterface.h +2 -0
- package/src/ios/mInterface.m +21 -1
- package/src/ios/minizip/crypt.c +146 -146
- package/src/ios/minizip/crypt.h +66 -66
- package/src/ios/minizip/ioapi.c +353 -353
- package/src/ios/minizip/ioapi.h +154 -154
- package/src/ios/minizip/ioapi_buf.c +452 -452
- package/src/ios/minizip/ioapi_buf.h +52 -52
- package/src/ios/minizip/ioapi_mem.c +167 -167
- package/src/ios/minizip/ioapi_mem.h +52 -52
- package/src/ios/minizip/minishared.c +292 -292
- package/src/ios/minizip/minishared.h +50 -50
- package/src/ios/minizip/unzip.c +2007 -2007
- package/src/ios/minizip/unzip.h +254 -254
- package/src/ios/minizip/zip.c +2007 -2007
- package/src/ios/minizip/zip.h +215 -215
- package/www/mInterface.js +3 -3
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
package com.selfservit.util;
|
|
2
|
-
|
|
3
|
-
import android.app.ActivityManager;
|
|
4
|
-
import android.content.BroadcastReceiver;
|
|
5
|
-
import android.content.Context;
|
|
6
|
-
import android.content.Intent;
|
|
7
|
-
import android.os.Build;
|
|
8
|
-
|
|
9
|
-
public class mInterfaceReceiver extends BroadcastReceiver {
|
|
10
|
-
public mInterfaceReceiver() {
|
|
11
|
-
//constructor
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@ Override
|
|
15
|
-
public void onReceive(Context context, Intent intent) {
|
|
16
|
-
try {
|
|
17
|
-
if (intent.getAction().equalsIgnoreCase(Intent.ACTION_BOOT_COMPLETED)) {
|
|
18
|
-
Intent serviceIntent = new Intent(context, mInterfaceService.class);
|
|
19
|
-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
20
|
-
context.startForegroundService(serviceIntent);
|
|
21
|
-
} else {
|
|
22
|
-
context.startService(serviceIntent);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (intent.getAction().equalsIgnoreCase("com.example.checkservice")) {
|
|
26
|
-
if (!isServiceRunning(context) || !isProcessRunning(context)) {
|
|
27
|
-
Intent serviceIntent = new Intent(context, mInterfaceService.class);
|
|
28
|
-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
29
|
-
context.startForegroundService(serviceIntent);
|
|
30
|
-
} else {
|
|
31
|
-
context.startService(serviceIntent);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
}catch (Exception e){
|
|
37
|
-
e.printStackTrace();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
private boolean isServiceRunning(Context context) {
|
|
41
|
-
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
|
42
|
-
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
|
|
43
|
-
if (mInterfaceService.class.getName().equals(service.service.getClassName())) {
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
private boolean isProcessRunning(Context context) {
|
|
51
|
-
ActivityManager manager1 = (ActivityManager)context.getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE);
|
|
52
|
-
for (ActivityManager.RunningAppProcessInfo processInfo : manager1.getRunningAppProcesses()) {
|
|
53
|
-
if (processInfo.processName.equals(context.getPackageName())) {
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
package com.selfservit.util;
|
|
2
|
+
|
|
3
|
+
import android.app.ActivityManager;
|
|
4
|
+
import android.content.BroadcastReceiver;
|
|
5
|
+
import android.content.Context;
|
|
6
|
+
import android.content.Intent;
|
|
7
|
+
import android.os.Build;
|
|
8
|
+
|
|
9
|
+
public class mInterfaceReceiver extends BroadcastReceiver {
|
|
10
|
+
public mInterfaceReceiver() {
|
|
11
|
+
//constructor
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@ Override
|
|
15
|
+
public void onReceive(Context context, Intent intent) {
|
|
16
|
+
try {
|
|
17
|
+
if (intent.getAction().equalsIgnoreCase(Intent.ACTION_BOOT_COMPLETED)) {
|
|
18
|
+
Intent serviceIntent = new Intent(context, mInterfaceService.class);
|
|
19
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
20
|
+
context.startForegroundService(serviceIntent);
|
|
21
|
+
} else {
|
|
22
|
+
context.startService(serviceIntent);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (intent.getAction().equalsIgnoreCase("com.example.checkservice")) {
|
|
26
|
+
if (!isServiceRunning(context) || !isProcessRunning(context)) {
|
|
27
|
+
Intent serviceIntent = new Intent(context, mInterfaceService.class);
|
|
28
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
29
|
+
context.startForegroundService(serviceIntent);
|
|
30
|
+
} else {
|
|
31
|
+
context.startService(serviceIntent);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}catch (Exception e){
|
|
37
|
+
e.printStackTrace();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
private boolean isServiceRunning(Context context) {
|
|
41
|
+
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
|
42
|
+
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
|
|
43
|
+
if (mInterfaceService.class.getName().equals(service.service.getClassName())) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
private boolean isProcessRunning(Context context) {
|
|
51
|
+
ActivityManager manager1 = (ActivityManager)context.getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE);
|
|
52
|
+
for (ActivityManager.RunningAppProcessInfo processInfo : manager1.getRunningAppProcesses()) {
|
|
53
|
+
if (processInfo.processName.equals(context.getPackageName())) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|