From 07d15e82007b13760ad13b535ae77c468e7c8110 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Wed, 9 Nov 2022 06:03:44 -0500 Subject: [PATCH] Squashed commit of the following: commit 66a7167079caafd2e805dcd9e3dd1a883b92493b Author: Connor Tumbleson Date: Wed Nov 9 06:02:23 2022 -0500 refactor: add message when pairing --only-main-classes w/ --no-src commit 565a4dbe33e69e0da775ad8678a29fd7e117fe3c Author: surendrajat Date: Wed Nov 9 12:12:28 2022 +0530 fix: --no-src should take precedence over --only-main-classes --- .../apktool-lib/src/main/java/brut/androlib/ApkDecoder.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java index 4e186f18..bd8ad964 100644 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/ApkDecoder.java @@ -180,6 +180,10 @@ public class ApkDecoder { if (mode != DECODE_SOURCES_NONE && mode != DECODE_SOURCES_SMALI && mode != DECODE_SOURCES_SMALI_ONLY_MAIN_CLASSES) { throw new AndrolibException("Invalid decode sources mode: " + mode); } + if (mDecodeSources == DECODE_SOURCES_NONE && mode == DECODE_SOURCES_SMALI_ONLY_MAIN_CLASSES) { + LOGGER.info("--only-main-classes cannot be paired with -s/--no-src. Ignoring."); + return; + } mDecodeSources = mode; }