diff --git a/jadx-core/src/main/java/jadx/core/export/ExportGradleTask.java b/jadx-core/src/main/java/jadx/core/export/ExportGradleTask.java index e31753e23b5..72e8e5e45b3 100644 --- a/jadx-core/src/main/java/jadx/core/export/ExportGradleTask.java +++ b/jadx-core/src/main/java/jadx/core/export/ExportGradleTask.java @@ -55,7 +55,7 @@ public void run() { .orElseGet(() -> resContainers.stream() .filter(resContainer -> resContainer.getFileName().contains("strings.xml")) .findFirst() - .orElseThrow(IllegalStateException::new)); + .orElse(null)); ExportGradleProject export = new ExportGradleProject(root, projectDir, androidManifest, strings); diff --git a/jadx-core/src/main/java/jadx/core/utils/android/AndroidManifestParser.java b/jadx-core/src/main/java/jadx/core/utils/android/AndroidManifestParser.java index 8428055b6e4..caaa3e1085c 100644 --- a/jadx-core/src/main/java/jadx/core/utils/android/AndroidManifestParser.java +++ b/jadx-core/src/main/java/jadx/core/utils/android/AndroidManifestParser.java @@ -36,8 +36,6 @@ public AndroidManifestParser(ResourceFile androidManifestRes, ResContainer appSt this.androidManifest = parseAndroidManifest(androidManifestRes); this.appStrings = parseAppStrings(appStrings); - - validateAttrs(); } public boolean isManifestFound() { @@ -60,12 +58,6 @@ public ApplicationParams parse() { return parseAttributes(); } - private void validateAttrs() { - if (parseAttrs.contains(AppAttribute.APPLICATION_LABEL) && appStrings == null) { - throw new IllegalArgumentException("APPLICATION_LABEL attribute requires non null appStrings"); - } - } - private ApplicationParams parseAttributes() { String applicationLabel = null; Integer minSdkVersion = null; @@ -113,6 +105,9 @@ private String getApplicationLabel() { if (application.hasAttribute("android:label")) { String appLabelName = application.getAttribute("android:label"); if (appLabelName.startsWith("@string")) { + if (appStrings == null) { + throw new IllegalArgumentException("APPLICATION_LABEL attribute requires non null appStrings"); + } appLabelName = appLabelName.split("/")[1]; NodeList strings = appStrings.getElementsByTagName("string");