Tomiwa-Ot / moukthar

Android remote administration tool
https://youtu.be/ykOx19hAaD4
GNU General Public License v3.0
351 stars 95 forks source link

Client Crash Error and Permission Handling #21

Closed IrvanWijayaSardam closed 8 months ago

IrvanWijayaSardam commented 8 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Git clone
  2. Set server and Websocket
  3. Run from android studio Expected behavior Get conencted on dashboard

Error Log Process: com.ot.grhq.client, PID: 8548 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ot.grhq.client/com.ot.grhq.client.MainActivity}: java.lang.SecurityException: getLine1NumberForDisplay: Neither user 10183 nor current process has android.permission.READ_PHONE_STATE, android.permission.READ_SMS, or android.permission.READ_PHONE_NUMBERS

Additional context Is there any specific android version that this app can running well ?

full log : FATAL EXCEPTION: main Process: com.ot.grhq.client, PID: 8818 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ot.grhq.client/com.ot.grhq.client.MainActivity}: java.lang.SecurityException: getLine1NumberForDisplay: Neither user 10183 nor current process has android.permission.READ_PHONE_STATE, android.permission.READ_SMS, or android.permission.READ_PHONE_NUMBERS at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3645) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7924) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Caused by: java.lang.SecurityException: getLine1NumberForDisplay: Neither user 10183 nor current process has android.permission.READ_PHONE_STATE, android.permission.READ_SMS, or android.permission.READ_PHONE_NUMBERS at android.os.Parcel.createExceptionOrNull(Parcel.java:3011) at android.os.Parcel.createException(Parcel.java:2995) at android.os.Parcel.readException(Parcel.java:2978) at android.os.Parcel.readException(Parcel.java:2920) at com.android.internal.telephony.ITelephony$Stub$Proxy.getLine1NumberForDisplay(ITelephony.java:10150) at android.telephony.TelephonyManager.getLine1Number(TelephonyManager.java:5064) at android.telephony.TelephonyManager.getLine1Number(TelephonyManager.java:5032) at com.ot.grhq.client.functionality.Utils.phoneNumber(Utils.java:97) at com.ot.grhq.client.MainActivity.setClientID(MainActivity.java:133) at com.ot.grhq.client.MainActivity.onCreate(MainActivity.java:75) at android.app.Activity.performCreate(Activity.java:8342) at android.app.Activity.performCreate(Activity.java:8321) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:201)  at android.os.Looper.loop(Looper.java:288)  at android.app.ActivityThread.main(ActivityThread.java:7924)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) 

Tomiwa-Ot commented 8 months ago

Issues fixed. Pull latest commit