Android5.1去掉锁屏

参考:https://blog.csdn.net/lcpangs/article/details/52243438

修改默认锁屏

修改设置里面的默认参数
路径:frameworks\base\packages\SettingsProvider\res\values\defaults.xml
def_lockscreen_disabled 改为 true
<bool name="def_lockscreen_disabled">true</bool>

1
2
rm out/target/product/xxx/system/framework/framework.jar
rm out/target/product/xxx/system/priv-app/SettingsProvider/SettingsProvider.apk

修改完重新编译mm ,再恢复出厂设置
或者重新编译源码

如果不起效果,可以在mk文件(最好的在device/xxx下面)加上PRODUCT_PROPERTY_OVERRIDES += ro.lockscreen.disable.default=true
编译完后,查看out/target/product/XXXX/system/build.prop,是否添加成功

去除设置里面的其他锁屏选项

packages\apps\settings\res\xml\Security_settings_picker.xml
注释掉其他选项即可:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    <PreferenceScreen
android:key="unlock_set_off"
android:title="@string/unlock_set_unlock_off_title"
android:persistent="false"/>

<!--
<PreferenceScreen
android:key="unlock_set_none"
android:title="@string/unlock_set_unlock_none_title"
android:persistent="false"/>

<PreferenceScreen
android:key="unlock_set_biometric_weak"
android:title="@string/unlock_set_unlock_biometric_weak_title"
android:persistent="false"/>

<PreferenceScreen
android:key="unlock_set_voice_weak"
android:title="@string/unlock_set_unlock_mode_voice_weak"
android:persistent="false"/>

<PreferenceScreen
android:key="unlock_set_pattern"
android:title="@string/unlock_set_unlock_pattern_title"
android:persistent="false"/>

<PreferenceScreen
android:key="unlock_set_pin"
android:title="@string/unlock_set_unlock_pin_title"
android:persistent="false"/>

<PreferenceScreen
android:key="unlock_set_password"
android:title="@string/unlock_set_unlock_password_title"
android:persistent="false"/>
-->

去掉以前的锁屏密码:

1
2
3
4
#PIN码:
busybox rm -rf /data/system/password.key
#图案密码:
busybox rm -rf /data/system/gesture.key