aistra0528 / Hail

Disable / Hide / Suspend / Uninstall Android apps without root.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] 图标包功能有问题 The icon pack feature issues

vozeo opened this issue · comments

在使用图标包功能时,遇到了以下两个问题:

  1. 图标包切换时,只能改变当前未在冻结状态下的图标,冻结状态下的图标则仍然是原始图标。也就是说,如果需要切换全部应用的图标,需要全部解冻——更换图标包——全部冻结才能更换。希望能在冻结状态下改变图标包。

  2. 图标包更换之后,会不定期地所有的图标全都变成默认图标,此时需要重新全部解冻切回默认图标之后再切回图标包才能正常显示图标包。频率大概在每天1-3次,经常是比较长时间的熄屏之后发生这种情况。

手机型号:realme GT 5 Pro
系统:Android 14
软件版本:1.8.0 (31)

期待您的回复!

When using the icon pack feature, I encountered the following two issues:

  1. When switching icon packs, only the icons that are currently unfrozen can be changed, while the icons that are frozen remain as the original icons. This means that if I need to switch all application icons, I have to unfreeze all, change the icon pack, and then freeze all again to make the change. I hope to be able to change the icon pack while the icons are frozen.

  2. After changing the icon pack, periodically, all icons will randomly revert to the default icons. In this case, I need to unfreeze all, switch back to default icons, and then switch back to the icon pack to display the icons normally again. This happens approximately 1-3 times a day, often occurring after the screen has been off for a long time.

Phone model: realme GT 5 Pro
Operating System: Android 14
Software Version: 1.8.0 (31)

Looking forward to your response!

感谢你的反馈!
因为图标包功能目前通过启动活动名称获取图标包图标:

if (parser.eventType == XmlResourceParser.START_TAG && parser.getAttributeValue(
0
) == componentName
) {
return parser.getAttributeValue(1)
}

而冻结状态下无法获取应用的启动活动,所以会回退使用默认图标。
val componentName = app.packageManager.getLaunchIntentForPackage(packageName)
?.run { resolveActivity(app.packageManager).toString() } ?: return null

感谢你的反馈! 因为图标包功能目前通过启动活动名称获取图标包图标:

if (parser.eventType == XmlResourceParser.START_TAG && parser.getAttributeValue(
0
) == componentName
) {
return parser.getAttributeValue(1)
}

而冻结状态下无法获取应用的启动活动,所以会回退使用默认图标。

val componentName = app.packageManager.getLaunchIntentForPackage(packageName)
?.run { resolveActivity(app.packageManager).toString() } ?: return null

非常感谢您的回答!

对于我反馈的第二个问题,看到您代码中 AppIconCache 缓存了应用的信息,包括图标信息。在程序关闭之后,之前的缓存会丢失,而在冻结状态又无法获取图标包图标,因此会导致图标包变回默认的情况。

想请教您这种情况应该如何解决?对于应用而言,大部分应用安装好之后都长期不发生变化,仅在少数情况下会改变缓存,将缓存直接持久化保存在本地是否可行?或者还有其他的解决方案?

我不是专业的 Android 开发者,恳请赐教。

现在图标包功能仅通过包名获取图标。对于大部分一个应用只适配一个主要活动的图标包来说应该够用了。