Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow opening APKs with any app #127

Open
wants to merge 636 commits into
base: main
Choose a base branch
from

Conversation

updateing
Copy link

允许使用非 MIUI 自带的安装器,逻辑是跳过 hookChooseBestActivity 中的 intent.setPackage("com.miui.packageinstaller") 操作,直接返回原本的 ResolveInfo.

我在小米 13,MIUI 14.0.13 稳定版上测试通过,不管是否删除 com.miui.packageinstaller 这个包均可工作。但是要注意,如果不删除这个包的话,intent resolver 里面还是只有 MIUI 的安装器,而没有原生的 com.android.packageinstaller.

@@ -1137,4 +1137,6 @@
<string name="system_cc_enable_style_switch_title">开启控制中心样式切换</string>
<string name="system_cc_disable_bluetooth_restrict_title">禁用蓝牙临时关闭态</string>
<string name="system_cc_collapse_after_clicked_title">单击开关后自动收起</string>
<string name="various_anyinstaller_title">允许使用非MIUI的软件包安装器</string>
<string name="various_anyinstaller_sum">去除软件包安装intent中的安装器包名过滤条件。</string>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议这个描述尽量非技术化一点,或者这个描述直接去掉
sum最后一般不带标点,name一般以summ结尾

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我把标题改得更精确了一点,变成“去除对 APK 文件打开方式的限制”,因为单独只靠这一个开关无法让其他软件包安装器生效(效果只是能选择 APK Info 之类的程序来打开 APK 文件),必须得把 MIUI 安装器删掉才行。

但是大多数用户的需求应该还是更换安装器,所以我把上面这段话也写在 summary 里面了,结果 summary 就变得很长。请看一下现在 summary 的长度是否可以接受?

@MonwF
Copy link
Owner

MonwF commented Feb 19, 2023

choosebestactivity这里,需要判断intent的类型,看源码里面是有martket相关的。
另外非cn版本现在是直接允许其他安装器

@nakheel77
Copy link

nakheel77 commented Oct 5, 2023

Hi all, it is the best module for Miui. How to hide Airplane Mode icon on status bar. Many thanks!

MonwF and others added 16 commits October 5, 2023 13:14
* New translations strings.xml (Spanish)

* New translations strings.xml (Czech)

* New translations strings.xml (Japanese)

* New translations strings.xml (Polish)

* New translations strings.xml (Russian)

* New translations strings.xml (Turkish)

* New translations strings.xml (Chinese Traditional)

* New translations strings.xml (Vietnamese)

* New translations strings.xml (Portuguese, Brazilian)
@updateing
Copy link
Author

我又回来用 MIUI 了 :-/

我的意思是跳转应用市场时,有选择哪个market的判断。现在这样直接return,会影响其他intent类型的逻辑

现在在 HyperOS 上,这段代码是把所有的 mimarket 或 market scheme 的 intent 都强制跳转到小米应用商店。对于通用的 market scheme 来说,这也是一种劫持行为。这里应用 hook 之后,market scheme 会弹出应用市场的选择,mimarket 直接进入小米应用商店,我认为这样都是符合预期的。

@updateing updateing force-pushed the non-miui-installers branch 2 times, most recently from 8660680 to e9c89ac Compare November 18, 2023 05:02
允许使用非安装器的 app 打开 APK 文件。
@updateing updateing changed the title feat: allow usage of non-MIUI package installers feat: allow opening APKs with any app Nov 18, 2023
@updateing
Copy link
Author

updateing commented Nov 18, 2023

更正了 PR 标题和代码中的描述,现在是“允许非安装器 app 打开 APK 文件”了,不再提及默认安装器的事情,以免造成误解。后面会有专门提交修改默认安装器。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants