cordova-plugin-mserviceinterface-2.0 1.0.31 → 1.0.34
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 +2 -1
- package/src/android/mInterface.java +157 -15
- package/src/android/mInterfaceService.java +13 -11
- package/src/ios/mInterface.m +10 -3
- package/package.json.bak +0 -28
- package/plugin.xml.bak +0 -154
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.34">
|
|
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>
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
<framework src="com.android.support:support-v4:26.0.1" />
|
|
25
25
|
<framework src="com.google.zxing:core:3.2.1" />
|
|
26
26
|
<framework src="com.journeyapps:zxing-android-embedded:3.2.0@aar" />
|
|
27
|
+
<framework src="id.zelory:compressor:2.1.1" />
|
|
27
28
|
<edit-config xmlns:android="http://schemas.android.com/apk/res/android" file="AndroidManifest.xml" mode="merge" target="/manifest/application">
|
|
28
29
|
<application android:networkSecurityConfig="@xml/network_security_config" />
|
|
29
30
|
<application android:requestLegacyExternalStorage="true" />
|
|
@@ -13,6 +13,7 @@ import android.content.DialogInterface;
|
|
|
13
13
|
import android.content.Intent;
|
|
14
14
|
import android.content.IntentSender;
|
|
15
15
|
import android.content.pm.ActivityInfo;
|
|
16
|
+
import android.content.pm.ApplicationInfo;
|
|
16
17
|
import android.content.pm.PackageManager;
|
|
17
18
|
import android.database.Cursor;
|
|
18
19
|
import android.graphics.Bitmap;
|
|
@@ -30,6 +31,7 @@ import android.os.AsyncTask;
|
|
|
30
31
|
import android.os.Build;
|
|
31
32
|
import android.os.Bundle;
|
|
32
33
|
import android.os.Environment;
|
|
34
|
+
import android.os.FileUtils;
|
|
33
35
|
import android.os.PowerManager;
|
|
34
36
|
import android.provider.DocumentsContract;
|
|
35
37
|
import android.provider.MediaStore;
|
|
@@ -77,6 +79,7 @@ import java.io.BufferedInputStream;
|
|
|
77
79
|
import java.io.BufferedReader;
|
|
78
80
|
import java.io.ByteArrayOutputStream;
|
|
79
81
|
import java.io.File;
|
|
82
|
+
import java.io.FileInputStream;
|
|
80
83
|
import java.io.FileOutputStream;
|
|
81
84
|
import java.io.IOException;
|
|
82
85
|
import java.io.InputStream;
|
|
@@ -100,6 +103,9 @@ import java.util.List;
|
|
|
100
103
|
import java.util.ArrayList;
|
|
101
104
|
import java.util.Arrays;
|
|
102
105
|
|
|
106
|
+
|
|
107
|
+
import id.zelory.compressor.Compressor;
|
|
108
|
+
|
|
103
109
|
import static android.app.Activity.RESULT_OK;
|
|
104
110
|
|
|
105
111
|
public class mInterface extends CordovaPlugin implements com.google.android.gms.location.LocationListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, ResultCallback<LocationSettingsResult> {
|
|
@@ -667,7 +673,7 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
|
|
|
667
673
|
try {
|
|
668
674
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
|
669
675
|
Uri contentUri = FileProvider.getUriForFile(context, context.getPackageName() + ".provider", imageFilePath);
|
|
670
|
-
intent.setDataAndType(contentUri, getMimeType(filePath));
|
|
676
|
+
intent.setDataAndType(contentUri, getMimeType(filePath,null));
|
|
671
677
|
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_ACTIVITY_NO_HISTORY);
|
|
672
678
|
cordova.getActivity().startActivity(intent);
|
|
673
679
|
callbackContext.success();
|
|
@@ -955,13 +961,18 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
|
|
|
955
961
|
}
|
|
956
962
|
|
|
957
963
|
private void checkLocationPermission(JSONArray args, CallbackContext callbackContext) {
|
|
958
|
-
boolean permissionGranted = true;
|
|
964
|
+
boolean permissionGranted = true, checkPermission = true;
|
|
959
965
|
List<String> list;
|
|
960
966
|
try {
|
|
961
967
|
callback = callbackContext;
|
|
962
968
|
Context context = cordova.getActivity().getApplicationContext();
|
|
963
|
-
|
|
964
|
-
|
|
969
|
+
String[] permissions = args.optJSONObject(0).optString("permissions").split(",");
|
|
970
|
+
if (permissions[0].equalsIgnoreCase("android.permission.ACCESS_BACKGROUND_LOCATION")) {
|
|
971
|
+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
|
|
972
|
+
checkPermission = false;
|
|
973
|
+
}
|
|
974
|
+
};
|
|
975
|
+
if (checkPermission) {
|
|
965
976
|
list = new ArrayList<String>(Arrays.asList(permissions));
|
|
966
977
|
permissions = list.toArray(new String[0]);
|
|
967
978
|
|
|
@@ -988,7 +999,6 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
|
|
|
988
999
|
try {
|
|
989
1000
|
callback = callbackContext;
|
|
990
1001
|
Context context = cordova.getActivity().getApplicationContext();
|
|
991
|
-
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
|
|
992
1002
|
String[] permissions = args.optJSONObject(0).optString("permissions").split(",");
|
|
993
1003
|
list = new ArrayList<String>(Arrays.asList(permissions));
|
|
994
1004
|
permissions = list.toArray(new String[0]);
|
|
@@ -1003,9 +1013,6 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
|
|
|
1003
1013
|
} else {
|
|
1004
1014
|
callback.success("success");
|
|
1005
1015
|
}
|
|
1006
|
-
} else {
|
|
1007
|
-
callback.success("success");
|
|
1008
|
-
}
|
|
1009
1016
|
} catch (Exception e) {
|
|
1010
1017
|
e.printStackTrace();
|
|
1011
1018
|
}
|
|
@@ -1115,13 +1122,25 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
|
|
|
1115
1122
|
callbackContext.sendPluginResult(pluginResult);
|
|
1116
1123
|
}
|
|
1117
1124
|
|
|
1118
|
-
private
|
|
1125
|
+
private String getMimeType(String path,Uri uri) {
|
|
1119
1126
|
String mimeType = null;
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1127
|
+
if(uri==null){
|
|
1128
|
+
String extension = MimeTypeMap.getFileExtensionFromUrl(path);
|
|
1129
|
+
if (extension != null) {
|
|
1130
|
+
MimeTypeMap mime = MimeTypeMap.getSingleton();
|
|
1131
|
+
mimeType = mime.getMimeTypeFromExtension(extension.toLowerCase());
|
|
1132
|
+
}
|
|
1133
|
+
}else{
|
|
1134
|
+
if (ContentResolver.SCHEME_CONTENT.equals(uri.getScheme())) {
|
|
1135
|
+
ContentResolver cr = cordova.getActivity().getContentResolver();
|
|
1136
|
+
mimeType = cr.getType(uri);
|
|
1137
|
+
} else {
|
|
1138
|
+
String fileExtension = MimeTypeMap.getFileExtensionFromUrl(uri
|
|
1139
|
+
.toString());
|
|
1140
|
+
mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(
|
|
1141
|
+
fileExtension.toLowerCase());
|
|
1142
|
+
}
|
|
1143
|
+
};
|
|
1125
1144
|
return mimeType;
|
|
1126
1145
|
}
|
|
1127
1146
|
|
|
@@ -1156,6 +1175,121 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
|
|
|
1156
1175
|
}
|
|
1157
1176
|
|
|
1158
1177
|
public void convertImageTo64BaseString(CallbackContext callbackContext, String imageSourcePath, String imgSrcType, String destinationPath) {
|
|
1178
|
+
InputStream srcFileReader;
|
|
1179
|
+
OutputStream desFileWriter;
|
|
1180
|
+
byte[] buf;
|
|
1181
|
+
int srcFileSize;
|
|
1182
|
+
String compressedImagePathStr = "";
|
|
1183
|
+
String compressedImageName = "";
|
|
1184
|
+
Bitmap bitmap;
|
|
1185
|
+
BitmapFactory.Options options = new BitmapFactory.Options();
|
|
1186
|
+
options.inJustDecodeBounds = true;
|
|
1187
|
+
String[] bits = imageSourcePath.split("/");
|
|
1188
|
+
|
|
1189
|
+
String fileNameToSend = bits[bits.length - 1];
|
|
1190
|
+
if (fileNameToSend.indexOf(".") > 0)
|
|
1191
|
+
fileNameToSend = fileNameToSend.substring(0, fileNameToSend.lastIndexOf("."));
|
|
1192
|
+
|
|
1193
|
+
File fileToCompress = new File(imageSourcePath);
|
|
1194
|
+
String thumbnail = getFileThumbnail(imageSourcePath, "." + imageSourcePath.substring(imageSourcePath.lastIndexOf(".") + 1).toLowerCase());
|
|
1195
|
+
File compressedImageFile = null;
|
|
1196
|
+
|
|
1197
|
+
try {
|
|
1198
|
+
compressedImageFile = new Compressor(cordova.getActivity())
|
|
1199
|
+
.setQuality(15)
|
|
1200
|
+
.setCompressFormat(Bitmap.CompressFormat.JPEG)
|
|
1201
|
+
.compressToFile(fileToCompress);
|
|
1202
|
+
|
|
1203
|
+
if (imgSrcType.equals("compress")) {
|
|
1204
|
+
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
|
|
1205
|
+
if (!destinationPath.equalsIgnoreCase("")) {
|
|
1206
|
+
compressedImagePathStr = mInterfaceUtil.rootDirectory + "/" + destinationPath;
|
|
1207
|
+
} else {
|
|
1208
|
+
compressedImagePathStr = mInterfaceUtil.rootDirectory + "/" + mInterfaceUtil.packageName + "/" + "images";
|
|
1209
|
+
}
|
|
1210
|
+
compressedImageName = compressedImagePathStr + "/" + fileNameToSend + "_" + timeStamp + ".jpg";
|
|
1211
|
+
File fileSavedPath = new File(compressedImagePathStr);
|
|
1212
|
+
if (!fileSavedPath.exists()) {
|
|
1213
|
+
fileSavedPath.mkdirs();
|
|
1214
|
+
}
|
|
1215
|
+
File sourceFileObj = compressedImageFile;
|
|
1216
|
+
//** CHECK SOURCE FILE EXITS OR NOT **//
|
|
1217
|
+
if (sourceFileObj.exists()) {
|
|
1218
|
+
srcFileReader = new FileInputStream(sourceFileObj);
|
|
1219
|
+
desFileWriter = new FileOutputStream(new File(compressedImageName));
|
|
1220
|
+
buf = new byte[1024];
|
|
1221
|
+
//** WRITE SOURCE FILE INTO CONTENT_STORE DESTINATION PATH **//
|
|
1222
|
+
while ((srcFileSize = srcFileReader.read(buf)) > 0) {
|
|
1223
|
+
desFileWriter.write(buf, 0, srcFileSize);
|
|
1224
|
+
}
|
|
1225
|
+
srcFileReader.close();
|
|
1226
|
+
desFileWriter.close();
|
|
1227
|
+
}
|
|
1228
|
+
bitmap = BitmapFactory.decodeFile(compressedImageName);
|
|
1229
|
+
|
|
1230
|
+
} else {
|
|
1231
|
+
bitmap = BitmapFactory.decodeFile(compressedImageFile.getAbsolutePath());
|
|
1232
|
+
}
|
|
1233
|
+
String encodedImage = null;
|
|
1234
|
+
try {
|
|
1235
|
+
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
|
1236
|
+
bitmap.compress(Bitmap.CompressFormat.JPEG, 15, outputStream);
|
|
1237
|
+
Base64.encodeToString(outputStream.toByteArray(), Base64.NO_WRAP);
|
|
1238
|
+
encodedImage = Base64.encodeToString(outputStream.toByteArray(), Base64.NO_WRAP);
|
|
1239
|
+
if (imgSrcType.equals("camera")) {
|
|
1240
|
+
File file = new File(imageSourcePath);
|
|
1241
|
+
if (file.exists()) {
|
|
1242
|
+
file.delete();
|
|
1243
|
+
}
|
|
1244
|
+
attachmentDestPath = "";
|
|
1245
|
+
callbackContext.success(encodedImage);
|
|
1246
|
+
} else if (imgSrcType.equals("gallery")) {
|
|
1247
|
+
attachmentDestPath = "";
|
|
1248
|
+
callbackContext.success(encodedImage);
|
|
1249
|
+
} else if (imgSrcType.equals("compress")) {
|
|
1250
|
+
try {
|
|
1251
|
+
|
|
1252
|
+
if (!destinationPath.equalsIgnoreCase("")) {
|
|
1253
|
+
File file = new File(imageSourcePath);
|
|
1254
|
+
if (file.exists()) {
|
|
1255
|
+
file.delete();
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
JSONObject fileProperities = null;
|
|
1259
|
+
String imgFilePath, fileName, fileExtension = "";
|
|
1260
|
+
imgFilePath = compressedImageName.substring(0, compressedImageName.lastIndexOf("/"));
|
|
1261
|
+
String[] fileName1 = compressedImageName.split("/");
|
|
1262
|
+
fileName = fileName1[fileName1.length - 1];
|
|
1263
|
+
File file = new File(compressedImageName);
|
|
1264
|
+
long fileSize = file.length();
|
|
1265
|
+
fileExtension = "." + compressedImageName.substring(compressedImageName.lastIndexOf(".") + 1).toLowerCase();
|
|
1266
|
+
fileProperities = new JSONObject();
|
|
1267
|
+
fileProperities.put("filePath", imgFilePath);
|
|
1268
|
+
fileProperities.put("fileName", fileName);
|
|
1269
|
+
fileProperities.put("fileSize", fileSize);
|
|
1270
|
+
fileProperities.put("fileExtension", fileExtension);
|
|
1271
|
+
fileProperities.put("thumbnail", thumbnail);
|
|
1272
|
+
attachmentDestPath = "";
|
|
1273
|
+
callback.success(fileProperities);
|
|
1274
|
+
} catch (Exception e) {
|
|
1275
|
+
attachmentDestPath = "";
|
|
1276
|
+
callback.error(e.getMessage());
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
} catch (Exception e) {
|
|
1280
|
+
attachmentDestPath = "";
|
|
1281
|
+
callbackContext.error(e.getMessage());
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
} catch (IOException e) {
|
|
1285
|
+
e.printStackTrace();
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
public void convertImageTo64BaseString1(CallbackContext callbackContext, String imageSourcePath, String imgSrcType, String destinationPath) {
|
|
1159
1293
|
String compressedImagePathStr = "";
|
|
1160
1294
|
String compressedImageName = "";
|
|
1161
1295
|
String filePath = imageSourcePath;
|
|
@@ -1410,8 +1544,14 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
|
|
|
1410
1544
|
r.put("timeZone", TimeZone.getDefault());
|
|
1411
1545
|
r.put("sdkVersion", sdkversion);
|
|
1412
1546
|
r.put("productName", android.os.Build.PRODUCT);
|
|
1547
|
+
r.put("applicationName", getApplicationName(cordova.getActivity()));
|
|
1413
1548
|
callbackContext.success(r);
|
|
1414
1549
|
}
|
|
1550
|
+
public static String getApplicationName(Context context) {
|
|
1551
|
+
ApplicationInfo applicationInfo = context.getApplicationInfo();
|
|
1552
|
+
int stringId = applicationInfo.labelRes;
|
|
1553
|
+
return stringId == 0 ? applicationInfo.nonLocalizedLabel.toString() : context.getString(stringId);
|
|
1554
|
+
}
|
|
1415
1555
|
|
|
1416
1556
|
@Override
|
|
1417
1557
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
@@ -1602,6 +1742,8 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
|
|
|
1602
1742
|
fileName = fileName + "_" + timeStamp + extension;
|
|
1603
1743
|
}
|
|
1604
1744
|
|
|
1745
|
+
}else{
|
|
1746
|
+
fileName = uri.getLastPathSegment();
|
|
1605
1747
|
}
|
|
1606
1748
|
} finally {
|
|
1607
1749
|
if (cursor != null) {
|
|
@@ -1614,7 +1756,7 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
|
|
|
1614
1756
|
|
|
1615
1757
|
filePath = copyFileFromUri(cordova.getActivity().getApplicationContext(), uri, fileName, attachmentDestPath,callback);
|
|
1616
1758
|
File file = new File(filePath);
|
|
1617
|
-
String mimeType = getMimeType(filePath);
|
|
1759
|
+
String mimeType = getMimeType(filePath,uri);
|
|
1618
1760
|
System.out.println("Mime type is: " + mimeType);
|
|
1619
1761
|
double fileSize = file.length();
|
|
1620
1762
|
if (filePath != null) {
|
|
@@ -220,7 +220,8 @@ public class mInterfaceService extends Service implements com.google.android.gms
|
|
|
220
220
|
.build();
|
|
221
221
|
mGoogleApiClient.connect();
|
|
222
222
|
};
|
|
223
|
-
|
|
223
|
+
getPeriodicalLocationUpdates();
|
|
224
|
+
update();
|
|
224
225
|
}
|
|
225
226
|
}
|
|
226
227
|
} else {
|
|
@@ -542,19 +543,10 @@ public class mInterfaceService extends Service implements com.google.android.gms
|
|
|
542
543
|
readerObj = new BufferedReader(new FileReader(new File(baseDirectory, "/" + mInterfaceUtil.packageName + "/MyLocation_encrypted.txt")));
|
|
543
544
|
while ((currentLine = readerObj.readLine()) != null) {
|
|
544
545
|
locationData.append(decrypt(currentLine));
|
|
545
|
-
//lastKnownLocation = currentLine + "\n";
|
|
546
546
|
}
|
|
547
547
|
readerObj.close();
|
|
548
548
|
serverData = locationData.toString();
|
|
549
549
|
|
|
550
|
-
/* CLEARING THE LOCATION POINTS */
|
|
551
|
-
if (serverData != "") {
|
|
552
|
-
writerObj = new BufferedWriter(new FileWriter(new File(baseDirectory, "/" + mInterfaceUtil.packageName + "/MyLocation_encrypted.txt")));
|
|
553
|
-
writerObj.write("");
|
|
554
|
-
writerObj.flush();
|
|
555
|
-
writerObj.close();
|
|
556
|
-
}
|
|
557
|
-
|
|
558
550
|
for (int index = 0; index < accountsList.length(); index++) {
|
|
559
551
|
currentAccount = accountsList.optJSONObject(index);
|
|
560
552
|
if (currentAccount.optString("location_update_ind").toString().equals("true")) {
|
|
@@ -581,8 +573,18 @@ public class mInterfaceService extends Service implements com.google.android.gms
|
|
|
581
573
|
oStreamObj.write("<location_xml><client_id>" + clientID + "</client_id><country_code>" + countryCode + "</country_code><device_id>" + deviceID + "</device_id><location>" + serverData + "</location></location_xml>");
|
|
582
574
|
oStreamObj.flush();
|
|
583
575
|
oStreamObj.close();
|
|
584
|
-
urlConObj.getResponseCode();
|
|
576
|
+
int responseCode = urlConObj.getResponseCode();
|
|
577
|
+
|
|
585
578
|
urlConObj.disconnect();
|
|
579
|
+
if(responseCode == HttpURLConnection.HTTP_OK){
|
|
580
|
+
/* CLEARING THE LOCATION POINTS */
|
|
581
|
+
if (serverData != "") {
|
|
582
|
+
writerObj = new BufferedWriter(new FileWriter(new File(baseDirectory, "/" + mInterfaceUtil.packageName + "/MyLocation_encrypted.txt")));
|
|
583
|
+
writerObj.write("");
|
|
584
|
+
writerObj.flush();
|
|
585
|
+
writerObj.close();
|
|
586
|
+
}
|
|
587
|
+
}
|
|
586
588
|
} else {
|
|
587
589
|
System.out.println("Location should not be updated for this user..");
|
|
588
590
|
}
|
package/src/ios/mInterface.m
CHANGED
|
@@ -387,6 +387,7 @@
|
|
|
387
387
|
|
|
388
388
|
- (void)GetFileList:(CDVInvokedUrlCommand *)command {
|
|
389
389
|
BOOL isDir;
|
|
390
|
+
NSString *resultString = @"";
|
|
390
391
|
NSMutableDictionary * dict = [[command arguments] objectAtIndex:0];
|
|
391
392
|
NSString *directory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
|
|
392
393
|
NSString *contentsPath = [NSString stringWithFormat:@"%@/%@", directory, dict[@"filePath"]];
|
|
@@ -396,11 +397,17 @@
|
|
|
396
397
|
[contenstMutableArray removeObject:@".DS_Store"];
|
|
397
398
|
}
|
|
398
399
|
for(int index = 0; index < [contenstMutableArray count]; index++) {
|
|
399
|
-
if ([[NSFileManager defaultManager] fileExistsAtPath:[contentsPath stringByAppendingPathComponent:contenstMutableArray[index]] isDirectory:&isDir] && isDir) {
|
|
400
|
-
[
|
|
400
|
+
if ([[NSFileManager defaultManager] fileExistsAtPath:[contentsPath stringByAppendingPathComponent:contenstMutableArray[index]] isDirectory:&isDir] && !isDir) {
|
|
401
|
+
if ([resultString isEqualToString:@""]) {
|
|
402
|
+
resultString = [resultString stringByAppendingString:contenstMutableArray[index]];
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
405
|
+
resultString = [resultString stringByAppendingString:@"|"];
|
|
406
|
+
resultString = [resultString stringByAppendingString:contenstMutableArray[index]];
|
|
407
|
+
}
|
|
401
408
|
}
|
|
402
409
|
}
|
|
403
|
-
CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
|
|
410
|
+
CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:resultString];
|
|
404
411
|
[self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
|
|
405
412
|
}
|
|
406
413
|
|
package/package.json.bak
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cordova-plugin-mserviceinterface-2.0",
|
|
3
|
-
"version": "1.0.30",
|
|
4
|
-
"description": "This plugin establishes the connection to the native interface and performs the requested task.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "test"
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/selfservit/cordova-plugin-mserviceinterface-2.0.git"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"mserviceinterface-2.0"
|
|
15
|
-
],
|
|
16
|
-
"author": "selfservit@gmail.com",
|
|
17
|
-
"license": "ISC",
|
|
18
|
-
"bugs": {
|
|
19
|
-
"url": "https://github.com/selfservit/cordova-plugin-mserviceinterface-2.0/issues"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/selfservit/cordova-plugin-mserviceinterface-2.0#readme",
|
|
22
|
-
"engines": [
|
|
23
|
-
{
|
|
24
|
-
"name": "cordova",
|
|
25
|
-
"version": ">=5.0.0"
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
package/plugin.xml.bak
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
|
3
|
-
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
4
|
-
id="cordova-plugin-mserviceinterface-2.0"
|
|
5
|
-
version="1.0.30">
|
|
6
|
-
<name>mserviceinterface-2.0</name>
|
|
7
|
-
<description>This plugin establishes the connection to the native interface and performs the requested task.</description>
|
|
8
|
-
<author>selfservit@gmail.com</author>
|
|
9
|
-
<engines>
|
|
10
|
-
<engine name="cordova" version=">=5.0.0" />
|
|
11
|
-
</engines>
|
|
12
|
-
<keywords>mserviceinterface-2.0</keywords>
|
|
13
|
-
<license>Apache 2.0 License</license>
|
|
14
|
-
<repo></repo>
|
|
15
|
-
<issue></issue>
|
|
16
|
-
<asset src="www/mInterface.js" target="js/mInterface.js"/>
|
|
17
|
-
<js-module src="www/mInterface.js" name="mInterface">
|
|
18
|
-
<clobbers target="mInterface" />
|
|
19
|
-
</js-module>
|
|
20
|
-
<platform name="android">
|
|
21
|
-
<framework src="src/android/doubleogradle.gradle" custom="true" type="gradleReference"/>
|
|
22
|
-
<framework src="com.google.android.gms:play-services:11.0.+" />
|
|
23
|
-
<framework src="com.google.android.gms:play-services-location:11.0.+" />
|
|
24
|
-
<framework src="com.android.support:support-v4:26.0.1" />
|
|
25
|
-
<framework src="com.google.zxing:core:3.2.1" />
|
|
26
|
-
<framework src="com.journeyapps:zxing-android-embedded:3.2.0@aar" />
|
|
27
|
-
<edit-config xmlns:android="http://schemas.android.com/apk/res/android" file="AndroidManifest.xml" mode="merge" target="/manifest/application">
|
|
28
|
-
<application android:networkSecurityConfig="@xml/network_security_config" />
|
|
29
|
-
<application android:requestLegacyExternalStorage="true" />
|
|
30
|
-
</edit-config>
|
|
31
|
-
<config-file target="res/xml/config.xml" parent="/*">
|
|
32
|
-
<feature name="mInterface" >
|
|
33
|
-
<param name="android-package" value="com.selfservit.util.mInterface"/>
|
|
34
|
-
</feature>
|
|
35
|
-
</config-file>
|
|
36
|
-
<config-file target="AndroidManifest.xml" parent="/manifest">
|
|
37
|
-
<uses-feature android:name="android.hardware.camera" android:required="true" />
|
|
38
|
-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
39
|
-
<uses-permission android:name="android.permission.INTERNET" />
|
|
40
|
-
<uses-permission android:name="android.permission.CAMERA" />
|
|
41
|
-
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
|
42
|
-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
43
|
-
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
|
44
|
-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
45
|
-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
|
46
|
-
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
47
|
-
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
48
|
-
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
|
49
|
-
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
|
50
|
-
</config-file>
|
|
51
|
-
<config-file target="AndroidManifest.xml" parent="/manifest/application">
|
|
52
|
-
<service android:name="com.selfservit.util.mInterfaceService" android:foregroundServiceType="location" android:enabled="true" android:exported="true"/>
|
|
53
|
-
<service
|
|
54
|
-
android:name="com.selfservit.util.backgroundNotification"
|
|
55
|
-
android:permission="android.permission.BIND_JOB_SERVICE"
|
|
56
|
-
android:exported="false">
|
|
57
|
-
<intent-filter>
|
|
58
|
-
<action android:name="com.onesignal.NotificationExtender" />
|
|
59
|
-
</intent-filter>
|
|
60
|
-
</service>
|
|
61
|
-
<receiver android:name="com.selfservit.util.mInterfaceReceiver" android:enabled="true" android:exported="true">
|
|
62
|
-
<intent-filter>
|
|
63
|
-
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
|
64
|
-
<action android:name="com.example.checkservice" />
|
|
65
|
-
</intent-filter>
|
|
66
|
-
</receiver>
|
|
67
|
-
<provider android:name="com.selfservit.util.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true">
|
|
68
|
-
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/opener_paths" />
|
|
69
|
-
</provider>
|
|
70
|
-
</config-file>
|
|
71
|
-
<source-file src="src/android/mInterfaceService.java" target-dir="src/com/selfservit/util/" />
|
|
72
|
-
<source-file src="src/android/backgroundNotification.java" target-dir="src/com/selfservit/util/" />
|
|
73
|
-
<source-file src="src/android/mInterfaceReceiver.java" target-dir="src/com/selfservit/util/" />
|
|
74
|
-
<source-file src="src/android/mInterface.java" target-dir="src/com/selfservit/util/" />
|
|
75
|
-
<source-file src="src/android/mInterfaceUtil.java" target-dir="src/com/selfservit/util/" />
|
|
76
|
-
<source-file src="src/android/CallbackProgressDialog.java" target-dir="src/com/selfservit/util/" />
|
|
77
|
-
<source-file src="src/android/FileProvider.java" target-dir="src/com/selfservit/util/" />
|
|
78
|
-
<source-file src="src/android/res/xml/opener_paths.xml" target-dir="res/xml" />
|
|
79
|
-
<source-file src="src/android/res/xml/network_security_config.xml" target-dir="res/xml" />
|
|
80
|
-
</platform>
|
|
81
|
-
<platform name="ios">
|
|
82
|
-
<config-file target="*-Info.plist" parent="NSCameraUsageDescription">
|
|
83
|
-
<string>Equipcare wants to access your camera and gallery to attach the images for service reports and photo proofs.</string>
|
|
84
|
-
</config-file>
|
|
85
|
-
|
|
86
|
-
<config-file target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
|
|
87
|
-
<string>Equipcare wants to access your camera and gallery to attach the images for service reports and photo proofs.</string>
|
|
88
|
-
</config-file>
|
|
89
|
-
<preference name="CAMERA_USAGE_DESCRIPTION" default="Allow use camera from your device" />
|
|
90
|
-
<preference name="PHOTOLIBRARY_USAGE_DESCRIPTION" default="Allow access your photos from gallery" />
|
|
91
|
-
<config-file target="config.xml" parent="/widget">
|
|
92
|
-
<feature name="mInterface">
|
|
93
|
-
<param name="ios-package" value="mInterface" />
|
|
94
|
-
</feature>
|
|
95
|
-
</config-file>
|
|
96
|
-
<header-file src="src/ios/mInterface.h"/>
|
|
97
|
-
<source-file src="src/ios/mInterface.m"/>
|
|
98
|
-
<header-file src="src/ios/InternetConnection.h"/>
|
|
99
|
-
<source-file src="src/ios/InternetConnection.m"/>
|
|
100
|
-
<header-file src="src/ios/XMLConverter.h"/>
|
|
101
|
-
<source-file src="src/ios/XMLConverter.m"/>
|
|
102
|
-
<header-file src="src/ios/UICKeyChainStore.h" />
|
|
103
|
-
<source-file src="src/ios/UICKeyChainStore.m" />
|
|
104
|
-
<source-file src="src/ios/SSZipArchive.h" />
|
|
105
|
-
<source-file src="src/ios/SSZipArchive.m" />
|
|
106
|
-
<header-file src="src/ios/SSZipCommon.h" />
|
|
107
|
-
<header-file src="src/ios/ZipArchive.h" />
|
|
108
|
-
<source-file src="src/ios/minizip/crypt.c" />
|
|
109
|
-
<header-file src="src/ios/minizip/crypt.h" />
|
|
110
|
-
<source-file src="src/ios/minizip/ioapi_buf.c" />
|
|
111
|
-
<header-file src="src/ios/minizip/ioapi_buf.h" />
|
|
112
|
-
<source-file src="src/ios/minizip/ioapi_mem.c" />
|
|
113
|
-
<header-file src="src/ios/minizip/ioapi_mem.h" />
|
|
114
|
-
<source-file src="src/ios/minizip/ioapi.c" />
|
|
115
|
-
<header-file src="src/ios/minizip/ioapi.h" />
|
|
116
|
-
<source-file src="src/ios/minizip/minishared.c" />
|
|
117
|
-
<header-file src="src/ios/minizip/minishared.h" />
|
|
118
|
-
<source-file src="src/ios/minizip/unzip.c" />
|
|
119
|
-
<header-file src="src/ios/minizip/unzip.h" />
|
|
120
|
-
<source-file src="src/ios/minizip/zip.c" />
|
|
121
|
-
<header-file src="src/ios/minizip/zip.h" />
|
|
122
|
-
<source-file src="src/ios/aes/aes_ni.c" />
|
|
123
|
-
<header-file src="src/ios/aes/aes_ni.h" />
|
|
124
|
-
<header-file src="src/ios/aes/aes.h" />
|
|
125
|
-
<source-file src="src/ios/aes/aescrypt.c" />
|
|
126
|
-
<source-file src="src/ios/aes/aeskey.c" />
|
|
127
|
-
<header-file src="src/ios/aes/aesopt.h" />
|
|
128
|
-
<source-file src="src/ios/aes/aestab.c" />
|
|
129
|
-
<header-file src="src/ios/aes/aestab.h" />
|
|
130
|
-
<header-file src="src/ios/aes/brg_endian.h" />
|
|
131
|
-
<header-file src="src/ios/aes/brg_types.h" />
|
|
132
|
-
<source-file src="src/ios/aes/fileenc.c" />
|
|
133
|
-
<header-file src="src/ios/aes/fileenc.h" />
|
|
134
|
-
<source-file src="src/ios/aes/hmac.c" />
|
|
135
|
-
<header-file src="src/ios/aes/hmac.h" />
|
|
136
|
-
<source-file src="src/ios/aes/prng.c" />
|
|
137
|
-
<header-file src="src/ios/aes/prng.h" />
|
|
138
|
-
<source-file src="src/ios/aes/pwd2key.c" />
|
|
139
|
-
<header-file src="src/ios/aes/pwd2key.h" />
|
|
140
|
-
<source-file src="src/ios/aes/sha1.c" />
|
|
141
|
-
<header-file src="src/ios/aes/sha1.h" />
|
|
142
|
-
<framework src="MapKit.framework" />
|
|
143
|
-
<framework src="Foundation.framework" />
|
|
144
|
-
<framework src="SystemConfiguration.framework" />
|
|
145
|
-
<framework src="CoreFoundation.framework" />
|
|
146
|
-
<framework src="CoreTelephony.framework" />
|
|
147
|
-
<framework src="UIKit.framework" />
|
|
148
|
-
<framework src="CFNetwork.framework" />
|
|
149
|
-
<framework src="AssetsLibrary.framework" />
|
|
150
|
-
<framework src="AVFoundation.framework" />
|
|
151
|
-
<framework src="libz.dylib" />
|
|
152
|
-
<framework src="Security.framework" />
|
|
153
|
-
</platform>
|
|
154
|
-
</plugin>
|