From a64401c62e11479015ed40dbb21fcecc1958505f Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 08:47:41 -0500 Subject: [PATCH 01/16] bpyke1: added arg for setLogging to jailbroken --- .../FlutterJailbreakDetectionPlugin.kt | 2 ++ example/lib/main.dart | 14 +++++++++----- lib/flutter_jailbreak_detection.dart | 5 +++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index d34917c..08c8b72 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,6 +41,8 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) + val setLogging = call.method.arguments.setLogging + rootBeer.setLogging(setLogging) result.success(rootBeer.isRooted) } else if (call.method.equals("developerMode")) { result.success(isDevMode()) diff --git a/example/lib/main.dart b/example/lib/main.dart index a6e84e7..50b8bbe 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -27,7 +27,7 @@ class _MyAppState extends State { bool developerMode; // Platform messages may fail, so we use a try/catch PlatformException. try { - jailbroken = await FlutterJailbreakDetection.jailbroken; + jailbroken = await FlutterJailbreakDetection.jailbroken(); developerMode = await FlutterJailbreakDetection.developerMode; } on PlatformException { jailbroken = true; @@ -52,10 +52,14 @@ class _MyAppState extends State { appBar: AppBar( title: const Text('Jailbroken plugin example app'), ), - body: Center( - child: Column( mainAxisAlignment: MainAxisAlignment.center, - children: [Text('Jailbroken: ${_jailbroken == null ? "Unknown" : _jailbroken! ? "YES" : "NO"}'), - Text('Developer mode: ${_developerMode == null ? "Unknown" : _developerMode! ? "YES" : "NO"}') + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Jailbroken: ${_jailbroken == null ? "Unknown" : _jailbroken! ? "YES" : "NO"}'), + Text( + 'Developer mode: ${_developerMode == null ? "Unknown" : _developerMode! ? "YES" : "NO"}') ], ), ), diff --git a/lib/flutter_jailbreak_detection.dart b/lib/flutter_jailbreak_detection.dart index 6adaace..1db02d1 100644 --- a/lib/flutter_jailbreak_detection.dart +++ b/lib/flutter_jailbreak_detection.dart @@ -6,8 +6,9 @@ class FlutterJailbreakDetection { static const MethodChannel _channel = const MethodChannel('flutter_jailbreak_detection'); - static Future get jailbroken async { - bool? jailbroken = await _channel.invokeMethod('jailbroken'); + static Future jailbroken({bool setLogging = true}) async { + bool? jailbroken = + await _channel.invokeMethod('jailbroken', [setLogging]); return jailbroken ?? true; } From 3c96c2fdbff6055f1f32f878ff6fbfa2f6b13645 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 09:09:44 -0500 Subject: [PATCH 02/16] bpyke1: fixed argument ref --- .../FlutterJailbreakDetectionPlugin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index 08c8b72..a989847 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,7 +41,7 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) - val setLogging = call.method.arguments.setLogging + val setLogging = call.argument("setLogging") rootBeer.setLogging(setLogging) result.success(rootBeer.isRooted) } else if (call.method.equals("developerMode")) { From a4a6f1c276df4f0653380887cbc661d96ba4a2a1 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 09:17:13 -0500 Subject: [PATCH 03/16] bpyke1: adjusted arg --- lib/flutter_jailbreak_detection.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/flutter_jailbreak_detection.dart b/lib/flutter_jailbreak_detection.dart index 1db02d1..bd5b9ae 100644 --- a/lib/flutter_jailbreak_detection.dart +++ b/lib/flutter_jailbreak_detection.dart @@ -7,8 +7,8 @@ class FlutterJailbreakDetection { const MethodChannel('flutter_jailbreak_detection'); static Future jailbroken({bool setLogging = true}) async { - bool? jailbroken = - await _channel.invokeMethod('jailbroken', [setLogging]); + bool? jailbroken = await _channel + .invokeMethod('jailbroken', {"setLogging": setLogging}); return jailbroken ?? true; } From 5ebce846176921d56e7e2631e428a4e40061c5a3 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 09:28:08 -0500 Subject: [PATCH 04/16] bpyke1: args --- .../FlutterJailbreakDetectionPlugin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index a989847..a21c4bf 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,7 +41,7 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) - val setLogging = call.argument("setLogging") + val setLogging = call.argument("setLogging") rootBeer.setLogging(setLogging) result.success(rootBeer.isRooted) } else if (call.method.equals("developerMode")) { From 5b18dd31b9fb0c66895fab12367cd961dfe73d9d Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 09:33:32 -0500 Subject: [PATCH 05/16] bpyke1: update type --- .../FlutterJailbreakDetectionPlugin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index a21c4bf..6532711 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,7 +41,7 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) - val setLogging = call.argument("setLogging") + val setLogging: Boolean = call.argument("setLogging") rootBeer.setLogging(setLogging) result.success(rootBeer.isRooted) } else if (call.method.equals("developerMode")) { From 0689ec8f249b3d4034e13b71d062049006abb227 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 09:38:33 -0500 Subject: [PATCH 06/16] bpyke1: args update --- .../FlutterJailbreakDetectionPlugin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index 6532711..aa06901 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,7 +41,7 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) - val setLogging: Boolean = call.argument("setLogging") + val setLogging: Boolean = call.arguments("setLogging") rootBeer.setLogging(setLogging) result.success(rootBeer.isRooted) } else if (call.method.equals("developerMode")) { From 9dd95fb2d941a21cec82b805ab406c43449e1164 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 09:39:31 -0500 Subject: [PATCH 07/16] bpyke1: added log --- .../flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index aa06901..0283c5d 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,6 +41,7 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) + Log.d(call.arguments) val setLogging: Boolean = call.arguments("setLogging") rootBeer.setLogging(setLogging) result.success(rootBeer.isRooted) From 3a521d08fa8eee061d1aef809c65223082620072 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 09:42:13 -0500 Subject: [PATCH 08/16] bpyke1: log --- .../FlutterJailbreakDetectionPlugin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index 0283c5d..5693506 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,7 +41,7 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) - Log.d(call.arguments) + Log.e(call.arguments) val setLogging: Boolean = call.arguments("setLogging") rootBeer.setLogging(setLogging) result.success(rootBeer.isRooted) From 29e500009e43f00f287b7b9751452493b2acbfb0 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 09:44:21 -0500 Subject: [PATCH 09/16] bpyke1: types --- .../FlutterJailbreakDetectionPlugin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index 5693506..66629b0 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -42,7 +42,7 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) Log.e(call.arguments) - val setLogging: Boolean = call.arguments("setLogging") + val setLogging by Boolean = call.arguments("setLogging") rootBeer.setLogging(setLogging) result.success(rootBeer.isRooted) } else if (call.method.equals("developerMode")) { From c46cfd770144a2d6323199c00faabc0869a88633 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 10:15:05 -0500 Subject: [PATCH 10/16] bpyke1: fixed types --- .../FlutterJailbreakDetectionPlugin.kt | 3 +-- lib/flutter_jailbreak_detection.dart | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index 66629b0..e2fa436 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,8 +41,7 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) - Log.e(call.arguments) - val setLogging by Boolean = call.arguments("setLogging") + val setLogging = call.arguments("setLogging") rootBeer.setLogging(setLogging) result.success(rootBeer.isRooted) } else if (call.method.equals("developerMode")) { diff --git a/lib/flutter_jailbreak_detection.dart b/lib/flutter_jailbreak_detection.dart index bd5b9ae..28704d7 100644 --- a/lib/flutter_jailbreak_detection.dart +++ b/lib/flutter_jailbreak_detection.dart @@ -7,8 +7,9 @@ class FlutterJailbreakDetection { const MethodChannel('flutter_jailbreak_detection'); static Future jailbroken({bool setLogging = true}) async { - bool? jailbroken = await _channel - .invokeMethod('jailbroken', {"setLogging": setLogging}); + bool? jailbroken = await _channel.invokeMethod('jailbroken', [ + {"setLogging": setLogging} + ]); return jailbroken ?? true; } From 6edf9ce7af480053bb7048dc4658c0246bbe90f5 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 10:23:10 -0500 Subject: [PATCH 11/16] bpyke1: fixed args --- .../FlutterJailbreakDetectionPlugin.kt | 2 +- lib/flutter_jailbreak_detection.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index e2fa436..eb377bf 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,7 +41,7 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) - val setLogging = call.arguments("setLogging") + val setLogging = call.argument("setLogging") == true rootBeer.setLogging(setLogging) result.success(rootBeer.isRooted) } else if (call.method.equals("developerMode")) { diff --git a/lib/flutter_jailbreak_detection.dart b/lib/flutter_jailbreak_detection.dart index 28704d7..24bd062 100644 --- a/lib/flutter_jailbreak_detection.dart +++ b/lib/flutter_jailbreak_detection.dart @@ -8,7 +8,7 @@ class FlutterJailbreakDetection { static Future jailbroken({bool setLogging = true}) async { bool? jailbroken = await _channel.invokeMethod('jailbroken', [ - {"setLogging": setLogging} + {"setLogging": setLogging} ]); return jailbroken ?? true; } From 2bf00cfad9f9b874c842c675998c36adae4818e5 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 14:04:30 -0500 Subject: [PATCH 12/16] bpyke1: testing --- .../FlutterJailbreakDetectionPlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index eb377bf..1fdcbaa 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,8 +41,8 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) - val setLogging = call.argument("setLogging") == true - rootBeer.setLogging(setLogging) + // val setLogging = call.argument("setLogging") == true + rootBeer.setLogging(false) result.success(rootBeer.isRooted) } else if (call.method.equals("developerMode")) { result.success(isDevMode()) From bbb0f5d3c35ced872822f2af9617180cbe233719 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 14:08:19 -0500 Subject: [PATCH 13/16] bpyke1: testing --- lib/flutter_jailbreak_detection.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/flutter_jailbreak_detection.dart b/lib/flutter_jailbreak_detection.dart index 24bd062..b6526f3 100644 --- a/lib/flutter_jailbreak_detection.dart +++ b/lib/flutter_jailbreak_detection.dart @@ -6,10 +6,12 @@ class FlutterJailbreakDetection { static const MethodChannel _channel = const MethodChannel('flutter_jailbreak_detection'); - static Future jailbroken({bool setLogging = true}) async { - bool? jailbroken = await _channel.invokeMethod('jailbroken', [ - {"setLogging": setLogging} - ]); + static Future get jailbroken async { + bool? jailbroken = await _channel.invokeMethod('jailbroken'); + // bool? jailbroken = await _channel.invokeMethod('jailbroken', [ + // {"setLogging": setLogging} + // ]); + return jailbroken ?? true; } From fd16c784bcad3bddba0079d433642b6c48a98d54 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 14:26:47 -0500 Subject: [PATCH 14/16] bpyke1: fixed methodcall --- .../FlutterJailbreakDetectionPlugin.kt | 4 ++-- lib/flutter_jailbreak_detection.dart | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index 1fdcbaa..eb377bf 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,8 +41,8 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) - // val setLogging = call.argument("setLogging") == true - rootBeer.setLogging(false) + val setLogging = call.argument("setLogging") == true + rootBeer.setLogging(setLogging) result.success(rootBeer.isRooted) } else if (call.method.equals("developerMode")) { result.success(isDevMode()) diff --git a/lib/flutter_jailbreak_detection.dart b/lib/flutter_jailbreak_detection.dart index b6526f3..226adc7 100644 --- a/lib/flutter_jailbreak_detection.dart +++ b/lib/flutter_jailbreak_detection.dart @@ -6,11 +6,9 @@ class FlutterJailbreakDetection { static const MethodChannel _channel = const MethodChannel('flutter_jailbreak_detection'); - static Future get jailbroken async { - bool? jailbroken = await _channel.invokeMethod('jailbroken'); - // bool? jailbroken = await _channel.invokeMethod('jailbroken', [ - // {"setLogging": setLogging} - // ]); + static Future jailbroken({bool setLogging = true}) async { + bool? jailbroken = await _channel.invokeMethod( + 'jailbroken', {"setLogging": setLogging}); return jailbroken ?? true; } From 6499d9ea21a0b4c8486cf8c562fcc342c695d10c Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 14:31:04 -0500 Subject: [PATCH 15/16] bpyke1: fixed statement --- .../FlutterJailbreakDetectionPlugin.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index eb377bf..6d9ba28 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,7 +41,7 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) - val setLogging = call.argument("setLogging") == true + val setLogging = call.argument("setLogging") rootBeer.setLogging(setLogging) result.success(rootBeer.isRooted) } else if (call.method.equals("developerMode")) { From edb1c192d69554c4d3475c7ec892de1fd731c1b8 Mon Sep 17 00:00:00 2001 From: "barrett.pyke" Date: Mon, 27 Mar 2023 14:35:48 -0500 Subject: [PATCH 16/16] bpyke1: fix --- .../FlutterJailbreakDetectionPlugin.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt index 6d9ba28..0f7ad1c 100644 --- a/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt +++ b/android/src/main/kotlin/appmire/be/flutterjailbreakdetection/FlutterJailbreakDetectionPlugin.kt @@ -41,8 +41,8 @@ class FlutterJailbreakDetectionPlugin : FlutterPlugin, MethodCallHandler { override fun onMethodCall(call: MethodCall, result: Result): Unit { if (call.method.equals("jailbroken")) { val rootBeer = RootBeer(context) - val setLogging = call.argument("setLogging") - rootBeer.setLogging(setLogging) + val setLoggingValue = call.argument("setLogging") == true + rootBeer.setLogging(setLoggingValue) result.success(rootBeer.isRooted) } else if (call.method.equals("developerMode")) { result.success(isDevMode())