com.cprot.ead 1.0.5764 → 1.0.7207

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.
@@ -87,5 +87,5 @@ project.afterEvaluate {
87
87
  dependencies {
88
88
  implementation("com.facebook.react:react-native:+")
89
89
  implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.24")
90
- implementation("com.cprot:ead:1.0.5764")
90
+ implementation("com.cprot:ead:1.0.7206")
91
91
  }
@@ -1,39 +1,33 @@
1
1
  package com.cproteadmodule
2
2
 
3
- import com.facebook.react.bridge.ReactApplicationContext
4
- import com.facebook.react.bridge.ReactContextBaseJavaModule
5
- import com.facebook.react.bridge.ReactMethod
6
- import com.facebook.react.bridge.Promise
7
-
3
+ import android.telephony.TelephonyManager
4
+ import android.util.Log
8
5
  import com.cprot.ead.CProtEadModule
9
6
  import com.cprot.ead.helpers.HttpsHelper
10
- import com.cprot.ead.helpers.ConstantHelper
11
7
  import com.cprot.ead.models.DeepblackInfo
12
8
  import com.cprot.ead.models.ICProtEvent
13
9
  import com.cprot.ead.models.IncomingNumber
14
10
  import com.cprot.ead.models.InfectedApp
15
11
  import com.cprot.ead.models.Language
12
+ import com.cprot.ead.models.MalwareEntry
16
13
  import com.cprot.ead.models.OverlayApp
17
- import android.telephony.TelephonyManager
18
- import com.facebook.react.modules.core.DeviceEventManagerModule
19
- import java.util.ArrayList
20
- import android.os.Environment
21
- import android.provider.Settings
22
- import com.cproteadmodule.UninstallHandler
23
14
  import com.cprot.ead.models.SecurityFeatureCheck
24
15
  import com.cprot.ead.models.UpdateStatus
25
-
26
- import android.os.Build
27
- import android.util.Log
28
- import androidx.core.app.ActivityCompat
29
- import androidx.core.content.ContextCompat
30
- import java.util.Date
31
- import java.text.SimpleDateFormat
32
- import java.util.Locale
33
-
16
+ import com.facebook.react.bridge.ReactApplicationContext
17
+ import com.facebook.react.bridge.ReactContextBaseJavaModule
18
+ import com.facebook.react.bridge.ReactMethod
19
+ import com.facebook.react.modules.core.DeviceEventManagerModule
34
20
  import kotlinx.coroutines.CoroutineScope
35
21
  import kotlinx.coroutines.Dispatchers
36
22
  import kotlinx.coroutines.launch
23
+ import java.text.SimpleDateFormat
24
+ import java.util.ArrayList
25
+ import java.util.Date
26
+ import java.util.Locale
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
37
31
 
38
32
  class CProtEadModuleModule(reactContext: ReactApplicationContext) :
39
33
  ReactContextBaseJavaModule(reactContext), ICProtEvent {
@@ -74,7 +68,6 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
74
68
  }
75
69
  }
76
70
 
77
-
78
71
  @ReactMethod
79
72
  fun handleIncomingCallWithBaseApp(value : Boolean) {
80
73
  val currentActivity = reactApplicationContext.currentActivity
@@ -93,7 +86,7 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
93
86
  it.setIncomingCallEnabled(value);
94
87
  }
95
88
  }
96
- }
89
+ }
97
90
 
98
91
  @ReactMethod
99
92
  fun addEvent() {
@@ -104,7 +97,7 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
104
97
  }
105
98
  }
106
99
  }
107
-
100
+
108
101
  @ReactMethod
109
102
  fun setScreenModule(value: Boolean) {
110
103
  val currentActivity = reactApplicationContext.currentActivity
@@ -116,49 +109,61 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
116
109
  }
117
110
  }
118
111
  }
119
-
112
+
113
+ @ReactMethod
114
+ fun setVirtualTouchDetection(value: Boolean) {
115
+ val currentActivity = reactApplicationContext.currentActivity
116
+ module?.let {
117
+ if (currentActivity != null) {
118
+ CoroutineScope(Dispatchers.Main).launch {
119
+ it.setVirtualTouchDetection(currentActivity, value)
120
+ }
121
+ }
122
+ }
123
+ }
124
+
120
125
  @ReactMethod
121
126
  fun setUserId(userId: String) {
122
127
  module?.let {
123
128
  it.setUserId(userId)
124
129
  }
125
130
  }
126
-
131
+
127
132
  @ReactMethod
