Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/com/reandroid/apk/ApkModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,7 @@ private void mergeFusedModules(ApkModule module) {
baseManifest.addFusedModuleNames(split);
logMessage("Added as fused module <" + split + ">");
}
baseManifest.mergeApplicationElements(manifest);
}
private void validateMerge(ApkModule apkModule, boolean force) throws IOException{
if (!hasTableBlock()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.reandroid.arsc.io.BlockReader;
import com.reandroid.arsc.model.ResourceEntry;
import com.reandroid.arsc.value.ValueType;
import com.reandroid.json.JSONObject;
import com.reandroid.utils.ObjectsUtil;
import com.reandroid.utils.StringsUtil;
import com.reandroid.utils.collection.ArrayCollection;
Expand Down Expand Up @@ -146,6 +147,31 @@ public String[] getFusedModuleNames() {
}
return null;
}
public void mergeApplicationElements(AndroidManifestBlock other) {
if (other == null) {
return;
}
ResXmlElement otherApplication = other.getApplicationElement();
if (otherApplication == null) {
return;
}
ResXmlElement thisApplication = getOrCreateApplicationElement();

Iterator<ResXmlElement> elements = otherApplication.getElements();
while (elements.hasNext()) {
ResXmlElement otherElement = elements.next();
String tagName = otherElement.getName();
if (TAG_meta_data.equals(tagName)) {
String nameValue = getAndroidNameValue(otherElement);
if (VALUE_com_android_dynamic_apk_fused_modules.equals(nameValue)) {
continue;
}
}
JSONObject json = otherElement.toJson();
ResXmlElement newElement = thisApplication.newElement();
newElement.fromJson(json);
}
}
public void addFusedModuleNames(String ... names) {
if (names == null || names.length == 0) {
return;
Expand Down