mwarning / trigger

Android app to lock/unlock/ring doors. Supports generic HTTPS/SSH/Bluetooth/MQTT and Nuki Smartlock.
GNU General Public License v3.0
130 stars 22 forks source link

ssh config causes at least 3.2.0 and 3.2.1 to FC on android 11 #50

Closed StickyDigit closed 3 years ago

StickyDigit commented 3 years ago

Simply creating an ssh config, e.g. door name test, IP 127.1.2.3, port 12322, seems to save ok, but the app will only run for a fraction of a second when you leave the config. It will not run again until the app data is erased.

I did have three ssh 'doors' working well in my old config, on Lineage 16. Not now I don't.

Tried on two different Lineage 18.1 installs.

mwarning commented 3 years ago

I tried with the Android Studio Virtual Device (Android 11 / Trigger 3.2.0) and it works for me. I am not sure how to reproduce this. Would you be able to run Android Studio, connect your phone via USB to your computer and check the Logcat window in Android Studio? That way you could see when it is crashing and copy&paste the error here.

StickyDigit commented 3 years ago

About to get some kip. Will install the necessary and do the required if all open and truly free, when awake ;;-)

On 10 April 2021 07:24:50 BST, Moritz Warning @.***> wrote:

I tried with the Android Studio Virtual Device and it works. I am not sure how to reproduce this. Would you be able to run Android Studio, connect yout phone via USB to your computer and check the Logcat window? That way you could see when it is crashing and copy&paste the error here.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/mwarning/trigger/issues/50#issuecomment-817087438 -- Sent from a phone. Please excuse my brevity.

StickyDigit commented 3 years ago

So.. after sleep, realised all I needed was adb logcat | tee /tmp/carnage

Door name: d Type: ssh Addr: 127.1.2.3 Port: 12322 Login: testbloke no pw Open: o Close: c Ring: r State: s

Adding each in turn it all works until I add the 'state' command. Then, as soon as I save and hit back it FCs itself. The same happens still on both droids here.

Will see if I can get anything meaningful out of logcat but am wary of publishing unfiltered log data from a 'live' device.

StickyDigit commented 3 years ago
grep 24013 carnage
04-10 14:49:32.739   511   511 D Zygote  : Forked child process 24013
04-10 14:49:32.742  1093  1227 I ActivityManager: Start proc 24013:com.example.trigger/u0a174 for pre-top-activity {com.example.trigger/app.trigger.MainActivity}
04-10 14:49:32.758 24013 24013 E example.trigge: Not starting debugger since process cannot load the jdwp agent.
04-10 14:49:32.804 24013 24013 D NetworkSecurityConfig: No Network Security Config specified, using platform default
04-10 14:49:32.805 24013 24013 D NetworkSecurityConfig: No Network Security Config specified, using platform default
04-10 14:49:32.867 24013 24013 I TetheringManager: registerTetheringEventCallback:com.example.trigger
04-10 14:49:33.151 24013 24013 D CompatibilityChangeReporter: Compat change id reported: 147798919; UID 10174; state: ENABLED
04-10 14:49:33.153 24013 24013 D AndroidRuntime: Shutting down VM
04-10 14:49:33.153 24013 24013 E AndroidRuntime: FATAL EXCEPTION: main
04-10 14:49:33.153 24013 24013 E AndroidRuntime: Process: com.example.trigger, PID: 24013
04-10 14:49:33.153 24013 24013 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
04-10 14:49:33.153 24013 24013 E AndroidRuntime:    at app.trigger.MainActivity.lambda$onTaskResult$1$MainActivity(MainActivity.java:341)
04-10 14:49:33.153 24013 24013 E AndroidRuntime:    at app.trigger.-$$Lambda$MainActivity$7hoj8MlFDrxQWuYVYz6Qvy5s5tI.run(Unknown Source:8)
04-10 14:49:33.153 24013 24013 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:938)
04-10 14:49:33.153 24013 24013 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 14:49:33.153 24013 24013 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:223)
04-10 14:49:33.153 24013 24013 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7660)
04-10 14:49:33.153 24013 24013 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
04-10 14:49:33.153 24013 24013 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
04-10 14:49:33.153 24013 24013 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
04-10 14:49:33.168 24013 24013 I Process : Sending signal. PID: 24013 SIG: 9
04-10 14:49:33.177   441   441 E lowmemorykiller: Error writing /proc/24013/oom_score_adj; errno=22
04-10 14:49:33.231   511   511 I Zygote  : Process 24013 exited due to signal 9 (Killed)
04-10 14:49:33.242  1093  2993 I ActivityManager: Process com.example.trigger (pid 24013) has died: prcp TOP 
04-10 14:49:33.244  1093  1235 I libprocessgroup: Successfully killed process cgroup uid 10174 pid 24013 in 0ms
04-10 14:49:33.278  1093  1191 W ActivityManager: setHasOverlayUi called on unknown pid: 24013

Any help?

mwarning commented 3 years ago

hi,

yes, that actually helps a lot.

04-10 14:49:33.153 24013 24013 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference 04-10 14:49:33.153 24013 24013 E AndroidRuntime: at app.trigger.MainActivity.lambda$onTaskResult$1$MainActivity(MainActivity.java:341)

is this line: https://github.com/mwarning/trigger/blob/9002d37e564f9ccda1d5c5966a9020c23eb4d3ce/app/src/main/java/app/trigger/MainActivity.java#L341

After some seconds of searching it leads me here: https://stackoverflow.com/questions/62884286/toast-getview-returns-null-on-android-11-api-30

Which explains why it crashes.

mwarning commented 3 years ago

Please try https://github.com/mwarning/trigger/releases/tag/v3.2.2

StickyDigit commented 3 years ago

That gets it. I had to uninstall the f-droid one, so I assume the apk on git uses a different key.

I'll try it on my bigger phone with the old config loaded with pictures when I get home later.

mwarning commented 3 years ago

I lost my key and had to create a new one. :/

StickyDigit commented 3 years ago

Whoops! Yes, that works with my old config... images and all. But... I can't add new images. The file browser takes me to the directory where the images in my old config came from, they're still there, but no files show in the file selector. Perhaps I should cite that as a new issue?

mwarning commented 3 years ago

yes, that is a new issue. I suspect the file selector library that I use does not support Android 11. The file API changed has a lot.