128
133
  fun setNoHistoryOnThreatDetection(value: Boolean) {
129
134
  module?.let {
130
135
  it.setNoHistoryOnThreatDetection(value)
131
136
  }
132
137
  }
133
-
138
+
134
139
  @ReactMethod
135
140
  fun showThreatDetectionScreenWithoutPermission(value: Boolean) {
136
141
  module?.let {
137
142
  it.showThreatDetectionScreenWithoutPermission(value)
138
143
  }
139
144
  }
140
-
145
+
141
146
  @ReactMethod
142
147
  fun startConnection() {
143
148
  module?.let {
144
149
  it.startConnection()
145
150
  }
146
151
  }
147
-
152
+
148
153
  @ReactMethod
149
154
  fun startRealtime() {
150
155
  module?.let {
151
156
  it.startRealtime()
152
157
  }
153
158
  }
154
-
159
+
155
160
  @ReactMethod
156
161
  fun enableDeviceProtection(value: Boolean) {
157
162
  module?.let {
158
163
  it.enableDeviceProtection(value)
159
164
  }
160
165
  }
161
-
166
+
162
167
  @ReactMethod
163
168
  fun setLanguage(languageCode: Int) {
164
169
  module?.let {
@@ -172,102 +177,190 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
172
177
  it.stopRealtime()
173
178
  }
174
179
  }
180
+
175
181
  @ReactMethod
