Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force close on Android version 8.1 #1

Open
ghost opened this issue Dec 30, 2017 · 9 comments
Open

Force close on Android version 8.1 #1

ghost opened this issue Dec 30, 2017 · 9 comments
Labels

Comments

@ghost
Copy link

ghost commented Dec 30, 2017

Tried app but it force close on:

Model: Nexus 5X
Android version: 8.1.0
Security patch level: December 5, 2017

Logcat:

8844-8844/? I/zygote64: Late-enabling -Xcheck:jni
8844-8862/com.veetaw.nospy D/OpenGLRenderer: HWUI GL Pipeline
8844-8844/com.veetaw.nospy W/Notification: Use of stream types is deprecated for operations other than volume control
8844-8844/com.veetaw.nospy W/Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
8844-8844/com.veetaw.nospy W/om.veetaw.nospy: type=1400 audit(0.0:1787): avc: denied { read } for name="devices" dev="proc" ino=4026545961 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc:s0 tclass=file permissive=0
8844-8844/com.veetaw.nospy D/AndroidRuntime: Shutting down VM
8844-8844/com.veetaw.nospy E/AndroidRuntime: FATAL EXCEPTION: main
                                                                Process: com.veetaw.nospy, PID: 8844
                                                                java.lang.RuntimeException: Unable to start service com.veetaw.nospy.service.Service@69e82db with Intent { cmp=com.veetaw.nospy/.service.Service }: java.io.FileNotFoundException: /proc/asound/devices (Permission denied)
                                                                    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3491)
                                                                    at android.app.ActivityThread.-wrap20(Unknown Source:0)
                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
                                                                    at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                    at android.os.Looper.loop(Looper.java:164)
                                                                    at android.app.ActivityThread.main(ActivityThread.java:6494)
                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
                                                                 Caused by: java.io.FileNotFoundException: /proc/asound/devices (Permission denied)
                                                                    at java.io.FileInputStream.open0(Native Method)
                                                                    at java.io.FileInputStream.open(FileInputStream.java:200)
                                                                    at java.io.FileInputStream.<init>(FileInputStream.java:150)
                                                                    at com.veetaw.nospy.util.Audio.getCard(Audio.kt:19)
                                                                    at com.veetaw.nospy.util.Audio.<init>(Audio.kt:10)
                                                                    at com.veetaw.nospy.util.ServiceThread.<init>(ServiceThread.kt:13)
                                                                    at com.veetaw.nospy.service.Service.onStartCommand(Service.kt:16)
                                                                    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3474)
                                                                    at android.app.ActivityThread.-wrap20(Unknown Source:0) 
                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692) 
                                                                    at android.os.Handler.dispatchMessage(Handler.java:106) 
                                                                    at android.os.Looper.loop(Looper.java:164) 
                                                                    at android.app.ActivityThread.main(ActivityThread.java:6494) 
                                                                    at java.lang.reflect.Method.invoke(Native Method) 
                                                                    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
@simonesestito
Copy link

It looks like access to /proc/asound/devices is forbidden without root on Oreo 8.1

I've tested it on my Nexus 5X running 8.1 too using Termux:

$ ls /proc/asound/
ls: /proc/asound/pcm: Permission denied
ls: /proc/asound/timers: Permission denied
ls: /proc/asound/hwdep: Permission denied
ls: /proc/asound/cards: Permission denied
ls: /proc/asound/devices: Permission denied
ls: /proc/asound/version: Permission denied
card0            msm8994tomtomsn
$ cat /proc/asound/devices
cat: can't open '/proc/asound/devices': Permission denied

@veetaw
Copy link
Owner

veetaw commented Dec 30, 2017

looks like that with android 8.1 /proc/asound/devices is not readable without root. I need to use another way to check for mic availability. (maybe with AudioRecord requesting the mic)

thanks for the issue!

@veetaw veetaw added the bug label Dec 30, 2017
@veetaw
Copy link
Owner

veetaw commented Dec 30, 2017

@simonesestito 👍

@simonesestito
Copy link

My friend with OnePlus 5, Oreo 8.0 and Oxygen OS did a test right now.
Without root, on 8.0 doesn't work too. But with root permission, that file can be read with no problems.

So this "issue" is present on both 8.0 and 8.1

@veetaw
Copy link
Owner

veetaw commented Dec 31, 2017

@simonesestito but using root is unsecure, so I won't support it. I can easily request the microphone and check if it's used.

@ghost
Copy link
Author

ghost commented Dec 31, 2017

Agree with @veetaw that it is best to keep it simple as it is now and support only factory stock devices

@veetaw
Copy link
Owner

veetaw commented Jan 30, 2018

I think that there isn't a good way to check for mic availability that is not the one I've already used. So, should I disable the microphone feature for android O users ? :/

btw, sorry for the delay

@ghost
Copy link
Author

ghost commented Jan 30, 2018

Do you think as an alternative for 8.x users, it can be done via WRITE_SECURE_SETTINGS?

@veetaw
Copy link
Owner

veetaw commented Jan 31, 2018

I'll check better, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants