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

Does nothing. #4

Open
goldencut opened this issue Aug 19, 2016 · 11 comments
Open

Does nothing. #4

goldencut opened this issue Aug 19, 2016 · 11 comments

Comments

@goldencut
Copy link

Set enabled, go to home screen, nothing changed. Huawei Honor 4C, Android 4.4.2.

@renyuneyun
Copy link
Owner

Hi,

Which version are you using? 0.4.2 or 0.4.1?
Could you please test both versions? There is a change in permission checks on v0.4.2. I'm not sure if it's the cause.

And... of course, have you granted the app with the two permissions? They are: Camera permission and Draw Over Other Apps permission (Overlay permission).
Maybe only Camera permission is alterable on Android 4.4, so you might only need to check this one

@goldencut
Copy link
Author

Tried both versions. My phone is not rooted, pretty stock, few programs. On installing from F-Droid I was told about the permissions required, I assume they were also granted. I had no idea I could deny some permissions, I thought I can just not install the app. Maybe I use the app wrong - I tap on app icon, set 'enabled', then go back or minimize the app. All looks the same.

@renyuneyun
Copy link
Owner

Yes, you did the right thing to activiate it...

I found a Huawei Honor 3C H30-L01 (not 4C. but if my conclusion is correct, this doesn't matter), and tried some tests, and also did some searches. I'll explain what I did and what I found here. (If you want to see the conclusion directly, just scroll to the buttom)

First of all, I noticed that logcat never wrote any logs I expected, including those defined in the app's source codes. However, when I switched to another device (OnePlus X), it worked as expected.
What logcat complains is that some codes uses virtual methods which can't be resolved.

08-25 19:36:44.580 2603-2603/ryey.camcov I/dalvikvm-heap: Grow heap (frag case) to 4.794MB for 1127536-byte allocation 08-25 19:36:44.620 2603-2603/ryey.camcov I/dalvikvm: Could not find method android.content.Context.getSystemService, referenced from method ryey.camcov.OverlayService.access$super 08-25 19:36:44.620 2603-2603/ryey.camcov W/dalvikvm: VFY: unable to resolve virtual method 375: Landroid/content/Context;.getSystemService (Ljava/lang/Class;)Ljava/lang/Object; 08-25 19:36:44.630 2603-2603/ryey.camcov I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method ryey.camcov.OverlayService.access$super 08-25 19:36:44.630 2603-2603/ryey.camcov W/dalvikvm: VFY: unable to resolve virtual method 371: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList; 08-25 19:36:44.630 2603-2603/ryey.camcov I/dalvikvm: Could not find method android.content.ContextWrapper.getCodeCacheDir, referenced from method ryey.camcov.OverlayService.access$super 08-25 19:36:44.630 2603-2603/ryey.camcov W/dalvikvm: VFY: unable to resolve virtual method 417: Landroid/content/ContextWrapper;.getCodeCacheDir ()Ljava/io/File; 08-25 19:36:44.630 2603-2603/ryey.camcov I/dalvikvm: Could not find method android.content.ContextWrapper.getNoBackupFilesDir, referenced from method ryey.camcov.OverlayService.access$super 08-25 19:36:44.630 2603-2603/ryey.camcov W/dalvikvm: VFY: unable to resolve virtual method 429: Landroid/content/ContextWrapper;.getNoBackupFilesDir ()Ljava/io/File; 08-25 19:36:44.630 2603-2603/ryey.camcov I/dalvikvm: Could not find method android.content.Context.getDrawable, referenced from method ryey.camcov.OverlayService.access$super 08-25 19:36:44.630 2603-2603/ryey.camcov W/dalvikvm: VFY: unable to resolve virtual method 372: Landroid/content/Context;.getDrawable (I)Landroid/graphics/drawable/Drawable; 08-25 19:36:44.630 2603-2603/ryey.camcov I/dalvikvm: Could not find method android.content.ContextWrapper.getSystemServiceName, referenced from method ryey.camcov.OverlayService.access$super 08-25 19:36:44.630 2603-2603/ryey.camcov W/dalvikvm: VFY: unable to resolve virtual method 439: Landroid/content/ContextWrapper;.getSystemServiceName (Ljava/lang/Class;)Ljava/lang/String; 08-25 19:36:44.630 2603-2603/ryey.camcov I/dalvikvm: Could not find method android.content.ContextWrapper.getExternalMediaDirs, referenced from method ryey.camcov.OverlayService.access$super 08-25 19:36:44.630 2603-2603/ryey.camcov W/dalvikvm: VFY: unable to resolve virtual method 425: Landroid/content/ContextWrapper;.getExternalMediaDirs ()[Ljava/io/File; 08-25 19:36:44.630 2603-2603/ryey.camcov I/dalvikvm: Could not find method android.content.Context.getColor, referenced from method ryey.camcov.OverlayService.access$super 08-25 19:36:44.630 2603-2603/ryey.camcov W/dalvikvm: VFY: unable to resolve virtual method 370: Landroid/content/Context;.getColor (I)I 08-25 19:36:44.630 2603-2603/ryey.camcov I/dalvikvm: Could not find method android.content.ContextWrapper.checkSelfPermission, referenced from method ryey.camcov.OverlayService.access$super 08-25 19:36:44.630 2603-2603/ryey.camcov W/dalvikvm: VFY: unable to resolve virtual method 393: Landroid/content/ContextWrapper;.checkSelfPermission (Ljava/lang/String;)I

I have no idea why this happens.

And also, there is another interesting part:
08-25 19:36:44.670 2603-2603/ryey.camcov W/linker: library "libmaliinstr.so" not found 08-25 19:36:44.670 2603-2603/ryey.camcov W/linker: error:

'.so' represents 'shared object' on linux (dlls on windows has similar functions), and android is based on linux. 'lib' is a common prefix for libraries. I guess 'maliinstr' means: 'mali instructions' as Mali is a GPU vendor.
Therefore, this means an important library related to GPU is missing.

The third interesting part is:
08-25 19:56:30.830 2603-2603/ryey.camcov W/dalvikvm: VFY: unable to resolve virtual method 739: Landroid/view/View;.getForegroundTintMode ()Landroid/graphics/PorterDuff$Mode; 08-25 19:56:30.840 2603-2603/ryey.camcov W/TextureView: A TextureView or a subclass can only be used with hardware acceleration enabled.
This says that hardware acceleration is not enabled. I tried adding android:hardwareAccelerated="true" to manifest (according to https://developer.android.com/guide/topics/graphics/hardware-accel.html) and also forced enabling hardware acceleration in developer settings, but the problem is still the same.
Combining with the 2nd problem, the libmaliinstr.so seems to be related to hardware acceleration (hardware acceleration means using GPU to compute rather than CPU). The library is missing, so everything related to hardware acceleration is broken.

--Conclusion--
Sorry, it's bad news. There seems to be no way to simply fix this issue. CamCov needs TextureView to function, and TextureView needs hardware acceleration. However, a system library related to hardware acceleration (libmaliinstr.so) is missing on some devices. This library seems to be related to Mali GPUs, and Honor 3C and Honor 4C are both equiped with Mali GPU. A question on StackOverflow pointed out that some Huawei and Xiaomi devices have this issue.
I guess a custom ROM with this library inside might solve this problem. (but not sure)
Maybe copying that library to your phone (if you have root premission) could also solve the problem. (still not sure)

@goldencut
Copy link
Author

Wow, mindblowing research, mostly above my understanding. One possible solution on SO was: "skip this device and ignore the error". Could it be so simple? I have run 3D games and apps which suggests some level of 3D support from my device. Would you know any apps to test the 3D support?

@renyuneyun
Copy link
Owner

Sorry for the long delay... I didn't notice the notification...

I have no idea how to test this. Maybe you can try CPU-Z (I've found it in Google Play). You can view your GPU and the supported openGL version. I'm not sure if these info could help, because android docs never said anything about OpenGL versions for those I used in CamCov. (Correct me if I'm wrong.) But those things did (indirectly) use OpenGL and hardware acceleration is related to OpenGL (or should I say OpenGL is related to hardware acceleration?).

As for the "skip this device and ignore the error" thing, I'm afraid this is what I intended to do...
For some big companies, this sincerely can't be this simple. I bet they will try to manually implement some system-level functions and workaround/solve this problem (so that users won't blame or complain about this, even though it's the manufacturer's fault rather than the app developer's fault).
However, I'm not such a company. I'm still a student. I am aware how disappointed people will be when they found some apps can't run on their device, but I really don't have such time to solve this... (But I will be happy to solve it if someone told me that there was a direct solution somewhere on the web and gave me a link.)
For me, the only reasonable solution is to ignore it... as this app is developed for interest, and it works pretty well on my device (and some other friends' devices).

So I still suggest you to try another ROM... Yes this might still not solve the problem, but

  1. if you have never flushed any ROMs yet, at least you could gain experience about how to flush a custom ROM on you phone :)
  2. if you have such experience, you'll know how easy it is and it won't cost much time. what if it really can solve this?

@goldencut
Copy link
Author

CPU-Z output:
screenshot_2016-10-01-01-36-22
screenshot_2016-10-01-01-35-53

@renyuneyun
Copy link
Owner

renyuneyun commented Oct 1, 2016

Oh, so you are running a custom ROM with HTC Sense? (Or Huawei changed its UI style)

Anyway, It says your phone supports OpenGL ES 2.0 which is correct regarding your GPU. GLES means GL for Embeded Systems (e.g. cellphones).
I'm not good at graphics coding, neither do I know which version of GL api will be used by those companies. But at least I know the higher the api version is, the fewer people meet the requirement. So I think it's reasonable that they still use 1.x or 2.0.

I've found some words in a Chinese question-answer community (link). A person said that this error report doesn't really matter. Software should work correctly even though this error appears.
So I re-checked my code and error log (I am unable to get a Honor 3C now, so the only resource is my previous logs), and noticed that by the end of the first chunk of logs, logcat blames that I was trying to use a virtual (meaning not-current-exist) method called checkSelfPermission().
This method was designed only to be called under Android Api >= 23 (Android 6.0), but due to unknown reasons it was also called in the Android 4.4 device.

This method was added on version 0.4, so you might try v0.3 and v0.3.1 to see if it is the case.
Since v0.3 and v0.3.1 are not in F-Droid, I've generated them and uploaded them to bintray. See:
https://bintray.com/renyuneyun/Android/CamCov#files or
https://dl.bintray.com/renyuneyun/Android/

@goldencut
Copy link
Author

AFAIK, no - it's Huawei Honor 4C, bought from Philippines in summer 2015, with stock ROM, no OS updates. UI is Huawei's default - EMUI 3.0.
I tried older versions of CC but with no luck, so I guess no CamCov for me :(
PS. I noticed that CC allows me to set alpha=3, but then errors out, and can be only started again if app's cache is cleaned (with phone's Settings app).

@renyuneyun
Copy link
Owner

Sorry that doesn't work...

In earlier versions of CamCov, I forgot to control the min&mav value of alpha. This has been fixed in latter versions. (Anything greater than 1 would be set to 1 at the time of saving)

@goldencut
Copy link
Author

Maybe CC just doesn't get along with my phone - I used the latest (0.42) from F-Droid and it allowed me to enter alpha=3, then errors out ("Unfortunately application X has stopped..."), then it gave the same error every time I tried to start it unless I cleared the app's cache/data (ie reset the app to defaults).

@renyuneyun
Copy link
Owner

It's wierd...
I also reproduced the error...

Can you open another issue for this problem?

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

No branches or pull requests

2 participants