176
- fun isDeviceProtectionEnabled(): Boolean {
177
- return module?.let {
178
- it.isDeviceProtectionEnabled()
179
- } ?: false
182
+ fun isDeviceProtectionEnabled(promise: Promise) {
183
+ try {
184
+ val result = module?.isDeviceProtectionEnabled() ?: false
185
+ promise.resolve(result)
186
+ } catch (e: Exception) {
187
+ promise.reject("IS_DEVICE_PROTECTION_ENABLED_ERROR", "Failed to check device protection", e)
188
+ }
180
189
  }
181
-
190
+
182
191
  @ReactMethod
183
192
  fun reInitRegister() {
184
193
  module?.let {
185
194
  it.reInitRegister()
186
195
  }
187
196
  }
188
-
189
- @ReactMethod
190
- fun getSslCertHash(): String? {
191
- return module?.let {
192
- it.getSslCertHash()
193
- } ?: ""
194
- }
195
-
196
- @ReactMethod
197
- fun getDeviceFingerprint(): String? {
198
- return module?.let {
199
- it.getDeviceFingerprint()
200
- } ?: ""
201
- }
202
-
203
- @ReactMethod
204
- fun isRunInEmulator(): Boolean {
205
- return module?.let {
206
- it.isRunInEmulator()
207
- } ?: false
208
- }
209
-
210
- @ReactMethod
211
- fun isRootedDevice(): Boolean {
212
- return module?.let {
213
- it.isRootedDevice()
214
- } ?: false
215
- }
216
-
217
- @ReactMethod
218
- fun isFingerprintChanged(): Boolean {
219
- return module?.let {
220
- it.isFingerprintChanged()
221
- } ?: false
222
- }
223
-
224
- @ReactMethod
225
- fun getSignatures(): ArrayList<String>? {
226
- return module?.let {
227
- try {
228
- ArrayList(it.getSignatures(reactApplicationContext).toList())
229
- } catch (e: Exception) {
230
- e.printStackTrace()
231
- null
232
- }
233
- } ?: ArrayList()
234
- }
235
-
197
+
198
+ @ReactMethod
199
+ fun getSslCertHash(promise: Promise) {
200
+ try {
201
+ val result = module?.getSslCertHash() ?: ""
202
+ promise.resolve(result)
203
+ } catch (e: Exception) {
204
+ promise.reject("GET_SSL_CERT_HASH_ERROR", "Failed to get SSL cert hash", e)
205
+ }
206
+ }
207
+
208
+ @ReactMethod
209
+ fun getDeviceFingerprint(promise: Promise) {
210
+ try {
211
+ val result = module?.getDeviceFingerprint() ?: ""
212
+ promise.resolve(result)
213
+ } catch (e: Exception) {
214
+ promise.reject("GET_DEVICE_FINGERPRINT_ERROR", "Failed to get device fingerprint", e)
215
+ }
216
+ }
217
+
218
+ @ReactMethod
219
+ fun isRunInEmulator(promise: Promise) {
220
+ try {
221
+ val result = module?.isRunInEmulator() ?: false
222
+ promise.resolve(result)
223
+ } catch (e: Exception) {
224
+ promise.reject("IS_RUN_IN_EMULATOR_ERROR", "Failed to detect emulator", e)
225
+ }
226
+ }
227
+
228
+ @ReactMethod
229
+ fun isRootedDevice(promise: Promise) {
230
+ try {
231
+ val result = module?.isRootedDevice() ?: false
232
+ promise.resolve(result)
233
+ } catch (e: Exception) {
234
+ promise.reject("IS_ROOTED_DEVICE_ERROR", "Failed to detect rooted device", e)
235
+ }
236
+ }
237
+
238
+ @ReactMethod
239
+ fun isFingerprintChanged(promise: Promise) {
240
+ try {
241
+ val result = module?.isFingerprintChanged() ?: false
242
+ promise.resolve(result)
243
+ } catch (e: Exception) {
244
+ promise.reject("IS_FINGERPRINT_CHANGED_ERROR", "Failed to detect fingerprint change", e)
245
+ }
246
+ }
247
+
248
+ @ReactMethod
249
+ fun getSignatures(promise: Promise) {
250
+ try {
251
+ val result = module?.let {
252
+ ArrayList(it.getSignatures(reactApplicationContext).toList())
253
+ } ?: ArrayList()
254
+ promise.resolve(result)
255
+ } catch (e: Exception) {
256
+ promise.reject("GET_SIGNATURES_ERROR", "Failed to get signatures", e)
257
+ }
258
+ }
259
+
236
260
  @ReactMethod
237
- fun getDexCRC(): Long {
238
- return module?.let {
239
- try {
240
- it.getDexCRC(reactApplicationContext)
241
- } catch (e: Exception) {
242
- e.printStackTrace()
243
- -1L // Hata durumunda -1 döndürülür
244
- }
245
- } ?: -1L // Module null ise -1 döndürülür
246
- }
247
-
261
+ fun getStringCurrentCallStatus(promise: Promise) {
262
+ try {
263
+ val value = module?.getCurrentCallStatus()?.getStringValue() ?: ""
264
+ promise.resolve(value)
265
+ } catch (e: Exception) {
266
+ promise.resolve("")
267
+ }
268
+ }
269
+
248
270
  @ReactMethod
249
- fun getSecurityFeatureChecks(): SecurityFeatureCheck? {
250
- return module?.let {
251
- it.getSecurityFeatureChecks()
252
- } ?: null // Module null ise null döndürülür
253
- }
254
-
271
+ fun getIntCurrentCallStatus(promise: Promise) {
272
+ try {
273
+ val status = module?.let {
274
+ it.getCurrentCallStatus().getIntValue()
275
+ } ?: 0
276
+ promise.resolve(status)
277
+ } catch (e: Exception) {
278
+ promise.reject("GET_CALL_STATUS_ERROR", "Failed to get current call status", e)
279
+ }
280
+ }
281
+
255
282
  @ReactMethod
256
- fun getLastScanTime(): String? {
257
- return module?.let {
258
- val lastScanTime: Date = it.getLastScanTime()
259
- val dateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
260
- dateFormat.format(lastScanTime) // Tarihi String formatına çevirir
261
- } ?: "" // Module null ise boş string döndürülür
262
- }
263
-
283
+ fun getDexCRC(promise: Promise) {
284
+ try {
285
+ val result = module?.getDexCRC(reactApplicationContext) ?: -1L
286
+ promise.resolve(result)
287
+ } catch (e: Exception) {
288
+ e.printStackTrace()
289
+ promise.reject("GET_DEX_CRC_ERROR", "Failed to get Dex CRC", e)
290
+ }
291
+ }
292
+
293
+ @ReactMethod
294
+ fun getSecurityFeatureChecks(promise: Promise) {
295
+ try {
296
+ val securityCheck = module?.getSecurityFeatureChecks()
297
+ if (securityCheck != null) {
298
+ val sb = StringBuilder()
299
+ sb.append("{")
300
+ sb.append("\"isMalwareDetected\":").append(securityCheck.isMalwareDetected()).append(",")
301
+ sb.append("\"isDebuggerDetected\":").append(securityCheck.isDebuggerDetected()).append(",")
302
+ sb.append("\"isEmulationDetected\":").append(securityCheck.isEmulationDetected()).append(",")
303
+ sb.append("\"emulationDetectionDescription\":\"").append(securityCheck.getEmulationDetectionDescription()).append("\",")
304
+ sb.append("\"isRootDetected\":").append(securityCheck.isRootDetected()).append(",")
305
+ sb.append("\"rootDetectionDescription\":\"").append(securityCheck.getRootDetectionDescription()).append("\",")
306
+ sb.append("\"isIntegrityBroken\":").append(securityCheck.isIntegrityBroken()).append(",")
307
+ sb.append("\"isFingerprintChanged\":").append(securityCheck.isFingerprintChanged()).append(",")
308
+ sb.append("\"isScreenReaderAppsDetected\":").append(securityCheck.isScreenReaderAppsDetected()).append(",")
309
+ sb.append("\"isOverlayedAppsDetected\":").append(securityCheck.isOverlayedAppsDetected()).append(",")
310
+ sb.append("\"isDevModeEnabled\":").append(securityCheck.isDevModeEnabled()).append(",")
311
+ sb.append("\"factoryResetTime\":").append(securityCheck.getFactoryResetTime() ?: "null").append(",")
312
+ sb.append("\"isVpnActive\":").append(securityCheck.getIsVpnActive()).append(",")
313
+ sb.append("\"isDefaultSmsAppChanged\":").append(securityCheck.isDefaultSmsAppChanged()).append(",")
314
+ sb.append("\"isSimChanged\":").append(securityCheck.isSimChanged()).append(",")
315
+ sb.append("\"isProxyActive\":").append(securityCheck.isProxyActive()).append(",")
316
+ sb.append("\"isMockLocation\":").append(securityCheck.isMockLocation()).append(",")
317
+ sb.append("\"isKeyloggerDetected\":").append(securityCheck.isKeyloggerDetected()).append(",")
318
+ sb.append("\"isVirtualTouch\":").append(securityCheck.isVirtualTouch()).append(",")
319
+ sb.append("\"isCallForwardActive\":").append(securityCheck.isCallForwardActive()).append(",")
320
+ sb.append("\"isUsbConnected\":").append(securityCheck.isUsbConnected()).append(",")
321
+ sb.append("\"isSuspiciousWifi\":").append(securityCheck.isPotentialEvilTwin()).append(",")
322
+ sb.append("\"isKeyboardAppChanged\":").append(securityCheck.isKeyboardAppChanged())
323
+ sb.append("}")
324
+
325
+ val jsonString = sb.toString()
326
+ promise.resolve(jsonString)
327
+ } else {
328
+ sendLogEvent("Security check module is null")
329
+ promise.resolve(null)
330
+ }
331
+ } catch (e: Exception) {
332
+ e.printStackTrace()
333
+ promise.reject("GET_SECURITY_FEATURE_CHECKS_ERROR", "Failed to get security feature checks", e)
334
+ }
335
+ }
336
+
264
337
  @ReactMethod
265
- fun getUpdateStatus(): UpdateStatus? {
266
- return module?.let {
267
- it.getUpdateStatus()
268
- } ?: null // Module null ise null döndürülür
269
- }
270
-
338
+ fun getLastScanTime(promise: Promise) {
339
+ try {
340
+ val lastScanTime = module?.getLastScanTime()
341
+ val dateFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
342
+ val formattedDate = lastScanTime?.let { dateFormat.format(it) } ?: ""
343
+ promise.resolve(formattedDate)
344
+ } catch (e: Exception) {
345
+ e.printStackTrace()
346
+ promise.reject("GET_LAST_SCAN_TIME_ERROR", "Failed to get last scan time", e)
347
+ }
348
+ }
349
+
350
+ @ReactMethod
351
+ fun getUpdateStatus(promise: Promise) {
352
+ try {
353
+ val updateStatus = module?.getUpdateStatus()
354
+ if (updateStatus != null) {
355
+ promise.resolve(updateStatus.name) // Enum ise ismini string olarak gönder
356
+ } else {
357
+ promise.resolve(null)
358
+ }
359
+ } catch (e: Exception) {
360
+ e.printStackTrace()
361
+ promise.reject("GET_UPDATE_STATUS_ERROR", "Failed to get update status", e)
362
+ }
363
+ }
271
364
 
272
365
  //Send log message when ovveride functions worked.
273
366
  private fun sendLogEvent(message: String) {
@@ -292,8 +385,10 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
292
385
  sendLogEvent("Register fail: $message")
293
386
  }
294
387
 
295
- override fun onRunningInEmulator(value: Boolean) {
296
- sendLogEvent("Run in emulator: $value")
388
+ override fun onRunningInEmulator(value: Boolean, description: String) {
389
+ sendLogEvent("Run in emulator: $value")
390
+ val output: String = if (description.isEmpty()) "Tespit edilemedi" else description
391
+ sendLogEvent("Run in emulator description: $output")
297
392
  }
298
393
 
299
394
  override fun onIntegrityCheck(b: Boolean) {
@@ -304,50 +399,62 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
304
399
  sendLogEvent("Keyloggers detected: $p0")
305
400
  }
306
401
 
307
- override fun onRootedDeviceDetected(value: Boolean) {
308
- sendLogEvent("Rooted device detected: $value")
402
+ override fun onRootedDeviceDetected(value: Boolean, description: String) {
403
+ sendLogEvent("Rooted device detected: $value")
404
+ val output: String = if (description.isEmpty()) "Tespit edilemedi" else description
405
+ sendLogEvent("Rooted device description: $output")
309
406
  }
310
407
 
311
408
  override fun onThreatDetected(infectedApps: ArrayList<InfectedApp>) {
312
- sendLogEvent("Threat detected: $infectedApps")
409
+ sendLogEvent("Threat detected: $infectedApps")
313
410
 
314
- if (ConstHelper.DetectedThreats == null) {
315
- ConstHelper.DetectedThreats = ArrayList<String>()
411
+ if (ConstHelper.DetectedThreats == null) {
412
+ ConstHelper.DetectedThreats = ArrayList<String>()
413
+ }
414
+
415
+ for (infectedApp in infectedApps) {
416
+ if (ConstHelper.DetectedThreats.contains(infectedApp.getPackageName())) {
417
+ continue
316
418
  }
317
419
 
318
- for (infectedApp in infectedApps) {
319
- if (ConstHelper.DetectedThreats.contains(infectedApp.getPackageName())) {
320
- continue
420
+ if (infectedApp.getPackageName() != null) {
421
+ val detectedTypes = StringBuilder()
422
+ val malwareEntries: ArrayList<MalwareEntry>? = infectedApp.getMalwareTypes()
423
+
424
+ if (malwareEntries != null && malwareEntries.isNotEmpty()) {
425
+ for (entry in malwareEntries) {
426
+ detectedTypes.append(entry.getMalwareType().name)
427
+ .append(" - ").append("%")
428
+ .append(String.format(Locale.US, "%.2f", entry.getPercentage()))
429
+ .append(", ")
321
430
  }
431
+ }
322
432
 
323
- if (infectedApp.getPackageName() != null) {
324
- sendLogEvent(
325
- "Threat detected: ${infectedApp.getPackageName()} - ${infectedApp.getThreatName()}")
326
- //Uninstall when app infected
327
- val uninstallHandler = UninstallHandler(
328
- getCurrentActivity() ?: reactApplicationContext,
329
- infectedApp.getName(),
330
- infectedApp.getPackageName(),
331
- infectedApp.getVersion(),
332
- infectedApp.getThreatName()
333
- )
334
-
335
- CoroutineScope(Dispatchers.Main).launch {
336
- try {
337
- uninstallHandler.showDialog()
338
- sendLogEvent("Uninstall dialog shown for ${infectedApp.getPackageName()}")
339
- } catch (e: Exception) {
340
- sendLogEvent("Error showing uninstall dialog: ${e.message}")
341
- }
342
- }
433
+ if (!infectedApp.getPackageName().isNullOrEmpty()) {
434
+ sendLogEvent("Threat detected: ${infectedApp.getPackageName()} - ${infectedApp.getThreatName()} - [${detectedTypes}]")
435
+ } else {
436
+ sendLogEvent("Threat detected: ${infectedApp.getThreatName()} - ${infectedApp.getName()}")
437
+ }
343
438
 
344
- } else {
345
- sendLogEvent(
346
- "Threat detected: ${infectedApp.getName()} - ${infectedApp.getThreatName()}")
439
+ CoroutineScope(Dispatchers.Main).launch {
440
+ try {
441
+ val uninstallHandler = UninstallHandler(
442
+ context = reactApplicationContext,
443
+ installedAppName = infectedApp.getName() ?: "Unknown App",
444
+ installedAppPackageName = infectedApp.getPackageName(),
445
+ installedAppVersion = infectedApp.getVersion() ?: "Unknown Version",
446
+ threatName = infectedApp.getThreatName() ?: "Unknown Threat"
447
+ )
448
+ uninstallHandler.showDialog()
449
+ sendLogEvent("Uninstall dialog shown for ${infectedApp.getPackageName()}")
450
+ } catch (e: Exception) {
451
+ sendLogEvent("Error showing uninstall dialog: ${e.message}")
347
452
  }
348
-
349
-
453
+ }
454
+ } else {
455
+ sendLogEvent("Threat detected: ${infectedApp.getName()} - ${infectedApp.getThreatName()}")
350
456
  }
457
+ }
351
458
  }
352
459
 
353
460
  override fun onIncomingCall(state: Int, phoneNumber: String?, incomingNumber: IncomingNumber?) {
@@ -408,4 +515,9 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
408
515
  sendLogEvent("Application uninstall detected: $s")
409
516
  }
410
517
 
518
+ override fun onCloneAppDetected(cloneApps: ArrayList<CloneApp>) {
519
+ for (item in cloneApps) {
520
+ sendLogEvent("Clone app detected: $item")
521
+ }
522
+ }
411
523
  }
@@ -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.AlertDialog
4
- import android.content.Context
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: Context,
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
- }
1
+ package com.cproteadmodule
2
+
3
+ import android.app.AlertDialog
4
+ import android.content.Context
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: Context,
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
43
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","CProtEadModule","NativeModules","Proxy","get","Error","_default","exports"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"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":[]}
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":[]}
@@ -1,5 +1,3 @@
1
- "use strict";
2
-
3
1
  import { NativeModules, Platform } from 'react-native';
4
2
  const LINKING_ERROR = `The package 'c-prot-ead-module' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
5
3
  ios: "- You have run 'pod install'\n",
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","CProtEadModule","Proxy","get","Error"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"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":[]}
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,10 +1,10 @@
1
1
  {
2
2
  "name": "com.cprot.ead",
3
- "version": "1.0.5764",
3
+ "version": "1.0.7207",
4
4
  "description": "c-prot ead android module",
5
5
  "source": "./src/index.tsx",
6
- "main": "./lib/commonjs/index.js",
7
- "module": "./lib/module/index.js",
6
+ "main": "lib/commonjs/index.js",
7
+ "module": "lib/module/index.js",
8
8
  "exports": {
9
9
  ".": {
10
10
  "import": {
@@ -20,6 +20,9 @@
20
20
  "files": [
21
21
  "src",
22
22
  "lib",
23
+ "!**/__tests__",
24
+ "!**/__fixtures__",
25
+ "!**/__mocks__",
23
26
  "android",
24
27
  "!ios/build",
25
28
  "!android/build",
@@ -27,9 +30,6 @@
27
30
  "!android/gradlew",
28
31
  "!android/gradlew.bat",
29
32
  "!android/local.properties",
30
- "!**/__tests__",
31
- "!**/__fixtures__",
32
- "!**/__mocks__",
33
33
  "!**/.*"
34
34
  ],
35
35
  "scripts": {
@@ -57,6 +57,7 @@
57
57
  "devDependencies": {
58
58
  "@commitlint/config-conventional": "^17.0.2",
59
59
  "@evilmartians/lefthook": "^1.5.0",
60
+ "@react-native-community/bob": "^0.17.1",
60
61
  "@react-native/eslint-config": "0.74.0",
61
62
  "@release-it/conventional-changelog": "^5.0.0",
62
63
  "@types/jest": "^29.5.5",
@@ -73,7 +74,7 @@
73
74
  "react-native-builder-bob": "^0.30.0",
74
75
  "release-it": "^15.0.0",
75
76
  "turbo": "^1.10.7",
76
- "typescript": "^5.2.2"
77
+ "typescript": "^5.7.2"
77
78
  },
78
79
  "resolutions": {
79
80
  "@types/react": "^18.2.44"
@@ -175,5 +176,16 @@
175
176
  "type": "module-legacy",
176
177
  "languages": "kotlin-objc",
177
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
+ ]
178
190
  }
179
191
  }
@@ -1 +0,0 @@
1
- {"type":"commonjs"}
@@ -1 +0,0 @@
1
- {"type":"module"}
@@ -1 +0,0 @@
1
- {"type":"commonjs"}
@@ -1,3 +0,0 @@
1
- declare const CProtEadModule: any;
2
- export default CProtEadModule;
3
- //# sourceMappingURL=index.d.ts.map
@@ -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,3 +0,0 @@
1
- declare const CProtEadModule: any;
2
- export default CProtEadModule;
3
- //# sourceMappingURL=index.d.ts.map
@@ -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"}