You've already forked revanced-patcher
mirror of
https://github.com/revanced/revanced-patcher
synced 2025-09-06 16:38:50 +02:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3ee1c01430 | ||
![]() |
64bae884dc | ||
![]() |
e94a706949 | ||
![]() |
89bb43066b | ||
![]() |
68174bbd6b | ||
![]() |
d05c9416d6 | ||
![]() |
5a2f02b97d | ||
![]() |
a3005fa08e | ||
![]() |
6628b7870f | ||
![]() |
a6411245aa | ||
![]() |
365e1d7a45 |
33
CHANGELOG.md
33
CHANGELOG.md
@@ -1,3 +1,36 @@
|
||||
# [1.5.0](https://github.com/revanced/revanced-patcher/compare/v1.4.0...v1.5.0) (2022-06-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* use streams to write the dex files ([64bae88](https://github.com/revanced/revanced-patcher/commit/64bae884dcb72550a3218e149f3ca0fd0ca03aaf))
|
||||
|
||||
# [1.4.0](https://github.com/revanced/revanced-patcher/compare/v1.3.4...v1.4.0) (2022-06-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* return a `File` instance instead of `ExtFile` ([68174bb](https://github.com/revanced/revanced-patcher/commit/68174bbd6b4df47a91b610c2b97dbae55b594163))
|
||||
|
||||
## [1.3.4](https://github.com/revanced/revanced-patcher/compare/v1.3.3...v1.3.4) (2022-06-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `String.toInstructions` defaulting `forStaticMethod` to `false` ([5a2f02b](https://github.com/revanced/revanced-patcher/commit/5a2f02b97dcde95dbe901fa68cca6c6c0219cb82)), closes [revanced/revanced-patches#46](https://github.com/revanced/revanced-patches/issues/46)
|
||||
|
||||
## [1.3.3](https://github.com/revanced/revanced-patcher/compare/v1.3.2...v1.3.3) (2022-06-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add docs (trigger release) ([6628b78](https://github.com/revanced/revanced-patcher/commit/6628b7870fc052da40be0d50a7e2b0b6c57743cc))
|
||||
|
||||
|
||||
### Reverts
|
||||
|
||||
* propagate dependencies ([365e1d7](https://github.com/revanced/revanced-patcher/commit/365e1d7a4507b918a4c8170ce2c88f6c8ff1d474))
|
||||
|
||||
## [1.3.2](https://github.com/revanced/revanced-patcher/compare/v1.3.1...v1.3.2) (2022-06-21)
|
||||
|
||||
|
||||
|
@@ -21,15 +21,10 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib"))
|
||||
implementation(kotlin("reflect"))
|
||||
|
||||
implementation("xpp3:xpp3:1.1.4c")
|
||||
implementation("app.revanced:multidexlib2:2.5.2.r2")
|
||||
implementation("org.smali:smali:2.5.2")
|
||||
|
||||
implementation("org.apktool:apktool-lib:2.6.5-SNAPSHOT")
|
||||
api("org.apktool:brut.j.dir:2.6.5-SNAPSHOT")
|
||||
|
||||
testImplementation(kotlin("test"))
|
||||
}
|
||||
|
@@ -1,2 +1,2 @@
|
||||
kotlin.code.style = official
|
||||
version = 1.3.2
|
||||
version = 1.5.0
|
||||
|
@@ -137,7 +137,7 @@ class Patcher(private val options: PatcherOptions) {
|
||||
fun save(): PatcherResult {
|
||||
val packageMetadata = data.packageMetadata
|
||||
val metaInfo = packageMetadata.metaInfo
|
||||
var resourceFile: ExtFile? = null
|
||||
var resourceFile: File? = null
|
||||
|
||||
if (options.patchResources) {
|
||||
val cacheDirectory = ExtFile(options.resourceCacheDirectory)
|
||||
@@ -178,7 +178,7 @@ class Patcher(private val options: PatcherOptions) {
|
||||
null, includedFiles
|
||||
)
|
||||
|
||||
resourceFile = ExtFile(aaptFile)
|
||||
resourceFile = aaptFile
|
||||
}
|
||||
|
||||
val newDexFile = object : DexFile {
|
||||
@@ -201,7 +201,7 @@ class Patcher(private val options: PatcherOptions) {
|
||||
|
||||
return PatcherResult(
|
||||
dexFiles.map {
|
||||
app.revanced.patcher.util.dex.DexFile(it.key, it.value)
|
||||
app.revanced.patcher.util.dex.DexFile(it.key, it.value.readAt(0))
|
||||
},
|
||||
metaInfo.doNotCompress.toList(),
|
||||
resourceFile
|
||||
|
@@ -2,14 +2,16 @@ package app.revanced.patcher
|
||||
|
||||
import app.revanced.patcher.util.dex.DexFile
|
||||
import brut.directory.ExtFile
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* The result of a patcher.
|
||||
* @param dexFiles The patched dex files.
|
||||
* @param doNotCompress List of relative paths to files to exclude from compressing.
|
||||
* @param resourceFile File containing resources that need to be extracted into the APK.
|
||||
*/
|
||||
data class PatcherResult(
|
||||
val dexFiles: List<DexFile>,
|
||||
val doNotCompress: List<String>? = null,
|
||||
val resourceFile: ExtFile?
|
||||
val resourceFile: File?
|
||||
)
|
@@ -1,10 +1,10 @@
|
||||
package app.revanced.patcher.util.dex
|
||||
|
||||
import org.jf.dexlib2.writer.io.MemoryDataStore
|
||||
import java.io.InputStream
|
||||
|
||||
/**
|
||||
* Wrapper for dex files.
|
||||
* @param name The original name of the dex file
|
||||
* @param memoryDataStore The data store for the dex file.
|
||||
* @param name The original name of the dex file.
|
||||
* @param dexFileInputStream The dex file as [InputStream].
|
||||
*/
|
||||
data class DexFile(val name: String, val memoryDataStore: MemoryDataStore)
|
||||
data class DexFile(val name: String, val dexFileInputStream: InputStream)
|
@@ -67,7 +67,8 @@ class InlineSmaliCompiler {
|
||||
fun String.toInstructions(templateMethod: Method? = null) = InlineSmaliCompiler.compile(this,
|
||||
templateMethod?.parameters?.joinToString("") { it } ?: "",
|
||||
templateMethod?.implementation?.registerCount ?: 1,
|
||||
(templateMethod?.accessFlags ?: 0) and AccessFlags.STATIC.value != 0)
|
||||
templateMethod?.let { AccessFlags.STATIC.isSet(it.accessFlags) } ?: true
|
||||
)
|
||||
|
||||
/**
|
||||
* Compile a line of Smali code to an instruction.
|
||||
|
Reference in New Issue
Block a user