breautek commented on issue #201:
URL: https://github.com/apache/cordova-common/issues/201#issuecomment-1904009808
> @GiovanniBattista @breautek I think the idea of using an xml string to
identify the code added to AndroidManifest is not as good as it seems to be,
bacause in some cases you can end up adding something twice, for ex in my case,
adding a permission tag from one plugin and the same permission with a
maxSdkVersion attribute with another, will result on adding the same permission
twice which means build failure, I think using a definition object inside
parents is better be like below:
>
> ```
> {
> tag:"uses-permission",
> attributes:[
> {
> name:"android:name",
> value:"android.permission.READ_EXTERNAL_STORAGE",
> plugins:["plugin_1","plugin_2"],
> },
> {
> name:"android:maxSdkVersion",
> value:"30",
> plugins:["plugin_2"],
> }
> ]
> }
> ```
>
> and then if you remove a plugin , if the plugin exists in plugins and
plugins.length>1, you keep the tag and just remove the plugin from plugins and
if the plugins.length==1 then remove from AndroidManifest. I don't know it
seems legit, I'm a bit busy these days, but i'll definitely give a shot, I just
wrote this comment to someone who can work on it sooner.
I do agree to this and something similar to this is already being done. The
codebase calls it munging. But it's not as simple as this structure. This in
itself doesn't handle conflicts, and operations needs to support targeting
nodes and attributes so they can be manipulated, or deleted, etc.
Personally I think what Cordova has needs to be rewritten, but I haven't
found the time to provide a PoC either.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]