com.cprot.ead 1.0.6788 → 1.0.7845
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/android/build.gradle +1 -1
- package/android/src/main/java/com/cproteadmodule/CProtEadModuleModule.kt +183 -106
- package/android/src/main/java/com/cproteadmodule/ConstHelper.kt +6 -6
- package/android/src/main/java/com/cproteadmodule/UninstallHandler.kt +43 -43
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +0 -2
- package/lib/module/index.js.map +1 -1
- package/package.json +191 -191
- package/lib/commonjs/package.json +0 -1
- package/lib/module/package.json +0 -1
- package/lib/typescript/commonjs/package.json +0 -1
- package/lib/typescript/commonjs/src/index.d.ts +0 -3
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/module/package.json +0 -1
- package/lib/typescript/module/src/index.d.ts +0 -3
- package/lib/typescript/module/src/index.d.ts.map +0 -1
package/android/build.gradle
CHANGED
|
@@ -25,6 +25,9 @@ import java.util.ArrayList
|
|
|
25
25
|
import java.util.Date
|
|
26
26
|
import java.util.Locale
|
|
27
27
|
import java.lang.StringBuilder
|
|
28
|
+
import com.cprot.ead.models.CloneApp
|
|
29
|
+
import com.cprot.ead.models.CallType
|
|
30
|
+
import com.facebook.react.bridge.Promise
|
|
28
31
|
|
|
29
32
|
class CProtEadModuleModule(reactContext: ReactApplicationContext) :
|
|
30
33
|
ReactContextBaseJavaModule(reactContext), ICProtEvent {
|
|
@@ -65,7 +68,6 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
|
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
|
|
68
|
-
|
|
69
71
|
@ReactMethod
|
|
70
72
|
fun handleIncomingCallWithBaseApp(value : Boolean) {
|
|
71
73
|
val currentActivity = reactApplicationContext.currentActivity
|
|
@@ -86,6 +88,16 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
|
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
|
|
91
|
+
@ReactMethod
|
|
92
|
+
fun setCurrentActivity() {
|
|
93
|
+
val currentActivity = reactApplicationContext.currentActivity
|
|
94
|
+
module?.let {
|
|
95
|
+
if(currentActivity != null) {
|
|
96
|
+
it.setCurrentActivity(currentActivity)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
89
101
|
@ReactMethod
|
|
90
102
|
fun addEvent() {
|
|
91
103
|
val currentActivity = reactApplicationContext.currentActivity
|
|
@@ -175,11 +187,15 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
|
|
|
175
187
|
it.stopRealtime()
|
|
176
188
|
}
|
|
177
189
|
}
|
|
190
|
+
|
|
178
191
|
@ReactMethod
|
|
179
|
-
fun isDeviceProtectionEnabled(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
192
|
+
fun isDeviceProtectionEnabled(promise: Promise) {
|
|
193
|
+
try {
|
|
194
|
+
val result = module?.isDeviceProtectionEnabled() ?: false
|
|
195
|
+
promise.resolve(result)
|
|
196
|
+
} catch (e: Exception) {
|
|
197
|
+
promise.reject("IS_DEVICE_PROTECTION_ENABLED_ERROR", "Failed to check device protection", e)
|
|
198
|
+
}
|
|
183
199
|
}
|
|
184
200
|
|
|
185
201
|
@ReactMethod
|
|
@@ -189,118 +205,172 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
|
|
|
189
205
|
}
|
|
190
206
|
}
|
|
191
207
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
208
|
+
@ReactMethod
|
|
209
|
+
fun getSslCertHash(promise: Promise) {
|
|
210
|
+
try {
|
|
211
|
+
val result = module?.getSslCertHash() ?: ""
|
|
212
|
+
promise.resolve(result)
|
|
213
|
+
} catch (e: Exception) {
|
|
214
|
+
promise.reject("GET_SSL_CERT_HASH_ERROR", "Failed to get SSL cert hash", e)
|
|
215
|
+
}
|
|
216
|
+
}
|
|
198
217
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
218
|
+
@ReactMethod
|
|
219
|
+
fun getDeviceFingerprint(promise: Promise) {
|
|
220
|
+
try {
|
|
221
|
+
val result = module?.getDeviceFingerprint() ?: ""
|
|
222
|
+
promise.resolve(result)
|
|
223
|
+
} catch (e: Exception) {
|
|
224
|
+
promise.reject("GET_DEVICE_FINGERPRINT_ERROR", "Failed to get device fingerprint", e)
|
|
225
|
+
}
|
|
226
|
+
}
|
|
205
227
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
228
|
+
@ReactMethod
|
|
229
|
+
fun isRunInEmulator(promise: Promise) {
|
|
230
|
+
try {
|
|
231
|
+
val result = module?.isRunInEmulator() ?: false
|
|
232
|
+
promise.resolve(result)
|
|
233
|
+
} catch (e: Exception) {
|
|
234
|
+
promise.reject("IS_RUN_IN_EMULATOR_ERROR", "Failed to detect emulator", e)
|
|
235
|
+
}
|
|
236
|
+
}
|
|
212
237
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
238
|
+
@ReactMethod
|
|
239
|
+
fun isRootedDevice(promise: Promise) {
|
|
240
|
+
try {
|
|
241
|
+
val result = module?.isRootedDevice() ?: false
|
|
242
|
+
promise.resolve(result)
|
|
243
|
+
} catch (e: Exception) {
|
|
244
|
+
promise.reject("IS_ROOTED_DEVICE_ERROR", "Failed to detect rooted device", e)
|
|
245
|
+
}
|
|
246
|
+
}
|
|
219
247
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
248
|
+
@ReactMethod
|
|
249
|
+
fun isFingerprintChanged(promise: Promise) {
|
|
250
|
+
try {
|
|
251
|
+
val result = module?.isFingerprintChanged() ?: false
|
|
252
|
+
promise.resolve(result)
|
|
253
|
+
} catch (e: Exception) {
|
|
254
|
+
promise.reject("IS_FINGERPRINT_CHANGED_ERROR", "Failed to detect fingerprint change", e)
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@ReactMethod
|
|
259
|
+
fun getSignatures(promise: Promise) {
|
|
260
|
+
try {
|
|
261
|
+
val result = module?.let {
|
|
262
|
+
ArrayList(it.getSignatures(reactApplicationContext).toList())
|
|
263
|
+
} ?: ArrayList()
|
|
264
|
+
promise.resolve(result)
|
|
265
|
+
} catch (e: Exception) {
|
|
266
|
+
promise.reject("GET_SIGNATURES_ERROR", "Failed to get signatures", e)
|
|
267
|
+
}
|
|
268
|
+
}
|
|
226
269
|
|
|
227
270
|
@ReactMethod
|
|
228
|
-
fun
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
} ?: ArrayList()
|
|
271
|
+
fun getStringCurrentCallStatus(promise: Promise) {
|
|
272
|
+
try {
|
|
273
|
+
val value = module?.getCurrentCallStatus()?.getStringValue() ?: ""
|
|
274
|
+
promise.resolve(value)
|
|
275
|
+
} catch (e: Exception) {
|
|
276
|
+
promise.resolve("")
|
|
277
|
+
}
|
|
237
278
|
}
|
|
238
279
|
|
|
239
280
|
@ReactMethod
|
|
240
|
-
fun
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
it.
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
281
|
+
fun getIntCurrentCallStatus(promise: Promise) {
|
|
282
|
+
try {
|
|
283
|
+
val status = module?.let {
|
|
284
|
+
it.getCurrentCallStatus().getIntValue()
|
|
285
|
+
} ?: 0
|
|
286
|
+
promise.resolve(status)
|
|
287
|
+
} catch (e: Exception) {
|
|
288
|
+
promise.reject("GET_CALL_STATUS_ERROR", "Failed to get current call status", e)
|
|
289
|
+
}
|
|
249
290
|
}
|
|
250
291
|
|
|
251
292
|
@ReactMethod
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
sb.append("\"isEmulationDetected\":").append(securityCheck.isEmulationDetected()).append(",")
|
|
261
|
-
sb.append("\"emulationDetectionDescription\":").append("\"").append(securityCheck.getEmulationDetectionDescription()).append("\"").append(",")
|
|
262
|
-
sb.append("\"isRootDetected\":").append(securityCheck.isRootDetected()).append(",")
|
|
263
|
-
sb.append("\"rootDetectionDescription\":").append("\"").append(securityCheck.getRootDetectionDescription()).append("\"").append(",")
|
|
264
|
-
//sb.append("\"isIntegrityBroken\":").append(securityCheck.isIntegrityBroken()).append(",")
|
|
265
|
-
sb.append("\"isFingerprintChanged\":").append(securityCheck.isFingerprintChanged()).append(",")
|
|
266
|
-
sb.append("\"isScreenReaderAppsDetected\":").append(securityCheck.isScreenReaderAppsDetected()).append(",")
|
|
267
|
-
sb.append("\"isOverlayedAppsDetected\":").append(securityCheck.isOverlayedAppsDetected()).append(",")
|
|
268
|
-
sb.append("\"isDevModeEnabled\":").append(securityCheck.isDevModeEnabled()).append(",")
|
|
269
|
-
sb.append("\"factoryResetTime\":").append(securityCheck.getFactoryResetTime() ?: "null").append(",")
|
|
270
|
-
sb.append("\"isVpnActive\":").append(securityCheck.getIsVpnActive()).append(",")
|
|
271
|
-
sb.append("\"isDefaultSmsAppChanged\":").append(securityCheck.isDefaultSmsAppChanged()).append(",")
|
|
272
|
-
sb.append("\"isSimChanged\":").append(securityCheck.isSimChanged()).append(",")
|
|
273
|
-
sb.append("\"isProxyActive\":").append(securityCheck.isProxyActive()).append(",")
|
|
274
|
-
sb.append("\"isMockLocation\":").append(securityCheck.isMockLocation()).append(",")
|
|
275
|
-
//sb.append("\"isKeyloggerDetected\":").append(securityCheck.isKeyloggerDetected()).append(",")
|
|
276
|
-
sb.append("\"isVirtualTouch\":").append(securityCheck.isVirtualTouch()).append(",")
|
|
277
|
-
sb.append("\"isCallForwardActive\":").append(securityCheck.isCallForwardActive())
|
|
278
|
-
sb.append("}")
|
|
279
|
-
|
|
280
|
-
val jsonString = sb.toString()
|
|
281
|
-
sendLogEvent(jsonString)
|
|
282
|
-
jsonString
|
|
283
|
-
} ?: run {
|
|
284
|
-
sendLogEvent("Security check module is null")
|
|
285
|
-
null
|
|
293
|
+
fun getDexCRC(promise: Promise) {
|
|
294
|
+
try {
|
|
295
|
+
val result = module?.getDexCRC(reactApplicationContext) ?: -1L
|
|
296
|
+
promise.resolve(result)
|
|
297
|
+
} catch (e: Exception) {
|
|
298
|
+
e.printStackTrace()
|
|
299
|
+
promise.reject("GET_DEX_CRC_ERROR", "Failed to get Dex CRC", e)
|
|
300
|
+
}
|
|
286
301
|
}
|
|
287
|
-
}
|
|
288
302
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
303
|
+
@ReactMethod
|
|
304
|
+
fun getSecurityFeatureChecks(promise: Promise) {
|
|
305
|
+
try {
|
|
306
|
+
val securityCheck = module?.getSecurityFeatureChecks()
|
|
307
|
+
if (securityCheck != null) {
|
|
308
|
+
val sb = StringBuilder()
|
|
309
|
+
sb.append("{")
|
|
310
|
+
sb.append("\"isMalwareDetected\":").append(securityCheck.isMalwareDetected()).append(",")
|
|
311
|
+
sb.append("\"isDebuggerDetected\":").append(securityCheck.isDebuggerDetected()).append(",")
|
|
312
|
+
sb.append("\"isEmulationDetected\":").append(securityCheck.isEmulationDetected()).append(",")
|
|
313
|
+
sb.append("\"emulationDetectionDescription\":\"").append(securityCheck.getEmulationDetectionDescription()).append("\",")
|
|
314
|
+
sb.append("\"isRootDetected\":").append(securityCheck.isRootDetected()).append(",")
|
|
315
|
+
sb.append("\"rootDetectionDescription\":\"").append(securityCheck.getRootDetectionDescription()).append("\",")
|
|
316
|
+
sb.append("\"isIntegrityBroken\":").append(securityCheck.isIntegrityBroken()).append(",")
|
|
317
|
+
sb.append("\"isFingerprintChanged\":").append(securityCheck.isFingerprintChanged()).append(",")
|
|
318
|
+
sb.append("\"isScreenReaderAppsDetected\":").append(securityCheck.isScreenReaderAppsDetected()).append(",")
|
|
319
|
+
sb.append("\"isOverlayedAppsDetected\":").append(securityCheck.isOverlayedAppsDetected()).append(",")
|
|
320
|
+
sb.append("\"isDevModeEnabled\":").append(securityCheck.isDevModeEnabled()).append(",")
|
|
321
|
+
sb.append("\"factoryResetTime\":").append(securityCheck.getFactoryResetTime() ?: "null").append(",")
|
|
322
|
+
sb.append("\"isVpnActive\":").append(securityCheck.getIsVpnActive()).append(",")
|
|
323
|
+
sb.append("\"isDefaultSmsAppChanged\":").append(securityCheck.isDefaultSmsAppChanged()).append(",")
|
|
324
|
+
sb.append("\"isSimChanged\":").append(securityCheck.isSimChanged()).append(",")
|
|
325
|
+
sb.append("\"isProxyActive\":").append(securityCheck.isProxyActive()).append(",")
|
|
326
|
+
sb.append("\"isMockLocation\":").append(securityCheck.isMockLocation()).append(",")
|
|
327
|
+
sb.append("\"isKeyloggerDetected\":").append(securityCheck.isKeyloggerDetected()).append(",")
|
|
328
|
+
sb.append("\"isVirtualTouch\":").append(securityCheck.isVirtualTouch()).append(",")
|
|
329
|
+
sb.append("\"isCallForwardActive\":").append(securityCheck.isCallForwardActive()).append(",")
|
|
330
|
+
sb.append("\"isUsbConnected\":").append(securityCheck.isUsbConnected()).append(",")
|
|
331
|
+
sb.append("\"isSuspiciousWifi\":").append(securityCheck.isPotentialEvilTwin()).append(",")
|
|
332
|
+
sb.append("\"isKeyboardAppChanged\":").append(securityCheck.isKeyboardAppChanged())
|
|
333
|
+
sb.append("}")
|
|
334
|
+
|
|
335
|
+
val jsonString = sb.toString()
|
|
336
|
+
promise.resolve(jsonString)
|
|
337
|
+
} else {
|
|
338
|
+
sendLogEvent("Security check module is null")
|
|
339
|
+
promise.resolve(null)
|
|
340
|
+
}
|
|
341
|
+
} catch (e: Exception) {
|
|
342
|
+
e.printStackTrace()
|
|
343
|
+
promise.reject("GET_SECURITY_FEATURE_CHECKS_ERROR", "Failed to get security feature checks", e)
|
|
344
|
+
}
|
|
345
|
+
}
|
|
297
346
|
|
|
298
347
|
@ReactMethod
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
348
|
+
fun getLastScanTime(promise: Promise) {
|
|
349
|
+
try {
|
|
350
|
+
val lastScanTime = module?.getLastScanTime()
|
|
351
|
+
val dateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
|
|
352
|
+
val formattedDate = lastScanTime?.let { dateFormat.format(it) } ?: ""
|
|
353
|
+
promise.resolve(formattedDate)
|
|
354
|
+
} catch (e: Exception) {
|
|
355
|
+
e.printStackTrace()
|
|
356
|
+
promise.reject("GET_LAST_SCAN_TIME_ERROR", "Failed to get last scan time", e)
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
@ReactMethod
|
|
361
|
+
fun getUpdateStatus(promise: Promise) {
|
|
362
|
+
try {
|
|
363
|
+
val updateStatus = module?.getUpdateStatus()
|
|
364
|
+
if (updateStatus != null) {
|
|
365
|
+
promise.resolve(updateStatus.name) // Enum ise ismini string olarak gönder
|
|
366
|
+
} else {
|
|
367
|
+
promise.resolve(null)
|
|
368
|
+
}
|
|
369
|
+
} catch (e: Exception) {
|
|
370
|
+
e.printStackTrace()
|
|
371
|
+
promise.reject("GET_UPDATE_STATUS_ERROR", "Failed to get update status", e)
|
|
372
|
+
}
|
|
373
|
+
}
|
|
304
374
|
|
|
305
375
|
//Send log message when ovveride functions worked.
|
|
306
376
|
private fun sendLogEvent(message: String) {
|
|
@@ -348,10 +418,6 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
|
|
|
348
418
|
override fun onThreatDetected(infectedApps: ArrayList<InfectedApp>) {
|
|
349
419
|
sendLogEvent("Threat detected: $infectedApps")
|
|
350
420
|
|
|
351
|
-
if (ConstHelper.DetectedThreats == null) {
|
|
352
|
-
ConstHelper.DetectedThreats = ArrayList<String>()
|
|
353
|
-
}
|
|
354
|
-
|
|
355
421
|
for (infectedApp in infectedApps) {
|
|
356
422
|
if (ConstHelper.DetectedThreats.contains(infectedApp.getPackageName())) {
|
|
357
423
|
continue
|
|
@@ -378,8 +444,14 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
|
|
|
378
444
|
|
|
379
445
|
CoroutineScope(Dispatchers.Main).launch {
|
|
380
446
|
try {
|
|
447
|
+
val currentActivity = reactApplicationContext.currentActivity
|
|
448
|
+
if (currentActivity == null) {
|
|
449
|
+
sendLogEvent("Error: No valid Activity available to show uninstall dialog")
|
|
450
|
+
return@launch
|
|
451
|
+
}
|
|
452
|
+
|
|
381
453
|
val uninstallHandler = UninstallHandler(
|
|
382
|
-
context =
|
|
454
|
+
context = currentActivity,
|
|
383
455
|
installedAppName = infectedApp.getName() ?: "Unknown App",
|
|
384
456
|
installedAppPackageName = infectedApp.getPackageName(),
|
|
385
457
|
installedAppVersion = infectedApp.getVersion() ?: "Unknown Version",
|
|
@@ -455,4 +527,9 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
|
|
|
455
527
|
sendLogEvent("Application uninstall detected: $s")
|
|
456
528
|
}
|
|
457
529
|
|
|
530
|
+
override fun onCloneAppDetected(cloneApps: ArrayList<CloneApp>) {
|
|
531
|
+
for (item in cloneApps) {
|
|
532
|
+
sendLogEvent("Clone app detected: $item")
|
|
533
|
+
}
|
|
534
|
+
}
|
|
458
535
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
package com.cproteadmodule
|
|
2
|
-
|
|
3
|
-
import java.util.ArrayList
|
|
4
|
-
|
|
5
|
-
object ConstHelper {
|
|
6
|
-
var DetectedThreats: ArrayList<String> = ArrayList<String>()
|
|
1
|
+
package com.cproteadmodule
|
|
2
|
+
|
|
3
|
+
import java.util.ArrayList
|
|
4
|
+
|
|
5
|
+
object ConstHelper {
|
|
6
|
+
var DetectedThreats: ArrayList<String> = ArrayList<String>()
|
|
7
7
|
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
package com.cproteadmodule
|
|
2
|
-
|
|
3
|
-
import android.app.
|
|
4
|
-
import android.
|
|
5
|
-
import android.content.Intent
|
|
6
|
-
import com.cprot.ead.helpers.StringHelper
|
|
7
|
-
import java.io.File
|
|
8
|
-
|
|
9
|
-
class UninstallHandler(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
1
|
+
package com.cproteadmodule
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.app.AlertDialog
|
|
5
|
+
import android.content.Intent
|
|
6
|
+
import com.cprot.ead.helpers.StringHelper
|
|
7
|
+
import java.io.File
|
|
8
|
+
|
|
9
|
+
class UninstallHandler(
|
|
10
|
+
private val context: Activity,
|
|
11
|
+
private val installedAppName: String? = "",
|
|
12
|
+
private val installedAppPackageName: String? = "",
|
|
13
|
+
private val installedAppVersion: String? = "",
|
|
14
|
+
private val threatName: String? = ""
|
|
15
|
+
) {
|
|
16
|
+
|
|
17
|
+
fun showDialog() {
|
|
18
|
+
val packageName = installedAppPackageName ?: return
|
|
19
|
+
|
|
20
|
+
val dialog = AlertDialog.Builder(context)
|
|
21
|
+
.setTitle("Uninstall App")
|
|
22
|
+
.setMessage("App Name: $installedAppName\nThreat Name: $threatName")
|
|
23
|
+
.setPositiveButton("Uninstall") { dialog, _ ->
|
|
24
|
+
removeFromList()
|
|
25
|
+
val intent = Intent(Intent.ACTION_DELETE)
|
|
26
|
+
intent.data = android.net.Uri.parse("package:$packageName")
|
|
27
|
+
context.startActivity(intent)
|
|
28
|
+
dialog.dismiss()
|
|
29
|
+
}
|
|
30
|
+
.setNegativeButton("Cancel") { dialog, _ ->
|
|
31
|
+
dialog.dismiss()
|
|
32
|
+
}
|
|
33
|
+
.create()
|
|
34
|
+
dialog.show()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private fun removeFromList() {
|
|
38
|
+
val packageName = installedAppPackageName ?: return
|
|
39
|
+
ConstHelper.DetectedThreats?.let { threats ->
|
|
40
|
+
threats.removeAll { it.equals(packageName, ignoreCase = true) }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","CProtEadModule","NativeModules","Proxy","get","Error","_default","exports"],"
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","CProtEadModule","NativeModules","Proxy","get","Error","_default","exports"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'c-prot-ead-module' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo Go\\n';\n\nconst CProtEadModule = NativeModules.CProtEadModule\n ? NativeModules.CProtEadModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\n// Export the module directly\nexport default CProtEadModule;\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GACjB,4EAA4E,GAC5EC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,cAAc,GAAGC,0BAAa,CAACD,cAAc,GAC/CC,0BAAa,CAACD,cAAc,GAC5B,IAAIE,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CACF,CAAC;;AAEL;AAAA,IAAAU,QAAA,GAAAC,OAAA,CAAAP,OAAA,GACeC,cAAc","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","CProtEadModule","Proxy","get","Error"],"
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","CProtEadModule","Proxy","get","Error"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'c-prot-ead-module' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo Go\\n';\n\nconst CProtEadModule = NativeModules.CProtEadModule\n ? NativeModules.CProtEadModule\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\n// Export the module directly\nexport default CProtEadModule;\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GACjB,4EAA4E,GAC5ED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,cAAc,GAAGN,aAAa,CAACM,cAAc,GAC/CN,aAAa,CAACM,cAAc,GAC5B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC;;AAEL;AACA,eAAeI,cAAc","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,191 +1,191 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "com.cprot.ead",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "c-prot ead android module",
|
|
5
|
-
"source": "./src/index.tsx",
|
|
6
|
-
"main": "lib/commonjs/index.js",
|
|
7
|
-
"module": "lib/module/index.js",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"import": {
|
|
11
|
-
"types": "./lib/typescript/module/src/index.d.ts",
|
|
12
|
-
"default": "./lib/module/index.js"
|
|
13
|
-
},
|
|
14
|
-
"require": {
|
|
15
|
-
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
16
|
-
"default": "./lib/commonjs/index.js"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"src",
|
|
22
|
-
"lib",
|
|
23
|
-
"!**/__tests__",
|
|
24
|
-
"!**/__fixtures__",
|
|
25
|
-
"!**/__mocks__",
|
|
26
|
-
"android",
|
|
27
|
-
"!ios/build",
|
|
28
|
-
"!android/build",
|
|
29
|
-
"!android/gradle",
|
|
30
|
-
"!android/gradlew",
|
|
31
|
-
"!android/gradlew.bat",
|
|
32
|
-
"!android/local.properties",
|
|
33
|
-
"!**/.*"
|
|
34
|
-
],
|
|
35
|
-
"scripts": {
|
|
36
|
-
"example": "yarn workspace c-prot-ead-module-example",
|
|
37
|
-
"test": "jest",
|
|
38
|
-
"typecheck": "tsc",
|
|
39
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
40
|
-
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
41
|
-
"prepare": "bob build",
|
|
42
|
-
"release": "release-it"
|
|
43
|
-
},
|
|
44
|
-
"keywords": [
|
|
45
|
-
"react-native",
|
|
46
|
-
"android"
|
|
47
|
-
],
|
|
48
|
-
"author": "C-Prot",
|
|
49
|
-
"license": "MIT",
|
|
50
|
-
"bugs": {
|
|
51
|
-
"url": "https://www.npmjs.com/issues"
|
|
52
|
-
},
|
|
53
|
-
"homepage": "https://www.npmjs.com#readme",
|
|
54
|
-
"publishConfig": {
|
|
55
|
-
"registry": "https://registry.npmjs.org/"
|
|
56
|
-
},
|
|
57
|
-
"devDependencies": {
|
|
58
|
-
"@commitlint/config-conventional": "^17.0.2",
|
|
59
|
-
"@evilmartians/lefthook": "^1.5.0",
|
|
60
|
-
"@react-native-community/bob": "^0.17.1",
|
|
61
|
-
"@react-native/eslint-config": "0.74.0",
|
|
62
|
-
"@release-it/conventional-changelog": "^5.0.0",
|
|
63
|
-
"@types/jest": "^29.5.5",
|
|
64
|
-
"@types/react": "^18.2.6",
|
|
65
|
-
"commitlint": "^17.0.2",
|
|
66
|
-
"del-cli": "^5.1.0",
|
|
67
|
-
"eslint": "^8.51.0",
|
|
68
|
-
"eslint-config-prettier": "^9.0.0",
|
|
69
|
-
"eslint-plugin-prettier": "^5.0.1",
|
|
70
|
-
"jest": "^29.7.0",
|
|
71
|
-
"prettier": "^3.0.3",
|
|
72
|
-
"react": "18.2.0",
|
|
73
|
-
"react-native": "0.74.5",
|
|
74
|
-
"react-native-builder-bob": "^0.30.0",
|
|
75
|
-
"release-it": "^15.0.0",
|
|
76
|
-
"turbo": "^1.10.7",
|
|
77
|
-
"typescript": "^5.7.2"
|
|
78
|
-
},
|
|
79
|
-
"resolutions": {
|
|
80
|
-
"@types/react": "^18.2.44"
|
|
81
|
-
},
|
|
82
|
-
"peerDependencies": {
|
|
83
|
-
"react": "*",
|
|
84
|
-
"react-native": "*"
|
|
85
|
-
},
|
|
86
|
-
"workspaces": [
|
|
87
|
-
"example"
|
|
88
|
-
],
|
|
89
|
-
"packageManager": "yarn@3.6.1",
|
|
90
|
-
"jest": {
|
|
91
|
-
"preset": "react-native",
|
|
92
|
-
"modulePathIgnorePatterns": [
|
|
93
|
-
"<rootDir>/example/node_modules",
|
|
94
|
-
"<rootDir>/lib/"
|
|
95
|
-
]
|
|
96
|
-
},
|
|
97
|
-
"commitlint": {
|
|
98
|
-
"extends": [
|
|
99
|
-
"@commitlint/config-conventional"
|
|
100
|
-
]
|
|
101
|
-
},
|
|
102
|
-
"release-it": {
|
|
103
|
-
"git": {
|
|
104
|
-
"commitMessage": "chore: release ${version}",
|
|
105
|
-
"tagName": "v${version}"
|
|
106
|
-
},
|
|
107
|
-
"npm": {
|
|
108
|
-
"publish": true
|
|
109
|
-
},
|
|
110
|
-
"github": {
|
|
111
|
-
"release": true
|
|
112
|
-
},
|
|
113
|
-
"plugins": {
|
|
114
|
-
"@release-it/conventional-changelog": {
|
|
115
|
-
"preset": "angular"
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
"eslintConfig": {
|
|
120
|
-
"root": true,
|
|
121
|
-
"extends": [
|
|
122
|
-
"@react-native",
|
|
123
|
-
"prettier"
|
|
124
|
-
],
|
|
125
|
-
"rules": {
|
|
126
|
-
"react/react-in-jsx-scope": "off",
|
|
127
|
-
"prettier/prettier": [
|
|
128
|
-
"error",
|
|
129
|
-
{
|
|
130
|
-
"quoteProps": "consistent",
|
|
131
|
-
"singleQuote": true,
|
|
132
|
-
"tabWidth": 2,
|
|
133
|
-
"trailingComma": "es5",
|
|
134
|
-
"useTabs": false
|
|
135
|
-
}
|
|
136
|
-
]
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
"eslintIgnore": [
|
|
140
|
-
"node_modules/",
|
|
141
|
-
"lib/"
|
|
142
|
-
],
|
|
143
|
-
"prettier": {
|
|
144
|
-
"quoteProps": "consistent",
|
|
145
|
-
"singleQuote": true,
|
|
146
|
-
"tabWidth": 2,
|
|
147
|
-
"trailingComma": "es5",
|
|
148
|
-
"useTabs": false
|
|
149
|
-
},
|
|
150
|
-
"react-native-builder-bob": {
|
|
151
|
-
"source": "src",
|
|
152
|
-
"output": "lib",
|
|
153
|
-
"targets": [
|
|
154
|
-
[
|
|
155
|
-
"commonjs",
|
|
156
|
-
{
|
|
157
|
-
"esm": true
|
|
158
|
-
}
|
|
159
|
-
],
|
|
160
|
-
[
|
|
161
|
-
"module",
|
|
162
|
-
{
|
|
163
|
-
"esm": true
|
|
164
|
-
}
|
|
165
|
-
],
|
|
166
|
-
[
|
|
167
|
-
"typescript",
|
|
168
|
-
{
|
|
169
|
-
"project": "tsconfig.build.json",
|
|
170
|
-
"esm": true
|
|
171
|
-
}
|
|
172
|
-
]
|
|
173
|
-
]
|
|
174
|
-
},
|
|
175
|
-
"create-react-native-library": {
|
|
176
|
-
"type": "module-legacy",
|
|
177
|
-
"languages": "kotlin-objc",
|
|
178
|
-
"version": "0.41.0"
|
|
179
|
-
},
|
|
180
|
-
"react-native": "src/index.tsx",
|
|
181
|
-
"types": "lib/typescript/commonjs/src/index.d.ts",
|
|
182
|
-
"@react-native-community/bob": {
|
|
183
|
-
"source": "src",
|
|
184
|
-
"output": "lib",
|
|
185
|
-
"targets": [
|
|
186
|
-
"commonjs",
|
|
187
|
-
"module",
|
|
188
|
-
"typescript"
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "com.cprot.ead",
|
|
3
|
+
"version": "1.0.7845",
|
|
4
|
+
"description": "c-prot ead android module",
|
|
5
|
+
"source": "./src/index.tsx",
|
|
6
|
+
"main": "lib/commonjs/index.js",
|
|
7
|
+
"module": "lib/module/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
12
|
+
"default": "./lib/module/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
16
|
+
"default": "./lib/commonjs/index.js"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"src",
|
|
22
|
+
"lib",
|
|
23
|
+
"!**/__tests__",
|
|
24
|
+
"!**/__fixtures__",
|
|
25
|
+
"!**/__mocks__",
|
|
26
|
+
"android",
|
|
27
|
+
"!ios/build",
|
|
28
|
+
"!android/build",
|
|
29
|
+
"!android/gradle",
|
|
30
|
+
"!android/gradlew",
|
|
31
|
+
"!android/gradlew.bat",
|
|
32
|
+
"!android/local.properties",
|
|
33
|
+
"!**/.*"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"example": "yarn workspace c-prot-ead-module-example",
|
|
37
|
+
"test": "jest",
|
|
38
|
+
"typecheck": "tsc",
|
|
39
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
40
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
41
|
+
"prepare": "bob build",
|
|
42
|
+
"release": "release-it"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"react-native",
|
|
46
|
+
"android"
|
|
47
|
+
],
|
|
48
|
+
"author": "C-Prot",
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://www.npmjs.com/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://www.npmjs.com#readme",
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"registry": "https://registry.npmjs.org/"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@commitlint/config-conventional": "^17.0.2",
|
|
59
|
+
"@evilmartians/lefthook": "^1.5.0",
|
|
60
|
+
"@react-native-community/bob": "^0.17.1",
|
|
61
|
+
"@react-native/eslint-config": "0.74.0",
|
|
62
|
+
"@release-it/conventional-changelog": "^5.0.0",
|
|
63
|
+
"@types/jest": "^29.5.5",
|
|
64
|
+
"@types/react": "^18.2.6",
|
|
65
|
+
"commitlint": "^17.0.2",
|
|
66
|
+
"del-cli": "^5.1.0",
|
|
67
|
+
"eslint": "^8.51.0",
|
|
68
|
+
"eslint-config-prettier": "^9.0.0",
|
|
69
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
70
|
+
"jest": "^29.7.0",
|
|
71
|
+
"prettier": "^3.0.3",
|
|
72
|
+
"react": "18.2.0",
|
|
73
|
+
"react-native": "0.74.5",
|
|
74
|
+
"react-native-builder-bob": "^0.30.0",
|
|
75
|
+
"release-it": "^15.0.0",
|
|
76
|
+
"turbo": "^1.10.7",
|
|
77
|
+
"typescript": "^5.7.2"
|
|
78
|
+
},
|
|
79
|
+
"resolutions": {
|
|
80
|
+
"@types/react": "^18.2.44"
|
|
81
|
+
},
|
|
82
|
+
"peerDependencies": {
|
|
83
|
+
"react": "*",
|
|
84
|
+
"react-native": "*"
|
|
85
|
+
},
|
|
86
|
+
"workspaces": [
|
|
87
|
+
"example"
|
|
88
|
+
],
|
|
89
|
+
"packageManager": "yarn@3.6.1",
|
|
90
|
+
"jest": {
|
|
91
|
+
"preset": "react-native",
|
|
92
|
+
"modulePathIgnorePatterns": [
|
|
93
|
+
"<rootDir>/example/node_modules",
|
|
94
|
+
"<rootDir>/lib/"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"commitlint": {
|
|
98
|
+
"extends": [
|
|
99
|
+
"@commitlint/config-conventional"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"release-it": {
|
|
103
|
+
"git": {
|
|
104
|
+
"commitMessage": "chore: release ${version}",
|
|
105
|
+
"tagName": "v${version}"
|
|
106
|
+
},
|
|
107
|
+
"npm": {
|
|
108
|
+
"publish": true
|
|
109
|
+
},
|
|
110
|
+
"github": {
|
|
111
|
+
"release": true
|
|
112
|
+
},
|
|
113
|
+
"plugins": {
|
|
114
|
+
"@release-it/conventional-changelog": {
|
|
115
|
+
"preset": "angular"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"eslintConfig": {
|
|
120
|
+
"root": true,
|
|
121
|
+
"extends": [
|
|
122
|
+
"@react-native",
|
|
123
|
+
"prettier"
|
|
124
|
+
],
|
|
125
|
+
"rules": {
|
|
126
|
+
"react/react-in-jsx-scope": "off",
|
|
127
|
+
"prettier/prettier": [
|
|
128
|
+
"error",
|
|
129
|
+
{
|
|
130
|
+
"quoteProps": "consistent",
|
|
131
|
+
"singleQuote": true,
|
|
132
|
+
"tabWidth": 2,
|
|
133
|
+
"trailingComma": "es5",
|
|
134
|
+
"useTabs": false
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"eslintIgnore": [
|
|
140
|
+
"node_modules/",
|
|
141
|
+
"lib/"
|
|
142
|
+
],
|
|
143
|
+
"prettier": {
|
|
144
|
+
"quoteProps": "consistent",
|
|
145
|
+
"singleQuote": true,
|
|
146
|
+
"tabWidth": 2,
|
|
147
|
+
"trailingComma": "es5",
|
|
148
|
+
"useTabs": false
|
|
149
|
+
},
|
|
150
|
+
"react-native-builder-bob": {
|
|
151
|
+
"source": "src",
|
|
152
|
+
"output": "lib",
|
|
153
|
+
"targets": [
|
|
154
|
+
[
|
|
155
|
+
"commonjs",
|
|
156
|
+
{
|
|
157
|
+
"esm": true
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
[
|
|
161
|
+
"module",
|
|
162
|
+
{
|
|
163
|
+
"esm": true
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
[
|
|
167
|
+
"typescript",
|
|
168
|
+
{
|
|
169
|
+
"project": "tsconfig.build.json",
|
|
170
|
+
"esm": true
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"create-react-native-library": {
|
|
176
|
+
"type": "module-legacy",
|
|
177
|
+
"languages": "kotlin-objc",
|
|
178
|
+
"version": "0.41.0"
|
|
179
|
+
},
|
|
180
|
+
"react-native": "src/index.tsx",
|
|
181
|
+
"types": "lib/typescript/commonjs/src/index.d.ts",
|
|
182
|
+
"@react-native-community/bob": {
|
|
183
|
+
"source": "src",
|
|
184
|
+
"output": "lib",
|
|
185
|
+
"targets": [
|
|
186
|
+
"commonjs",
|
|
187
|
+
"module",
|
|
188
|
+
"typescript"
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"commonjs"}
|
package/lib/module/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"module"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"commonjs"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAQA,QAAA,MAAM,cAAc,KASf,CAAC;AAGN,eAAe,cAAc,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"module"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAQA,QAAA,MAAM,cAAc,KASf,CAAC;AAGN,eAAe,cAAc,CAAC"}
|