mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 01:02:22 +01:00
feat: allow custom aapt path to be specified
This commit is contained in:
parent
afcba5c212
commit
8eb4a8f87a
2 changed files with 9 additions and 12 deletions
|
@ -41,11 +41,8 @@ val NAMER = BasicDexFileNamer()
|
|||
* The ReVanced Patcher.
|
||||
* @param options The options for the patcher.
|
||||
*/
|
||||
class Patcher(
|
||||
private val options: PatcherOptions
|
||||
) {
|
||||
class Patcher(private val options: PatcherOptions) {
|
||||
val data: PatcherData
|
||||
|
||||
private val opcodes: Opcodes
|
||||
|
||||
init {
|
||||
|
@ -145,12 +142,11 @@ class Patcher(
|
|||
val cacheDirectory = ExtFile(options.resourceCacheDirectory)
|
||||
|
||||
val androlibResources = AndrolibResources().also { resources ->
|
||||
resources.buildOptions = BuildOptions().also { options ->
|
||||
// TODO: options.useAapt2 = true
|
||||
// TODO: options.aaptPath = ""
|
||||
options.isFramework = metaInfo.isFrameworkApk
|
||||
options.resourcesAreCompressed = metaInfo.compressionType
|
||||
options.doNotCompress = metaInfo.doNotCompress
|
||||
resources.buildOptions = BuildOptions().also { buildOptions ->
|
||||
buildOptions.aaptPath = options.aaptPath
|
||||
buildOptions.isFramework = metaInfo.isFrameworkApk
|
||||
buildOptions.resourcesAreCompressed = metaInfo.compressionType
|
||||
buildOptions.doNotCompress = metaInfo.doNotCompress
|
||||
}
|
||||
|
||||
resources.setSdkInfo(metaInfo.sdkInfo)
|
||||
|
|
|
@ -7,10 +7,11 @@ import java.io.File
|
|||
* @param inputFile The input file (usually an apk file).
|
||||
* @param resourceCacheDirectory Directory to cache resources.
|
||||
* @param patchResources Weather to use the resource patcher. Resources will still need to be decoded.
|
||||
* @param aaptPath Optional path to a custom aapt binary.
|
||||
*/
|
||||
data class PatcherOptions(
|
||||
internal val inputFile: File,
|
||||
// TODO: maybe a file system in memory is better. Could cause high memory usage.
|
||||
internal val resourceCacheDirectory: String,
|
||||
internal val patchResources: Boolean = false
|
||||
internal val patchResources: Boolean = false,
|
||||
internal val aaptPath: String = ""
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue