Android 8.0以下
临时允许
设置
adb shell settings put secure install_non_market_apps 1
查看
adb shell settings get secure install_non_market_apps
可以获取状态
0为关闭,1为开启
永久打开
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index dc8532ff..9f5e3ac7 100644
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -38,7 +38,7 @@
<bool name="def_bluetooth_on">true</bool>
<bool name="def_wifi_display_on">false</bool>
- <bool name="def_install_non_market_apps">false</bool>
+ <bool name="def_install_non_market_apps">true</bool>
<bool name="def_package_verifier_enable">true</bool>
<!-- Comma-separated list of location providers.
Network location is off by default because it requires
Android 8.0以上
取消了永久授权,需要自APK自己申请相关权限.
可以参考:
//www.greatytc.com/p/baa13455cd79