use of com.taobao.android.builder.tools.proguard.dump.KeepConverter in project atlas by alibaba.
the class AtlasProguardHelper method generateKeepFile.
@NotNull
private static File generateKeepFile(List<AwbBundle> awbBundles, File dir) throws IOException {
KeepConverter refClazzContainer = new KeepConverter();
for (AwbBundle awbBundle : awbBundles) {
if (null != awbBundle.getKeepProguardFile() && awbBundle.getKeepProguardFile().exists()) {
String json = FileUtils.readFileToString(awbBundle.getKeepProguardFile());
Map<String, ClazzRefInfo> refClazzMap = JSON.parseObject(json, new TypeReference<Map<String, ClazzRefInfo>>() {
});
refClazzContainer.addRefClazz(refClazzMap);
} else {
sLogger.error("missing " + awbBundle.getKeepProguardFile().getAbsolutePath());
}
}
File maindexkeep = new File(dir, "maindexkeep.cfg");
FileUtils.writeLines(maindexkeep, refClazzContainer.convertToKeeplines());
return maindexkeep;
}
Aggregations