Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Android - Remove ACCESS_MOCK_LOCATION from Manifest

Is there a method to remove <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/> from AndroidManifest.xml without creating AndroidManifest.custom.xml but simply editing tiapp.xml?

Sdk: 1.6.3 (continuous build)
MAC OS X
APIs 1.6

— asked May 2nd 2011 by Andrea Frittella
  • android
  • androidmanifest.xml
  • tiapp.xml
0 Comments

2 Answers

  • Well this will be removed within the next mobilesdk release see: Bug report

    Otherwise the only way is to create your custom Manifest.xml file.

    — answered December 7th 2011 by Daniel Urstöger
    permalink
    2 Comments
    • This was never fixed! OR it is a 1.8.1 regression.

      — commented February 9th 2012 by Joe Falcone
    • I saw a commit message in mobilesdk that this issue was fixed some day, but I didn´t double check on that. You claim it is not fixed, did you check within a distribution or test APK file generated by Titanium?

      — commented February 9th 2012 by Daniel Urstöger
  • for those still running pre-1.8.x sdk, you can apply the patch yourself. Note: its usually terrible to modify a framework yourself, but the risk of that message to users outweighs that imo.

    File: Titanium/mobilesdk/osx/1.7.5/android/builder.py
    (note this varies by OS and version)

    @@ -653,11 +653,15 @@ def generate_android_manifest(self,compiler):
    653     653    
         # NOTE: these are built-in permissions we need -- we probably need to refine when these are needed too
    654     654    
         permissions_required = ['INTERNET','ACCESS_WIFI_STATE','ACCESS_NETWORK_STATE', 'WRITE_EXTERNAL_STORAGE']
    655     655    
    
    656          
    -    GEO_PERMISSION = [ 'ACCESS_COARSE_LOCATION', 'ACCESS_FINE_LOCATION', 'ACCESS_MOCK_LOCATION']
          656    
    +    GEO_PERMISSION = [ 'ACCESS_COARSE_LOCATION', 'ACCESS_FINE_LOCATION']
    657     657    
         CONTACTS_PERMISSION = ['READ_CONTACTS']
    658     658    
         VIBRATE_PERMISSION = ['VIBRATE']
    659     659    
         CAMERA_PERMISSION = ['CAMERA']
    660     660    
         WALLPAPER_PERMISSION = ['SET_WALLPAPER']
          661    
    +
          662    
    +    # Enable mock location if in development or test mode.
          663    
    +    if self.deploy_type == 'development' or self.deploy_type == 'test':
          664    
    +      GEO_PERMISSION.append('ACCESS_MOCK_LOCATION')
    661     665    
    
    662     666    
         # this is our module method to permission(s) trigger - for each method on the left, require the permission(s) on the right
    663     667    
         permission_mapping = {
    

    source: https://github.com/appcelerator/titanium_mobile/pull/445/files

    — answered May 4th 2012 by John Brennan
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.