背景

  • Platform: IMX6Q
  • OS: Android5.1
  • Kernel: 3.14.52

修改默认锁屏

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

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
注释掉其他选项即可:

    <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"/>  
-->

去掉以前的锁屏密码:

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

参考:

  1. https://blog.csdn.net/lcpangs/article/details/52243438