Bug? Removepermission in manifest editor

DavideV

Active Member
Licensed User
Longtime User
Hi all,
i'm using B4A v3.82 and it's the first time i try to use the removepermission keyword in manifest editor.
I'm trying to remove permissions added by the leadbolt library (too much to publish to SlideMe).

Not sure if it's a bug but this is the problem:
it seem that the removepermission keyword doesn't remove duplicated permission manually added with the manifest editor.
If i add in the manifest editor a permission manually and the same permission is added by a library and i add the removepermission keyword to that permission , it's removed only one time.
The result is that the permission is still present...

For now i check if a permission already exist before adding it manually, if needed (leadbolt suggest to add some of them in the manifest).


Edit 2014/08/12: added a sample project

Bye
DavideV
 

Attachments

  • removepermission.zip
    11.1 KB · Views: 176
Last edited:

DavideV

Active Member
Licensed User
Longtime User
Are you sure that you didn't add the permission after calling RemovePermission?

Hi Erel, thanks!
i have added the removepermission after all requested permissions in the manifest editor.
A sample project was added in the first post, Leadbolt lib is included.

Try comment/uncomment the removepermission in the manifest editor or comment the library declaration in code, compile and check the androidmanifest.xml in the object folder, no need install (if you run it you get FC).

For me duplicated permission aren't removed.
Also if you comment the library declaration in code and uncomment removepermission in the manifest editor the permission added 'by hand' are still present after compilation and the compile windows shows as removed in the permissions list.

Thx in advance ;)
DavideV
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The answer is simple. You are adding the permissions with AddManifestText instead of AddPermission. The compiler doesn't know that you've added these permissions.
This code for example:
B4X:
addmanifesttext(
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>)
Should be replaced with:
B4X:
AddPermission(android.permission.WAKE_LOCK)
AddPermission(android.permission.RECEIVE_BOOT_COMPLETED)

You can still use AddManifestText however the permissions will not be listed in the permissions window and RemovePermission will not work.
 
Top