10-28-2009 07:10 AM
I have the beta 5.0 JDE and beta simulators for 5.0 9700 and 9500. The firewall seems incompletely implemented, so I am unable to reproduce and diagnose a problem that appears to be the firewall blocking one of my apps on actual devices running any 5.0 version.
On these beta simulators, here's what seems incomplete about the firewall:
1. I cannot edit the app's permissions, anywhere. I can only edit the "default permissions". Select an app in Applications and hit the menu, "Edit Default Permissions" is there, but where's "Edit Permissions"?
2. The Help in Firewall does not fully correspond with what's actually in the 5.0 device software; it corresponds with what's on earlier software. For example, it says to use Options/Advanced/Applications to get to an app's permissions, but in 5.0 that's in Options/Applications, not in Advanced. And it also says select "Edit Permissions" in the menu after highlighting an app name in Applications, but there is no "Edit Permissions" in the menu.
3. The usual prompts, "App is trying to access such-and-such, Allow or Deny?" never come up. This at least corresponds with what's happening on the actual devices running 5.0, but I'll explain below why this is a problem. Maybe the firewall isn't completely implemented in the pre-release versions of 5.0, for actual devices as well as simulators? The Firewall Help clearly says the prompts should come up, but they don't.
So here is the problem:
I have an app that collects memory statistics. It works on everything, including all 5.0 simulators, but will not work on any actual device running any 5.0. One odd thing is this app only ever works (on Any device) _after_ the permission prompts have been presented and answered Allow. Otherwise, it hangs for a while and then terminates. I check for permissions wherever possible before accessing anything (such as filesystem stats), but what's causing the hang-up is when it tries to access the various statistic in the Memory class. The OS will not allow that to succeed unless the prompts have been presented and answered Allow. In some cases the prompts do not present, and the app is blocked by the OS until the user resets the firewall and the prompts present. Then it's fine. Disabling the firewall OR using "edit permissions" and selecting Allow for everything does not solve the problem. The only solution found is to get the phone to prompt.
Why? I don't know. All I'm doing is checking how much memory is available, how many object handles, etc. I don't even have any persistent settings to store; the app just reads a bunch of stats and displays them, that's it.
Enter 5.0. It won't prompt for permissions, either in the sims or on a device. Resetting the firewall does not make it prompt. And the app runs -perfectly- on any 5.0 simulator, even running the 4.7 build, but will not do anything on a real phone. This is what it does on pre-5.0 when the prompts have not been presented or answered Allow. But on pre-5.0, I can get the prompts to present by resetting the firewall settings -- on 5.0, nothing I can find will make them present.
I'm often being contacted by users who want this app on 5.0, it's a costly problem and has to be solved, especially with the release of new 5.0 phones. The app works on the simulators. What is different on a real phone, and why won't the firewall prompt?
As a point of interest, why is this even an issue on any OS? All permissions can be set to Allow, the firewall can be disabled, and yet the phone will not allow the app to run until it's somehow forced to prompt for permissions. Why is that necessary if the firewall is disabled and everything is set to Allow, also in Default Permissions? The app is just doing Memory.getObjectStats, Memory.getFlashStats, etc. What's the big deal?
I posted this once before, but now it seems the post is gone. MSohm had replied saying the firewall would not block the app when disabled. Well, something is blocking it, because it never works until the prompts, and always works after the prompts present and are answered Allow.
10-28-2009 07:21 AM
You may way to enable device security in your simulator. Without this flag, the device is insecure and is not performing most of the security checks (e.g., signature verificaiton or application permissions). Also, in this mode the Edit Permissions menu item is simply not offered. In the JDE Simulator, you there's a checkbox "Enable device security" in the General tab of the Simulator settings.
10-28-2009 07:22 AM
P.S. If your app is mysteriously blocked, then use the Break Now feature of the Debugger and see where and what is blocking your app.
10-28-2009 07:45 AM
It never gets blocked in a simulator, and I don't have a 5.0 device to plug in. I don't even know if 5.0 can run on my 8330, but I depend on that device too much to have it turn into a brick from installing a beta OS not designed for it.
I just downloaded the latest 5.0 JDE (beta 4, v22.214.171.124) and it won't even run a build -- gives a missing-file error when starting any simulator. Uninstalled and reinstalled it twice. And of course I deleted the earlier beta thinking I wouldn't need it again. I'll download 126.96.36.199 again and try enabling the security settings this time. Thanks for the tip.