mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-13 02:14:27 +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.
|
* The ReVanced Patcher.
|
||||||
* @param options The options for the patcher.
|
* @param options The options for the patcher.
|
||||||
*/
|
*/
|
||||||
class Patcher(
|
class Patcher(private val options: PatcherOptions) {
|
||||||
private val options: PatcherOptions
|
|
||||||
) {
|
|
||||||
val data: PatcherData
|
val data: PatcherData
|
||||||
|
|
||||||
private val opcodes: Opcodes
|
private val opcodes: Opcodes
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
@ -145,12 +142,11 @@ class Patcher(
|
||||||
val cacheDirectory = ExtFile(options.resourceCacheDirectory)
|
val cacheDirectory = ExtFile(options.resourceCacheDirectory)
|
||||||
|
|
||||||
val androlibResources = AndrolibResources().also { resources ->
|
val androlibResources = AndrolibResources().also { resources ->
|
||||||
resources.buildOptions = BuildOptions().also { options ->
|
resources.buildOptions = BuildOptions().also { buildOptions ->
|
||||||
// TODO: options.useAapt2 = true
|
buildOptions.aaptPath = options.aaptPath
|
||||||
// TODO: options.aaptPath = ""
|
buildOptions.isFramework = metaInfo.isFrameworkApk
|
||||||
options.isFramework = metaInfo.isFrameworkApk
|
buildOptions.resourcesAreCompressed = metaInfo.compressionType
|
||||||
options.resourcesAreCompressed = metaInfo.compressionType
|
buildOptions.doNotCompress = metaInfo.doNotCompress
|
||||||
options.doNotCompress = metaInfo.doNotCompress
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resources.setSdkInfo(metaInfo.sdkInfo)
|
resources.setSdkInfo(metaInfo.sdkInfo)
|
||||||
|
|
|
@ -7,10 +7,11 @@ import java.io.File
|
||||||
* @param inputFile The input file (usually an apk file).
|
* @param inputFile The input file (usually an apk file).
|
||||||
* @param resourceCacheDirectory Directory to cache resources.
|
* @param resourceCacheDirectory Directory to cache resources.
|
||||||
* @param patchResources Weather to use the resource patcher. Resources will still need to be decoded.
|
* @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(
|
data class PatcherOptions(
|
||||||
internal val inputFile: File,
|
internal val inputFile: File,
|
||||||
// TODO: maybe a file system in memory is better. Could cause high memory usage.
|
|
||||||
internal val resourceCacheDirectory: String,
|
internal val resourceCacheDirectory: String,
|
||||||
internal val patchResources: Boolean = false
|
internal val patchResources: Boolean = false,
|
||||||
|
internal val aaptPath: String = ""
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue