奇怪的黑莓问题 - 新版本突然请求访问权限

发布于 2024-07-25 10:01:10 字数 443 浏览 0 评论 0原文

在我的应用程序的开发测试过程中,我遇到了一个奇怪的问题,完全相同的代码库的新版本(Build 2.0)突然默认权限(运营商互联网,gps)是提示而不是允许安装。

详细信息 - 相同的代码库
因此存在两个版本,两者都具有相同的代码库。 Build 1.0 已于上周制作/签署。 昨天制作/签署了 Build 2.0。 如果我安装 Build 1.0,初始权限没有问题(全部允许)。 但在安装 Build 2.0 时,相同的权限(运营商互联网、GPS)被设置为提示。

问题
该应用程序确实使 GPS 和 数据请求,我确实了解某些手机配置需要设置权限,但为什么以前不需要权限的构建(构建 1.0)突然需要它们(构建 2.0)?

我认为这可能与我的项目/构建设置有关,但我不确定是什么。 有什么建议么?

During development testing of my app I'm running into a strange issue where new builds (Build 2.0) of the exact same code base suddenly default permissions (carrier internet, gps) to be Prompt rather than Allow on install.

Details -- Same code base
So there exists two builds, both with the same code base. Build 1.0 was made/signed last week. Build 2.0 was made/signed yesterday. If I install Build 1.0, no issues with initial permissions (all Allow). But on install of Build 2.0 the same permissions (carrier internet, gps) are set to Prompt.

Questions
The app does make gps & data requests and I do understand that some phone configurations require permissions to be set, but why would a build that previously didn't need permissions (Build 1.0) all of a sudden require them (Build 2.0)?

I assume it might have to do with my project/build settings but I'm not sure what. Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寄与心 2024-08-01 10:01:10

您是否有可能在 1.0 和 2.0 之间的设备上执行了某些操作,例如打开防火墙?

据我所知,在构建、下载或安装时您无法执行任何操作来设置或查询应用程序的权限。 您需要等到它实际运行后才能有任何控制权来查询或请求更改应用程序权限。

您可能想要尝试将以下代码片段放入应用程序的初始化中,以了解实际设置的内容:

ApplicationPermissionsManager apm = ApplicationPermissionsManager.getInstance();
ApplicationPermissions permissions = apm.getApplicationPermissions();
int[] keys = permissions.getPermissionKeys();
for (int i = 0; i < keys.length; i++) {
    int key = keys[i];
    System.out.println("APM: " + key + " = " +
        permissionToString(permissions.getPermission(key)));
}

并且:

public String permissionToString(int value) {
    switch(value) {
        case ApplicationPermissions.VALUE_ALLOW:
            return "ALLOW";
        case ApplicationPermissions.VALUE_PROMPT:
            return "PROMPT";
        case ApplicationPermissions.VALUE_DENY:
            return "DENY";
        case -1:
            return "NOT_SET";
        default:
            return Integer.toString(value);
    }
}

JDE 示例目录中的“applicationpermissionsdemo”程序有一个很好的查询示例应用程序权限并请求应用程序本身更改应用程序权限。

Is it possible you did something on your device between 1.0 and 2.0 that would cause this, such as turning on your firewall?

As far as I know, there isn't anything you can do at build, download, or install time to set or query the permissions for an app. You need to wait until it actually runs before you have any control to query or request changes to the app permissions.

You might want to try putting the following snippet of code in the initialization of your application, to take a peek at what the settings are actually set to:

ApplicationPermissionsManager apm = ApplicationPermissionsManager.getInstance();
ApplicationPermissions permissions = apm.getApplicationPermissions();
int[] keys = permissions.getPermissionKeys();
for (int i = 0; i < keys.length; i++) {
    int key = keys[i];
    System.out.println("APM: " + key + " = " +
        permissionToString(permissions.getPermission(key)));
}

and:

public String permissionToString(int value) {
    switch(value) {
        case ApplicationPermissions.VALUE_ALLOW:
            return "ALLOW";
        case ApplicationPermissions.VALUE_PROMPT:
            return "PROMPT";
        case ApplicationPermissions.VALUE_DENY:
            return "DENY";
        case -1:
            return "NOT_SET";
        default:
            return Integer.toString(value);
    }
}

The "applicationpermissionsdemo" program in the JDE samples directory has a good example of querying for app permissions and requesting changes to app permissions from the app itself.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文