-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Introduce "res-mode" options. (#3318)
* Revert "Remove Apktool Dummys. (#3258)" This reverts commit 0e22692. * feat: properly add dummys * refactor: shorten ResTypeSpec * style: remove extra space * refactor: extract FlagItem into own class * refactor: notate which type is null * fix: only add dummys if enabled * feat: skip unknown (if enabled) * feat: introduce "res-mode" * feat: expose config on res table * feat: add method to base attr for res skips * fix: ensure autobuild doesn't choke * refactor: remove java17 enhanced switch * refactor: rename methods * refactor: cleanup res-mode param * test: introduction of test/sample apk * refactor: make ResXmlPatcher public for loading XML * test: assertions for dummy|leave|retain * fix: prevent using `@null` as a name * refactor: shorten long param for 'resm' * refactor: leave for preserve
- Loading branch information
1 parent
f0ca6d1
commit a117132
Showing
15 changed files
with
334 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/arsc/FlagItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (C) 2010 Ryszard Wiśniewski <[email protected]> | ||
* Copyright (C) 2010 Connor Tumbleson <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package brut.androlib.res.data.arsc; | ||
|
||
import brut.androlib.exceptions.AndrolibException; | ||
import brut.androlib.res.data.value.ResReferenceValue; | ||
|
||
public class FlagItem { | ||
public final ResReferenceValue ref; | ||
public final int flag; | ||
public String value; | ||
|
||
public FlagItem(ResReferenceValue ref, int flag) { | ||
this.ref = ref; | ||
this.flag = flag; | ||
} | ||
|
||
public String getValue() throws AndrolibException { | ||
if (value == null) { | ||
if (ref.referentIsNull()) { | ||
return String.format("APKTOOL_MISSING_0x%08x", ref.getRawIntValue()); | ||
} | ||
value = ref.getReferent().getName(); | ||
} | ||
return value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.