Sobriety icon indicating copy to clipboard operation
Sobriety copied to clipboard

Cannot use on Huawei without Google

Open ghost opened this issue 2 years ago • 14 comments

Unfortunately, the App from F-Droid is not compatible with a Huawei P40 Lite E (cannot install).

Does it requires Google Services ? Is there any way to use it without Google services ?

Thanks for your great project and for using a GPLv3 License ! :)

ghost avatar Mar 25 '22 20:03 ghost

There's probably a Google library somewhere, I'll see if I can remove it.

KiARC avatar Mar 25 '22 22:03 KiARC

Looks like FloatingActionButtons are from a Google library... Still looking though.

KiARC avatar Mar 25 '22 22:03 KiARC

I've made a branch for this but I think this will end up being a long term goal

KiARC avatar Mar 25 '22 22:03 KiARC

Thanks for your hard work ! I would like to try your "Sobriety" someday. :D

ghost avatar Mar 25 '22 23:03 ghost

Yeah the issue is the use of components from com.google.android.material which isn't available on Huawei devices. It could be removed but it would present some design challenges. I'm curious as to whether ShadowJar could help here, it's possible that packing that library into the app (or at least the portions the app uses) could solve it, but I would need to look into the license on the library as well.

KiARC avatar May 05 '22 14:05 KiARC

For now HarmonyOS (a modified version of Android which Huawei devices run) should be considered unsupported, but I'm working on it.

KiARC avatar May 05 '22 14:05 KiARC

Looks like the licensing on com.google.android.material is Apache v2 so there's no legal issues. Shadowing might fix this which would be great.

KiARC avatar May 05 '22 14:05 KiARC

The one issue is I can't figure out how to properly shadow classes/packages in an APK.

KiARC avatar May 05 '22 14:05 KiARC

Unfortunately this is somewhat difficult and might not happen :/

KiARC avatar Sep 14 '22 12:09 KiARC

I would like to chime in a bit. So, I researched the phone Huawei P40 Lite E and I can see that it launched with Android 9 (and maybe has been updated to Android 10). Looking at the app's commit history, I came across a commit on Sep 14 that decreases the minimum Android version from Android 11 to Android 8. So, I came to the conclusion that when the issue was created (March 26), the app required Android 11 or later to run. That's why the author could not install the app.

unbiaseduser avatar Oct 17 '22 13:10 unbiaseduser

The thing is I believe the Google material library is not on Huawei either, and Sobriety has a FloatingActionButton. Maybe it isn't an issue, but I'm not confident in that.

KiARC avatar Oct 17 '22 13:10 KiARC

I'm 100% percent sure that Google material library, or any library not depending on Google services, will run on any Android variant. If you don't believe me then at least hear this out: I've been a dev for some 6 months or so, common sense tells me that the thing you're suspecting is not true. Android is Android, Google-less or not. Furthermore, if the system does not support some runtime dependencies, the app will crash at runtime, not throw a 'incompatible' error when installing.

unbiaseduser avatar Oct 17 '22 13:10 unbiaseduser

That all makes sense, thanks for informing me, this is my first mobile app so I'm not 100% familiar with the platform.

KiARC avatar Oct 17 '22 14:10 KiARC

Could anyone with a Huawei device test Sobriety and lmk if it works? The Java version was bumped down a lot since this was opened.

KiARC avatar Nov 11 '22 13:11 KiARC