本文介绍了在Android应用程序使用系统密码对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写这就像下述的应用程序。

I am trying to write an application which works like described below.

  • 当用户启动应用程序,如果用户已经注册的身份识别他的设备就可以了检查。
  • 如果用户已注册的身份识别,应用程序必须显示按钮继续PIN。
  • 当按钮用户preSS继续PIN系统标准PIN对话必须出现。
  • 在用户输入其PIN及preSS继续按钮。
  • 系统后必须检查,如果输入的PIN是正确的或不继续工作。
  • When user start application it check if user have registered PIN on his device.
  • If user have registered PIN, application must show button "Continue with PIN".
  • When user press on button "Continue with PIN" system standard PIN dialog must appears.
  • User enter his PIN and press "Continue" button.
  • After System must check if entered PIN is correct or no and continue working.

我已经做了一些搜索和发现计算器并说其他网络资源的 There没有办法制定一个无根的手机一个新的自定义解锁机制。 或的。

I have made some searches and found some articles on stackoverflow and other internet sources which say "There is no way to develop a new custom unlock mechanism on a non-rooted phone." or "I would be surprised if you could, because then you would be probably able to steal the pin code, and I don't think anyone would want that.".

另外,我看过一些视频教程,如教程:Android的内部 - 建筑自定义ROM,铂。 1 2 教程:Android的内部 - 建立一个自定义ROM,铂。 2 2

Also I have watched some video tutorials like Tutorial: Android Internals - Building a Custom ROM, Pt. 1 of 2 and Tutorial: Android Internals - Building a Custom ROM, Pt. 2 of 2.

EDITED

EDITED

我已经做今天一些搜索,发现了一个很有趣的事情,我觉得我是在一个正确的方式来解决,我想与大家分享我的想法。所以,看在Android的来源,我发现了一个有趣的文件的 ChooseLockPassword.java 包\ APPS \设置\ SRC \ COM \机器人\设置的)和 LockPatternUtils.java (*框架\基地\核心\ java的\ COM \机器人\内部\小部件*)我现在的兴趣:

I have made some searches today and found a very interesting thing, I think I am on a right way to the solution, and I want to share my ideas with you. So looking in android sources I found an interesting files ChooseLockPassword.java (packages\apps\Settings\src\com\android\settings) and LockPatternUtils.java (*frameworks\base\core\java\com\android\internal\widget*) now I am interest in:

我怎么能叫 LockPatternUtils 类的函数从我的code ?为什么我不能看到该功能在Eclipse?

How can I call LockPatternUtils class function from my code ? Or Why I cant see that function in Eclipse ?

所以我认为,只有这样,才能获得进入Android的系统密码对话框是铲除手机做一些修改系统文件,并使用 系统PIN码dialod

So I think that the only way to get access to the Android system PIN dialog is to root the phone make some changes in the system files and use system PIN dialod

  1. 有人可以给我提供有关获取对系统的访问密码对话框中扎根电话有用的链接。
  2. 我是在一个正确的方式,我可以解决我的问题,在这种方式?
  3. 如果有人遇到过这样的问题,请帮我解决。

任何解决方案?

推荐答案

好吧,我已经解决了这个问题,现在我想与大家分享我的解决方案。

Okay, I have solved this problem and now I want to share my solution with you.

起初,我告诉我的Andr​​oid源,所以我已在安卓来源的一些变化来获得访问密码和模式对话框。在这里,他们是:

At first as I told I have android sources so I have made some changes in android sources to get access to the PIN and Pattern dialogs. And here they are:

〜\ AndroidSources \ pakages \ APPS \设置\ AndroidManifest.xml中以下的code线我已经改变了

in ~\AndroidSources\pakages\apps\Settings\AndroidManifest.xml I have changed following lines of code

<activity android:name="ConfirmLockPattern"
          android:exported="true"> // This line was added by me.
</activity>

<activity android:name="ConfirmLockPassword"
          android:exported="true" // This line was added by me.
          android:them="@android:style/Them.NoTitleBar">
</activity>

<activity android:name="ChooseLockPattern"
          android:exported="true" // This line was added by me.
          android:label="@string/lockpattern_change_lock_pattern_label">
</activity>

这个修改允许我这样称呼的 ConfirmLockPattern ConfirmLockPassword ChooseLockPattern 从我自己的应用程序的活动。当我编译Android源$ C ​​$ CS和发射system.img我的模拟器。

This modifications allow me to call "ConfirmLockPattern", "ConfirmLockPassword" and "ChooseLockPattern" activities from my own application. After I compile android Source codes and launch system.img on my emulator.

在我的应用程序有写以下功能,以所谓的 ConfirmLockPattern ChooseLockPattern 活动:

In my application I have write following functions in order to call "ConfirmLockPattern" or "ChooseLockPattern" activities:

/**
 * Show PIN/Password confirmation dialog.
 */
void ShowConfirmLockPINActivity() {
    CustomLog.i(TAG, "Show Confirm Lock PIN Activity");
    Intent intent = new Intent(Intent.ACTION_RUN);
    intent.setComponent(new ComponentName("com.android.settings",
        "com.android.settings.ConfirmLockPassword"));
    startActivityForResult(intent, mRequestCode);
} /* ShowConfirmLockPINActivity() */

/**
 * Show set PIN/Password dialog.
 */
void ShowSetLockPINActivity() {
    CustomLog.i(TAG, "Show Set Lock PIN Activity");
    Intent intent = new Intent(Intent.ACTION_RUN);
    intent.setComponent(new ComponentName("com.android.settings",
        "com.android.settings.ChooseLockPassword"));
    startActivityForResult(intent, mRequestCode);
} /* ShowSetLockPINActivity() */

/**
 * Show Pattern Confirmation dialog.
 */
void ShowSetLockPatternActivity() {
    CustomLog.i(TAG, "Show Set Lock Pattern Activity");
    Intent intent = new Intent(Intent.ACTION_RUN);
    intent.setComponent(new ComponentName("com.android.settings",
        "com.android.settings.ConfirmLockPattern"));
    startActivityForResult(intent, mRequestCode);
} /* ShowSetLockPatternActivity() */

这篇关于在Android应用程序使用系统密码对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 16:49