abdelrahmanbonna / security_plus

Flutter Plugin to handle all security needs
The Unlicense
3 stars 0 forks source link

does not have android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION. #9

Open abdelrahmanbonna opened 4 months ago

abdelrahmanbonna commented 4 months ago

A bug has been found while trying to build android on windows machine:

E/MethodChannel#security_plus( 3677): Failed to handle method call
E/MethodChannel#security_plus( 3677): java.lang.SecurityException: uid 10190 does not have android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION.
E/MethodChannel#security_plus( 3677):   at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
E/MethodChannel#security_plus( 3677):   at android.os.Parcel.createException(Parcel.java:3041)
E/MethodChannel#security_plus( 3677):   at android.os.Parcel.readException(Parcel.java:3024)
E/MethodChannel#security_plus( 3677):   at android.os.Parcel.readException(Parcel.java:2966)
E/MethodChannel#security_plus( 3677):   at android.location.ILocationManager$Stub$Proxy.getLastLocation(ILocationManager.java:1272)
E/MethodChannel#security_plus( 3677):   at android.location.LocationManager.getLastKnownLocation(LocationManager.java:903)
E/MethodChannel#security_plus( 3677):   at android.location.LocationManager.getLastKnownLocation(LocationManager.java:870)
E/MethodChannel#security_plus( 3677):   at com.absolutions.security_plus.SecurityPlusPlugin.isMockLocationEnabled(SecurityPlusPlugin.kt:149)
E/MethodChannel#security_plus( 3677):   at com.absolutions.security_plus.SecurityPlusPlugin.onMethodCall(SecurityPlusPlugin.kt:45)
E/MethodChannel#security_plus( 3677):   at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/MethodChannel#security_plus( 3677):   at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
E/MethodChannel#security_plus( 3677):   at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#security_plus( 3677):   at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#security_plus( 3677):   at android.os.Handler.handleCallback(Handler.java:958)
E/MethodChannel#security_plus( 3677):   at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#security_plus( 3677):   at android.os.Looper.loopOnce(Looper.java:205)
E/MethodChannel#security_plus( 3677):   at android.os.Looper.loop(Looper.java:294)
E/MethodChannel#security_plus( 3677):   at android.app.ActivityThread.main(ActivityThread.java:8177)
E/MethodChannel#security_plus( 3677):   at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#security_plus( 3677):   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/MethodChannel#security_plus( 3677):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
E/MethodChannel#security_plus( 3677): Caused by: android.os.RemoteException: Remote stack trace:
E/MethodChannel#security_plus( 3677):   at com.android.server.location.LocationPermissions.enforceLocationPermission(LocationPermissions.java:119)
E/MethodChannel#security_plus( 3677):   at com.android.server.location.LocationManagerService.getLastLocation(LocationManagerService.java:961)
E/MethodChannel#security_plus( 3677):   at android.location.ILocationManager$Stub.onTransact(ILocationManager.java:561)
E/MethodChannel#security_plus( 3677):   at android.os.Binder.execTransactInternal(Binder.java:1339)
E/MethodChannel#security_plus( 3677):   at android.os.Binder.execTransact(Binder.java:1275)
E/MethodChannel#security_plus( 3677): 
abdelrahmanbonna commented 4 months ago

I think this issue is because we didn't update the native code to support android API 34