Android Manifest with @String reference - specifically android:authorities

前端 未结 2 2061
猫巷女王i
猫巷女王i 2021-01-21 15:17

I have this issue with the manifest.

Looks like this may be a dupe of : Using @string for android:authorities in a ContentProvider

I have a provider with separat

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-21 15:39

    With a bit more help from here android-maven-plugin and resource filtering

    here https://github.com/jayway/maven-android-plugin/pull/115

    and @Konstantin Pridluda I came to an acceptable conclusion.

    What I did was to create a new folder within parent project folder called manifests. Then created two sub folder customer1Manifest and customer2Manifest

    Inside each of these folders i created a copy of the manifest file then replaced the @string reference with the appropriate hard string authorities. (the normal manifest file is the debug auth)

    Then in the POM i switched out the manifests for the appropriate ones like this.

    
        
         Customer1
         
             true
         
         
      ../manifests/customer1Manifest/AndroidManifest.xml
          
        
        
         Customer2
         
            ../manifests/customer2Manifest/AndroidManifest.xml
          
          
    
    

    then later on in the android-maven-plugin phase did this

     
            com.jayway.maven.plugins.android.generation2
            android-maven-plugin
            true
    
            true
            
             ${customerManifest}
                .........
    .......
            
    
    

提交回复
热议问题