TrianguloY / LightningLauncher

More than a simple Android launcher, Lightning is a fast, light and extremely customizable tool to build the perfect home screen. To build your home screen.
https://www.lightninglauncher.com/
MIT License
40 stars 4 forks source link

Some widgets don't work #27

Open lexelby opened 6 months ago

lexelby commented 6 months ago

I installed the patched version and it seems to mostly work. The only thing I've found that doesn't work is that some apps' widgets won't show up. Two examples are Aqua Mail and Venmo.

lexelby commented 6 months ago

From logcat:

04-02 11:49:51.495  2052  6214 W ActivityTaskManager: Permission Denial: starting Intent { act=android.appwidget.action.APPWIDGET_CONFIGURE cmp=org.kman.AquaMail/.widget.ListWidgetConfigActivity (has extras) mCallingUid=10296 } from ProcessRecord{9c50bd8 27602:net.pierrox.lightning_launcher_extreme/u0a296} (pid=27602, uid=10296) not exported from uid 10337
TrianguloY commented 6 months ago

Were they working with the original 14.3 version? (I don't think so, but just to confirm)

That issue is due to an android change in the widget configuration. Widgets that are not exported will not work on launchers targeting older apis (like the patched version). The debug version should work (since it targets newer apis) but the patched unfortunately will not (unless the app itself "fixes" it).

You can find a bit more info here: https://github.com/home-assistant/android/issues/2064

lexelby commented 6 months ago

Original 14.3 from the play store did work. I'll try the debug one, thanks!

lexelby commented 6 months ago

@TrianguloY I'm afraid the debug version still can't create an AquaMail widget :(

And indeed, I restored my old version of 14.3 (not patched) and it can't create the widget either. I definitely had a functioning widget on 14.3 right up until I uninstalled it to install the patched version. I can only assume that the widget continued to work because it had been there since before this restriction applied. I even tried downgrading AquaMail's version, to no avail.

Do I need to give up on my dream of having a functioning widget? Do you have any ideas? My phone is rooted, if that helps.

I'm happy to help by testing, providing logcats, etc. I'm afraid I'm not an Android dev though.

TrianguloY commented 6 months ago

@TrianguloY I'm afraid the debug version still can't create an AquaMail widget :(

Really? That's strange. I had this bug in the past with an app that was also updated and set the exported to false, blocking new widgets. I remember doing some tests, but I removed the app for other reasons and I don't remember finding a workaround. I've always assumed that it was due to the old api, but the debug version targets the latest so...

Is it possible for you to try a couple other launchers (other than the device default one) just to check if it's a configuration issue or generalized to non-system launchers.

The best fix would be for AquaMail to replace the exported=false to exported=true, but unless they have some sort of support...

With root you should be able to fix it...but unfortunately I don't know how. Maybe if you install LL as a system app? Maybe you have a way to change the exportability of arbitrary apps?

lexelby commented 6 months ago

I did try it with another launcher (Total Launcher) and it worked fine...

I'll try reaching out to the Aqua Mail dev. Maybe they can help.

lexelby commented 5 months ago

Finally figured out how to do it. You can use apktool to unpack the apk, and then you can edit the manifest. Setting the activity that handles APPWIDGET_CONFIGURE to exported=true makes it so lightning can add the widget. Then repack earth apktool, zipalign, sign, and install.

App Cloner with the Manifest Editor add-on can simplify all this.

TrianguloY commented 5 months ago

That means patching other apks (which may not be possible in some cases) but I'm happy to hear it solved it for you.

Still, I'm going to keep this open, since the bug still persist (still don't know why other launchers can access a 'private' service...)

lexelby commented 5 months ago

I saw this in the manifest, and it was exported already:

<service android:exported="true" android:label="@string/list_widget_name_short" android:name="org.kman.AquaMail.widget.ListWidget_hc$WidgetService" android:permission="android.permiss
ion.BIND_REMOTEVIEWS"/>

Maybe this is some new way of doing it? I suppose the hc could stand for honeycomb, and lightning is doing things in a truly ancient way or something?