0x5ECF4ULT / PanicTrigger

An app for emergency situation
https://tacticaldevc.github.io/PanicTrigger
GNU General Public License v3.0
27 stars 13 forks source link

[BUG] The app crashed when i disallow all permission and clicked on the big red button. #25

Closed darewealth closed 5 years ago

darewealth commented 5 years ago

Describe the bug When I launched the app I disallow all permission, and I allowed the disclaimer as it shows in the app. when I got to the big red button, the app crashed when I pressed it.

To Reproduce

  1. Launch the app
  2. Disallow all permission and allowed the disclaimer.
  3. Another message on the screen is to configure contacts
  4. Then click 'No Thanks'. The next popup is 'WARNING'
  5. Click on YES and click on TRIGGER
  6. See error

Expected behavior I expect to receive a popup message that I need to allow permission and set a contact to use the app.

Screenshots https://youtu.be/wNXEKFg6Ib4

**Smartphone

Log


06-03 09:38:14.235 31038 31038 E AndroidRuntime: Process: at.tacticaldevc.panictrigger, PID: 31038
06-03 09:38:14.235 31038 31038 E AndroidRuntime: java.lang.IllegalStateException: Could not execute method for android:onClick
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:390)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.view.View.performClick(View.java:5209)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.view.View$PerformClick.run(View.java:21166)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:739)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:95)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:5452)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:781)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:671)
06-03 09:38:14.235 31038 31038 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    ... 9 more
06-03 09:38:14.235 31038 31038 E AndroidRuntime: Caused by: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxx cmp=com.android.server.telecom/.components.UserCallActivity } from ProcessRecord{5cf19b3 31038:at.tacticaldevc.panictrigger/u0a229} (pid=31038, uid=10229) with revoked permission android.permission.CALL_PHONE
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.os.Parcel.readException(Parcel.java:1599)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.os.Parcel.readException(Parcel.java:1552)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2730)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1510)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.app.Activity.startActivityForResult(Activity.java:3935)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.app.Activity.startActivityForResult(Activity.java:3895)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.app.Activity.startActivity(Activity.java:4267)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at android.app.Activity.startActivity(Activity.java:4235)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at at.tacticaldevc.panictrigger.TriggerActivity.getCurrentLocationAndPanic(TriggerActivity.java:162)
06-03 09:38:14.235 31038 31038 E AndroidRuntime:    at at.tacticaldevc.panictrigger.TriggerActivity.onClick(TriggerActivity.java:133)```
0x5ECF4ULT commented 5 years ago

Hey there :) Thanks for your issue. I am aware of this bug and haven't implemented a check if the permissions have really been granted. I'm working on it. Please expect a fix in the next release.

0x5ECF4ULT commented 5 years ago

Closing this issue as this feature is implemented now