【问题标题】:Can I catch uninstall action in my Android app我可以在我的 Android 应用程序中捕获卸载操作吗
【发布时间】:2011-04-07 21:54:38
【问题描述】:
public class Unistallreceiver extends BroadcastReceiver { 
    @Override 
    public void onReceive(Context context, Intent intent) { 
            // TODO Auto-generated method stub 
            String action = intent.getAction(); 
            if (action == null) 
                    Log.e("uninstall ", "Action==null!"); 
            else if ("android.intent.action.BOOT_COMPLETED".equals(action)) { 
                    Log.e("uninstall ", "action :"+action); 
            } 
    } 

}

做这样的事情,但无法得到通知。参考说:

公共静态最终字符串 ACTION_PACKAGE_REMOVED

自:API 级别 1 广播动作:现有应用程序包已从设备中删除。数据包含包的名称。 正在安装的包没有收到这个 Intent

需要这个意图来设置卸载密码。

有什么建议吗??

【问题讨论】:

标签: java android


【解决方案1】:

摆脱“设置卸载密码”的要求。

【讨论】:

  • CommonsWare 你写了几本关于 Android 的好书,但给出的答案太无用了。有没有可能获得管理员模式,比如在谷歌的 API 示例中,或者其他什么???
  • @Zeldan:作为安全措施,Android 非常明确地阻止应用程序在卸载过程中获得控制权,以帮助防止恶意软件在 Windows 上使用某些技巧。因此,任何依赖于在卸载时获得控制权的功能都无法在没有固件修改的情况下实现。当然,编写自己的固件当然是可能的。我不知道“卸载密码”是什么,因此无法为您提供其他替代方案。
猜你喜欢
  • 2011-07-05
  • 2016-07-02
  • 1970-01-01
  • 2014-10-16
  • 1970-01-01
  • 1970-01-01
  • 2021-04-18
  • 1970-01-01
  • 2021-12-02
相关资源
最近更新 更多