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
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public Map<String, Integer> call() throws IOException {
int transactionStartIndex = 0;
int fileStartIndex = 0;
String currentPrefix = null;
Map<String, Integer> newPackageAssignments = new LinkedHashMap();
Map<String, Integer> newPackageAssignments = new HashMap();
AtlasVirtualFile current = this.cycler.next();
List<DexProgramClass> nonPackageClasses = new ArrayList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public void setInputDirs(List<File> inputLibraries) {

private Map<String, Boolean> mainManifestMap = new HashMap<>();

private Map<String, Boolean> mainNativeSoMap = new LinkedHashMap<>();
private Map<String, Boolean> mainNativeSoMap = new HashMap<>();

private Map<String, Boolean> mainRes = new LinkedHashMap<>();
private Map<String, Boolean> mainRes = new HashMap<>();

public File getMainJavaRes() {
return mainJavaRes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class MatcherCreator {

static Set<ImplementsMatcher> matchers = new HashSet<>();

static Map<String, Imatcher> sMatchers = new LinkedHashMap<>();
static Map<String, Imatcher> sMatchers = new HashMap<>();

public static Imatcher create(String rule) {
if (sMatchers.containsKey(rule)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,24 +375,26 @@ private static void addLibraryProguardFiles(AppVariantContext appVariantContext,
private static void addChildDependency(BundleItem bundleItem, Input input,
Map<BundleInfo, AwbTransform> bundleInfoAwbTransformMap) throws IOException {

List<String>pkgNames = new ArrayList<>();
List<String>pkgNames = new LinkedList<>();

input.getAwbBundles().forEach(awbTransform -> pkgNames.add(awbTransform.getAwbBundle().getPackageName()));

sLogger.info("combine to proguard bundles:"+pkgNames.toString());

List<AwbTransform> childTransforms = new ArrayList<>();
List<AwbTransform> childTransforms = new LinkedList<>();

sLogger.info("combine to proguard bundles:"+pkgNames.toString());

Set<String> pkgNameSet = new HashSet<>(pkgNames);

for (BundleItem child : bundleItem.children) {
if (!pkgNames.contains(child.bundleInfo.getPkgName())) {
if (!pkgNameSet.contains(child.bundleInfo.getPkgName())) {
childTransforms.add(bundleInfoAwbTransformMap.get(child.bundleInfo));
}else {
sLogger.error(child.bundleInfo.getPkgName() +" in proguard bundles so discard from "+ bundleItem.bundleInfo.getPkgName()+"libraries...");
}
for (BundleInfo sub : child.circles) {
if (!pkgNames.contains(sub.getPkgName())) {
if (!pkgNameSet.contains(sub.getPkgName())) {
childTransforms.add(bundleInfoAwbTransformMap.get(sub));
}else {
sLogger.error(sub.getPkgName() +" in proguard bundles so discard from "+ bundleItem.bundleInfo.getPkgName()+" libraries...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ protected String reInterface(String inter) {

@Override
protected Annotation reAnnotation(Annotation annotation) {
Set<String> basicValueSet = new HashSet<>(basicValue);
String type = annotation.getType();
boolean isArray = false;
if (type.startsWith("[")) {
Expand All @@ -491,7 +492,7 @@ protected Annotation reAnnotation(Annotation annotation) {
if (value.startsWith("[")) {
isArray1 = true;
}
if (basicValue.contains(value)) {
if (basicValueSet.contains(value)) {
newValue = value;
} else if (value.startsWith("Ljava/util/") || value.startsWith("Ljava/lang/") || !value.startsWith("L")) {
newValue = value;
Expand All @@ -512,7 +513,7 @@ protected Annotation reAnnotation(Annotation annotation) {
if (value.startsWith("[")) {
isArray2 = true;
}
if (basicValue.contains(value)) {
if (basicValueSet.contains(value)) {
newValueSub = value;
} else if (value.startsWith("Ljava/util/") || !value.endsWith(";")) {
newValueSub = value;
Expand All @@ -537,7 +538,7 @@ protected Annotation reAnnotation(Annotation annotation) {
if (value.startsWith("[")) {
isArray = true;
}
if (basicValue.contains(value)) {
if (basicValueSet.contains(value)) {
newValue = value;
} else if (value.startsWith("Ljava/util/") || value.startsWith("Ljava/lang/") || !value.startsWith("L")) {
newValue = value;
Expand All @@ -559,7 +560,7 @@ protected Annotation reAnnotation(Annotation annotation) {
if (value.startsWith("[")) {
isArray2 = true;
}
if (basicValue.contains(value)) {
if (basicValueSet.contains(value)) {
newValue = value;
} else if (value.startsWith("Ljava/util/") || !value.endsWith(";")) {
newValue = value;
Expand Down Expand Up @@ -665,6 +666,7 @@ public Set<? extends Annotation> getAnnotation(Set<? extends Annotation> annotat
String newType = DefineUtils.getDefineClassName(classProcessor.classProcess(DefineUtils.getDalvikClassName(type)).className, isArray);
Set<? extends AnnotationElement> sets = annotation.getElements();
Set<ImmutableAnnotationElement> newAnnotationElement = new HashSet<ImmutableAnnotationElement>();
Set<String> basicValueSet = new HashSet<>(basicValue);
for (AnnotationElement annotationElement : sets) {
String name = annotationElement.getName();
EncodedValue encodedValue = annotationElement.getValue();
Expand All @@ -678,7 +680,7 @@ public Set<? extends Annotation> getAnnotation(Set<? extends Annotation> annotat
if (value.startsWith("[")) {
isArray1 = true;
}
if (basicValue.contains(value)) {
if (basicValueSet.contains(value)) {
newValue = value;
} else if (value.startsWith("Ljava/util/") || !value.endsWith(";") || value.startsWith("Ljava/lang/")||!value.startsWith("L")) {
newValue = value;
Expand All @@ -694,7 +696,7 @@ public Set<? extends Annotation> getAnnotation(Set<? extends Annotation> annotat
if (value.startsWith("[")) {
isArray2 = true;
}
if (basicValue.contains(value)) {
if (basicValueSet.contains(value)) {
newValueSub = value;
} else if (value.startsWith("Ljava/util/") || value.startsWith("Ljava/lang/") || !value.endsWith(";")) {
newValueSub = value;
Expand All @@ -719,7 +721,7 @@ public Set<? extends Annotation> getAnnotation(Set<? extends Annotation> annotat
isArray3 = true;
}
String newValue = null;
if (basicValue.contains(value)) {
if (basicValueSet.contains(value)) {
newValue = value;
} else if (value.startsWith("Ljava/util/") || value.startsWith("Ljava/lang/") || !value.endsWith(";")) {
newValue = value;
Expand Down Expand Up @@ -774,7 +776,7 @@ public Set<? extends Annotation> getAnnotation(Set<? extends Annotation> annotat
if (value.startsWith("[")) {
isArray2 = true;
}
if (basicValue.contains(value)) {
if (basicValueSet.contains(value)) {
newValueSub = value;
} else if (value.startsWith("Ljava/util/") || value.startsWith("Ljava/lang/") || !value.endsWith(";")) {
newValueSub = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public DexTransform uninoStringValues(Dex baseDex) {
return this;
}

public DexTransform markClassDef(Dex baseDex,List<String>classNames) {
public DexTransform markClassDef(Dex baseDex,Set<String>classNames) {
for (ClassDef classDef:dex.classDefs()) {
int typeId = classDef.getTypeIndex();
String value = dex.typeNames().get(typeId);
Expand Down