Authentication 在android中安装应用程序时需要密码

Authentication 在android中安装应用程序时需要密码,authentication,android-intent,passwords,uninstallation,password-protection,Authentication,Android Intent,Passwords,Uninstallation,Password Protection,嘿,我想当用户试图取消安装一个应用程序,有密码来解锁。我遵循这个准则: 但清单“android:description=“@string/descript”中出现错误 请帮帮我。我陷入了困境。谷歌上也没有答案 try the following code in your service public static final String UNINSTALLER ="com.android.packageinstaller.UninstallerActivity"; priv

嘿,我想当用户试图取消安装一个应用程序,有密码来解锁。我遵循这个准则:

但清单“android:description=“@string/descript”中出现错误 请帮帮我。我陷入了困境。谷歌上也没有答案

    try the following code in your service 
    public static final String UNINSTALLER ="com.android.packageinstaller.UninstallerActivity";
private ActivityManager activityManager = null;
private ExecutorService executorService;


@Override
public void onCreate() {
    super.onCreate();

    executorService = Executors.newSingleThreadExecutor();

    activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
    LockerThread thread = new LockerThread();
    executorService.submit(thread);
}

   private void protactApp(String packname) {
            Intent pwdIntent = null;
            pwdIntent = new Intent("uninstaller.receiver");
            sendBroadcast(pwdIntent);


        }
class LockerThread implements Runnable {

    private String lastname;

    public LockerThread() {

    }

    @Override
    public void run() {

            ComponentName act = activityManager.getRunningTasks(1).get(0).topActivity;
            String packname = act.getPackageName();



            if (act.getClassName().equals(UNINSTALLER)) {
                Log.d("Tag", "package to be uninstalled");
                protactApp(UNINSTALLER);
            }
        }

从receiver,您可以在卸载应用程序时获得操作,因此,无论您为密码或模式准备什么屏幕,您都可以在卸载之前启动,如applock应用程序,这在4.3或更高版本上都不会有帮助,但我正在发布一个链接,您可以在其中找到解决方案以及无法执行此操作的原因。
这是你的电话号码。希望它能帮助你理解这方面的真正里程碑

这可能是我听过的最糟糕的想法。这可能是因为你有一个很好的理由,但是,如果我不能摆脱一些骗子,因为它需要一个密码,我认真考虑跟踪作者的一些“再教育”谁真正拥有我的设备:-)它的父母应用程序,如果孩子想要UnSTALL一个应用程序,根据我对另一个问题的评论:每隔一段时间检查一次设备。如果应用程序不见了,孩子会丢失一天。下一次是一周。然后一个月。他们很快就会学会不要和老掉牙的人混在一起:-)哈哈,是的,没错,但我必须完成这个任务,因为这是我的工作任务:(不,没关系,如果这是你的工作,那就是你的工作。希望我能进一步帮助你,祝你好运。什么是卸载程序。接收器?一个类或内置的东西?这是你的自定义范围,就像我们通过意图过滤器获得操作一样。这是自定义广播我们如何在接收器中获得操作?没有必要在清单中定义操作过滤器,你将t receiver@Override public void onReceive(Context-Context,Intent-Intent){//TODO自动生成的方法存根字符串[]packageNames=Intent.getStringArrayExtra(“android.Intent.extra.PACKAGES”);Log.d(“Tag”,“onReceive of uninstall Intent”);}我在接收广播接收器时写的代码是什么?