PieLauncher icon indicating copy to clipboard operation
PieLauncher copied to clipboard

Apps with changed icon color won't launch

Open Yquas opened this issue 1 year ago • 14 comments

Some apps like "Tasks.org", "Simple Contacts" or "Simple Calendar" give users the ability to change the color of the app's icon in settings. Pie launcher can only launch these apps if their icon color is kept on the default color, or else it will only play the launch animation but won't launch the app, forcing one to launch these apps in some other way.

Yquas avatar Jul 28 '24 13:07 Yquas

Thanks a lot for reporting! 👍 I wasn't aware of this bug.

markusfisch avatar Jul 28 '24 15:07 markusfisch

Hm, somehow I cannot reproduce this bug 🤔 I tried Tasks.org, changed the launcher icon color in the settings and was able to launch the app as before. I could not try Simple Contacts or Calendar as the feature is behind a pay wall there.

Can you please confirm that Tasks.org does not work on your device with a different icon color?

markusfisch avatar Jul 30 '24 10:07 markusfisch

I have multiple Fossify Apps (fork of Simple Apps) installed and have custom color set to every one of them and I can launch the apps without problem (from pie menu and from apps menu as well...)

chesio avatar Jul 30 '24 10:07 chesio

Okay, if it works for both of you then the problem could be my device - it runs MIUI 11 / Android 10.

I get both "Tasks.org" and "Simple Mobile Tools" from F-Droid. After seeing your comments I also tested "Fossify Apps" from both the Play Store and from F-Droid but they all behave in exactly the same way: On the default icon color all apps launch, when changed to a non-default color only the launch animation plays, and when changed back to the default color all apps launch again.

Is there any way for me to give you some kind of technical bug report? I don't know what else would help when you can't reproduce the bug.

Yquas avatar Aug 04 '24 08:08 Yquas

Well, you could check the device logs when this is happening with logcat, if you have the adb command line tool (from the Android SDK, then read here how to check the logs) or Android Studio installed (then follow this guide). Hopefully there's an error message when launching an affected app fails.

Then, if you like, and if you're curious enough, you could also clone this repository and build and run the app from source on your device with Android Studio. It's really quite easy to do. Check this YouTube guide for example. The app is built and installed in a debug version so it can be easily installed beside the production app.

Then, this code snippet launches apps in Pie Launcher. You could remove the try/catch block to see (in the logs) if there are any exceptions (which would crash the app).

markusfisch avatar Aug 04 '24 13:08 markusfisch

I have the same problem with com.textra. I tried what you said, and there is no exception thrown by the snippet you given. However, if I put startMainActivity out of the if (lm.isActivityEnabled(icon.componentName, icon.userHandle)), the app launches just fine.

Sergueille avatar Mar 22 '25 20:03 Sergueille

And here is more info:

  • icon.componentName.toString() is ComponentInfo{com.textra/com.mplus.lib.Main_ff2e7d32} (looks strange?),
  • icon.componentName.getPackageName() is com.textra
  • icon.userHandle.toString() is UserHandle{0}

Sergueille avatar Mar 22 '25 20:03 Sergueille

Hello again @markusfisch, I think I have a clue what causes the bug. It seems that this check doesn't pass when it should, because icon.componentName is not the expected value due to the changed color of the app. However, if I replace isActivityEnabled with isPackageEnabled, the app is launched, but I can't test completely if it works as intended because my device doesn't support multiple user profiles.

Sergueille avatar Jun 28 '25 08:06 Sergueille

@Sergueille Good catch! This may indeed be the reason! I'm currently reworking this section.

markusfisch avatar Jun 29 '25 13:06 markusfisch

Fixed in https://github.com/markusfisch/PieLauncher/commit/f592a224f3ba340c00eb7f8fd1bfcba6065ac16e

Version 1.23.6 is on it's way through Google Play and should become available shortly.

markusfisch avatar Jun 30 '25 18:06 markusfisch

I tested it on 1.23.6, and it still doesn't work (tested with Textra and Fossify Keyboard). For both apps I now see the toast that says "Activity not enabled". I'll try to investigate further tomorrow...

Sergueille avatar Jul 04 '25 18:07 Sergueille

Sorry that it didn't work, and thanks a lot for reporting that the bug still exists. Very much appreciated!

At least the new Activity not enabled message helps to narrow the problem down.

markusfisch avatar Jul 04 '25 22:07 markusfisch

When the color is changed, icon.componentName looks like "app.mainActivity.color", and the only activity returned by launcherApps.getActivityList is this activity. Then, launcherApps.isActivityEnabled returns false and the toast is shown.

I don't quite understand why these check are being made, would it be more reliable to instead launch the activity directly and then catch exceptions?

Sergueille avatar Jul 05 '25 08:07 Sergueille

Good point! Currently isActivityEnabled is used to find an enabled activity if the original one got disabled. But that doesn't seem to work as expected, so catching the exception may also be a good approach. Will try.

markusfisch avatar Jul 05 '25 09:07 markusfisch