1. 首页
  2. 安卓手机忘记密码了怎么解锁(Android 添加找回锁屏密码的暗门)

安卓手机忘记密码了怎么解锁(Android 添加找回锁屏密码的暗门)

简介:关于安卓手机忘记密码了怎么解锁(Android 添加找回锁屏密码的暗门)的相关疑问,相信很多朋友对此并不是非常清楚,为了帮助大家了解相关知识要点,小编为大家整理出如下讲解内容,希望下面的内容对大家有帮助!
如果有更好的建议或者想看更多关于技术大全及相关资讯,可以多多关注茶馆百科网。

由于有些设备在用户手中,他们自己设置了锁屏密码,但如果长时间不使用设备,用户很容易忘记自己的原始密码。

在这种情况下,你必须强制恢复出厂设置。但这将导致所有用户数据的丢失。所以我们在锁屏界面做了一个暗门来找回锁屏密码。

暗门操作:

1. 点击锁屏图标10次。密码显示在锁屏图标下方。

2. 或者在密码输入界面轻按锁屏图标10次。密码显示在锁屏图标下方。

其中“666888”为显示的密码

实现:

1. 在锁屏图标下添加一个textview来显示密码

frameworks/base/packages/SystemUI/res/layout/super_notification_shade.xml

@@-92,5 +92,14 @@android:singleLine='true' android:ellipsize='marquee' android:focusable='true' /+ TextView+ android:id='@+id/lock_pwd'+ android:layout_width='wrap_content'+ android:layout_height='wrap_content'+ android:textColor='#FFFFFFFF'+ android:gravity='center'+ android:singleLine='true'+ android:ellipsize='marquee'+ android:focusable='true'//LinearLayout /com.android.systemui.statusbar.phone。NotificationShadeWindowView 2。当用户首次或重置密码时,将当前密码保存到自定义系统属性。在textview中只用于get。

frameworks/base/services/core/java/com/android/server/locksettings/LockSettingsService.java

进口com.android.internal.annotations.GuardedBy;@@-1629,6 +1630,10 @@公共类LockSettingsService扩展ILockSettings。存根notifySeparateProfileChallengeChanged (userId);scheduleGc ();+ String pwd=new String(credential.getCredential());+ int type=credential.getStorageCryptType();+ SystemProperties.set (persist.sys.password, pwd);返回true;} 3。连续点击锁屏图标10次,显示密码。

frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java

import java.util.Optional; import java.util.concurrent.Executor;+import android.widget.LinearLayout;+import android.widget.TextView; import javax.inject.Named; import javax.inject.Provider;@@ -383,6 +385,10 @@ public class StatusBar extends SystemUI implements DemoMode, DozeServiceHost mDozeServiceHost; private boolean mWakeUpComingFromTouch; private PointF mWakeUpTouchLocation;+ private LinearLayout mLockContainer;+ private TextView mLockPwd;+ private int clickCount=0;+ private long lastTime=0; private final Object mQueueLock=new Object(); @@ -1212,6 +1218,9 @@ public class StatusBar extends SystemUI implements DemoMode, inflateStatusBarWindow(); mNotificationShadeWindowViewController.setService(this, mNotificationShadeWindowController); mNotificationShadeWindowView.setOnTouchListener(getStatusBarWindowTouchListener());+ mLockContainer=mNotificationShadeWindowView.findViewById(R.id.lock_icon_container);+ mLockContainer.setOnTouchListener(getLockIcomWindowTouchListener());+ mLockPwd=mLockContainer.findViewById(R.id.lock_pwd); //TODO: Deal with the ugliness that comes from having some of the statusbar broken out //into fragments, but the rest here, it leaves some awkward lifecycle and whatnot.@@ -1622,6 +1631,28 @@ public class StatusBar extends SystemUI implements DemoMode, return mNotificationShadeWindowView.onTouchEvent(event); }; }+ + protected View.OnTouchListener getLockIcomWindowTouchListener()else+ if(clickCount==10), 2000);+ }+ lastTime=newTime;+ }+ return true;+ };+ } private void inflateShelf() { mNotificationShelf=mSuperStatusBarViewFactory.getNotificationShelf(mStackScroller);

本文主要介绍了关于安卓手机忘记密码了怎么解锁(Android 添加找回锁屏密码的暗门)的相关养殖或种植技术,栏目还介绍了该行业生产经营方式及经营管理,关注发展动向,注重系统性、科学性、实用性和先进性,内容全面新颖、重点突出、通俗易懂,全面给您讲解技术怎么管理的要点,是您致富的点金石。
以上文章来自互联网,不代表本人立场,如需删除,请注明该网址:http://23.234.50.4:8411/article/1599566.html