ImranR98 / Obtainium

Get Android app updates straight from the source.
https://obtainium.imranr.dev
GNU General Public License v3.0
7.7k stars 172 forks source link

[Feature Request]: Adaptive/Themed Icon for A12.1 #345

Closed rcarteraz closed 1 year ago

rcarteraz commented 1 year ago

Curious... I have an Oneplus Nord N200 that I'm running a LineageOS fork called LMODroid that's based on A12.1. The rom supports themed icons, like A13 has. Interestingly, I installed Bitwarden on it and unlike Obtainium, it immediately changed to match the theme when added to the home screen. Researching this a little further, as It'd be nice to have this functionality for Obtainium too (on A12.1, as I know it's supported on A13 as I have it on my Pixel). Taking a look at Bitwarden's setup, and there's a couple difference from Obtainium, which you can see here.

So, as I started this, I'm curious.. Is this something that might be possible to implement for Obtainium? Low priority of course.

ImranR98 commented 1 year ago

I don't see any obvious reason it wouldn't work, but tried adding an optional file like Bitwarden has. Try this APK and let me know how it goes: app-x86_64-release.zip app-release.zip app-arm64-v8a-release.zip app-armeabi-v7a-release.zip

The only other difference I see is that Bitwarden uses vector shapes in an XML file instead of PNG images. If that's the cause, it's not worth supporting as I have no clue how to convert the existing icon (esp. since it isn't just a shape). Especially since this works on Android 13 (so we know LMO's implementation isn't 100% identical to the official one).

rcarteraz commented 1 year ago

Bummer, looks like it might have something to do with the vector shapes as this app does not change the icon to match the theme once installed.

It looks like Android Studio can create the vector asset but only from an SVG and not png. Thanks for trying though!

ImranR98 commented 1 year ago

Took a bit of messing around in Inkscape, but logos/icons are "supposed" to be vectors anyways and this will reduce duplicate images. Hopefully it works now, if not I'm out of ideas: [link removed]

Edit: Whoops. That release has an issue. Removed it, will post another one.

ImranR98 commented 1 year ago

https://github.com/ImranR98/Obtainium/releases/tag/v0.11.7-beta

ImranR98 commented 1 year ago

I'm going to assume this worked and close the issue. Let me know if it didn't so I can close as not planned instead.

rcarteraz commented 1 year ago

I'm going to assume this worked and close the issue. Let me know if it didn't so I can close as not planned instead.

Sorry, didn't have an opportunity to test until just now. Unfortunately, it did not work. I think because <monochrome android:drawable="@drawable/ic_launcher_monochrome"/> references a file a named ic_launcher_monochrome.xml according to the developer docs. But it looks like you have it reference the regular file ic_launcher_foreground.xml as seen here <monochrome android:drawable="@drawable/ic_launcher_foreground"/>

As best as I can tell you need an icon with a transparent background with the icon itself in black. Similiar to this

Screenshot 2023-03-06 at 11 13 46 AM

This video is in French, but it seems to confirm this towards the end. https://www.youtube.com/watch?v=g3wPdINcw_k

I know that's a lot of additional work so I understand if you'd rather close as not planned since it currently works as expected in 13. I appreciate all you've done so far!