mirror of
https://github.com/revanced/Apktool.git
synced 2025-02-01 14:47:56 +01:00
fix: support 0_resource_name_obfuscated
(#3067)
* fix: support `0_resource_name_obfuscated` * refactor: drop jdk9 for jdk8 logic
This commit is contained in:
parent
b83b58e8e8
commit
deb9dcf089
@ -20,6 +20,9 @@ import brut.androlib.AndrolibException;
|
|||||||
import brut.androlib.err.UndefinedResObjectException;
|
import brut.androlib.err.UndefinedResObjectException;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -31,12 +34,15 @@ public class ResResSpec {
|
|||||||
private final ResPackage mPackage;
|
private final ResPackage mPackage;
|
||||||
private final ResTypeSpec mType;
|
private final ResTypeSpec mType;
|
||||||
private final Map<ResConfigFlags, ResResource> mResources = new LinkedHashMap<>();
|
private final Map<ResConfigFlags, ResResource> mResources = new LinkedHashMap<>();
|
||||||
|
private static final Set<String> EMPTY_RESOURCE_NAMES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
|
||||||
|
"0_resource_name_obfuscated",
|
||||||
|
"(name removed)"
|
||||||
|
)));
|
||||||
|
|
||||||
public ResResSpec(ResID id, String name, ResPackage pkg, ResTypeSpec type) {
|
public ResResSpec(ResID id, String name, ResPackage pkg, ResTypeSpec type) {
|
||||||
this.mId = id;
|
this.mId = id;
|
||||||
String cleanName;
|
String cleanName;
|
||||||
|
name = EMPTY_RESOURCE_NAMES.contains(name) ? null : name;
|
||||||
name = (("(name removed)".equals(name)) ? null : name);
|
|
||||||
|
|
||||||
ResResSpec resResSpec = type.getResSpecUnsafe(name);
|
ResResSpec resResSpec = type.getResSpecUnsafe(name);
|
||||||
if (resResSpec != null) {
|
if (resResSpec != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user