mirror of
https://github.com/skylot/jadx.git
synced 2024-11-23 12:50:02 +00:00
fix: remove class filtering on export (#1847)
This commit is contained in:
parent
ddefead764
commit
5e8f9b900f
@ -3,23 +3,16 @@ package jadx.core.export;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import jadx.api.ResourceFile;
|
||||
import jadx.core.dex.attributes.AFlag;
|
||||
import jadx.core.dex.nodes.ClassNode;
|
||||
import jadx.core.dex.nodes.RootNode;
|
||||
import jadx.core.utils.exceptions.JadxRuntimeException;
|
||||
import jadx.core.utils.files.FileUtils;
|
||||
@ -27,15 +20,8 @@ import jadx.core.xmlgen.ResContainer;
|
||||
import jadx.core.xmlgen.XmlSecurity;
|
||||
|
||||
public class ExportGradleProject {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ExportGradleProject.class);
|
||||
|
||||
private static final Pattern ILLEGAL_GRADLE_CHARS = Pattern.compile("[/\\\\:>\"?*|]");
|
||||
|
||||
private static final Set<String> IGNORE_CLS_NAMES = new HashSet<>(Arrays.asList(
|
||||
"R",
|
||||
"BuildConfig"));
|
||||
|
||||
private final RootNode root;
|
||||
private final File projectDir;
|
||||
private final File appDir;
|
||||
@ -61,7 +47,6 @@ public class ExportGradleProject {
|
||||
saveProjectBuildGradle();
|
||||
saveApplicationBuildGradle();
|
||||
saveSettingsGradle();
|
||||
skipGeneratedClasses();
|
||||
} catch (Exception e) {
|
||||
throw new JadxRuntimeException("Gradle export failed", e);
|
||||
}
|
||||
@ -95,16 +80,6 @@ public class ExportGradleProject {
|
||||
tmpl.save(new File(appDir, "build.gradle"));
|
||||
}
|
||||
|
||||
private void skipGeneratedClasses() {
|
||||
for (ClassNode cls : root.getClasses()) {
|
||||
String shortName = cls.getClassInfo().getShortName();
|
||||
if (IGNORE_CLS_NAMES.contains(shortName)) {
|
||||
cls.add(AFlag.DONT_GENERATE);
|
||||
LOG.debug("Skip class: {}", cls);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ApplicationParams getApplicationParams(Document androidManifest, Document appStrings) {
|
||||
Element manifest = (Element) androidManifest.getElementsByTagName("manifest").item(0);
|
||||
Element usesSdk = (Element) androidManifest.getElementsByTagName("uses-sdk").item(0);
|
||||
|
Loading…
Reference in New Issue
Block a user