Compare commits

...

17 Commits

Author SHA1 Message Date
semantic-release-bot
e232577e33 chore(release): 1.1.1-dev.1 [skip ci]
## [1.1.1-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.0...v1.1.1-dev.1) (2023-10-04)

### Performance Improvements

* Use maps to set options ([13823b7](13823b74db))
2023-10-04 02:22:01 +00:00
oSumAtrIX
771c9d7165 build(Needs bump): Bump dependencies 2023-10-04 04:20:11 +02:00
oSumAtrIX
13823b74db perf: Use maps to set options 2023-10-04 04:08:07 +02:00
oSumAtrIX
fbe5c39227 build: Bump dependencies 2023-10-02 15:38:38 +02:00
semantic-release-bot
c6e85466ed chore(release): 1.1.0 [skip ci]
# [1.1.0](https://github.com/ReVanced/revanced-library/compare/v1.0.1...v1.1.0) (2023-10-01)

### Bug Fixes

* Only load the keystore once per instantiation ([5993f7e](5993f7e568))
* Use correct function name casing ([ef38d8b](ef38d8b4bf))

### Features

* Increase the key size to 4096 ([892e083](892e0835c6))
2023-10-01 17:06:40 +00:00
oSumAtrIX
2ec24dbb70 chore: Merge branch dev to main (#8) 2023-10-01 19:04:59 +02:00
oSumAtrIX
9fd895cb56 ci: Bump checkout action 2023-09-27 18:02:49 +02:00
semantic-release-bot
c3f297b65d chore(release): 1.1.0-dev.2 [skip ci]
# [1.1.0-dev.2](https://github.com/ReVanced/revanced-library/compare/v1.1.0-dev.1...v1.1.0-dev.2) (2023-09-25)

### Bug Fixes

* Use correct function name casing ([ef38d8b](ef38d8b4bf))
2023-09-25 18:10:37 +00:00
oSumAtrIX
ef38d8b4bf fix: Use correct function name casing 2023-09-25 20:09:07 +02:00
semantic-release-bot
59ab008030 chore(release): 1.1.0-dev.1 [skip ci]
# [1.1.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.2-dev.1...v1.1.0-dev.1) (2023-09-25)

### Features

* Increase the key size to 4096 ([892e083](892e0835c6))
2023-09-25 17:10:21 +00:00
oSumAtrIX
892e0835c6 feat: Increase the key size to 4096 2023-09-25 19:08:42 +02:00
semantic-release-bot
fc61954e5d chore(release): 1.0.2-dev.1 [skip ci]
## [1.0.2-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.1...v1.0.2-dev.1) (2023-09-25)

### Bug Fixes

* Only load the keystore once per instantiation ([5993f7e](5993f7e568))
2023-09-25 17:03:40 +00:00
oSumAtrIX
5993f7e568 fix: Only load the keystore once per instantiation 2023-09-25 19:02:07 +02:00
semantic-release-bot
fda383ade5 chore(release): 1.0.1 [skip ci]
## [1.0.1](https://github.com/ReVanced/revanced-library/compare/v1.0.0...v1.0.1) (2023-09-24)

### Bug Fixes

* Check if file exists before trying to open it ([8ddc6e9](8ddc6e9d6f))
2023-09-24 22:01:32 +00:00
oSumAtrIX
5aab127d9b chore: Merge branch dev to main (#5) 2023-09-24 23:59:58 +02:00
semantic-release-bot
f0b3eb7800 chore(release): 1.0.1-dev.1 [skip ci]
## [1.0.1-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.0...v1.0.1-dev.1) (2023-09-24)

### Bug Fixes

* Check if file exists before trying to open it ([8ddc6e9](8ddc6e9d6f))
2023-09-24 20:40:37 +00:00
oSumAtrIX
8ddc6e9d6f fix: Check if file exists before trying to open it 2023-09-24 22:36:37 +02:00
9 changed files with 77 additions and 14 deletions

View File

@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Make sure the release step uses its own credentials:
# https://github.com/cycjimmy/semantic-release-action#private-packages

View File

@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Open pull request
uses: repo-sync/pull-request@v2
with:

View File

@@ -1,3 +1,58 @@
## [1.1.1-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.0...v1.1.1-dev.1) (2023-10-04)
### Performance Improvements
* Use maps to set options ([13823b7](https://github.com/ReVanced/revanced-library/commit/13823b74db1de3a104b5022b6bf0db0ef945f47b))
# [1.1.0](https://github.com/ReVanced/revanced-library/compare/v1.0.1...v1.1.0) (2023-10-01)
### Bug Fixes
* Only load the keystore once per instantiation ([5993f7e](https://github.com/ReVanced/revanced-library/commit/5993f7e568543c777bee51a140c34fa8953a178a))
* Use correct function name casing ([ef38d8b](https://github.com/ReVanced/revanced-library/commit/ef38d8b4bfe3a79c25fb40588c6217c09574770f))
### Features
* Increase the key size to 4096 ([892e083](https://github.com/ReVanced/revanced-library/commit/892e0835c6b2da0836bd6ba1d8603db1848cc2d9))
# [1.1.0-dev.2](https://github.com/ReVanced/revanced-library/compare/v1.1.0-dev.1...v1.1.0-dev.2) (2023-09-25)
### Bug Fixes
* Use correct function name casing ([ef38d8b](https://github.com/ReVanced/revanced-library/commit/ef38d8b4bfe3a79c25fb40588c6217c09574770f))
# [1.1.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.2-dev.1...v1.1.0-dev.1) (2023-09-25)
### Features
* Increase the key size to 4096 ([892e083](https://github.com/ReVanced/revanced-library/commit/892e0835c6b2da0836bd6ba1d8603db1848cc2d9))
## [1.0.2-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.1...v1.0.2-dev.1) (2023-09-25)
### Bug Fixes
* Only load the keystore once per instantiation ([5993f7e](https://github.com/ReVanced/revanced-library/commit/5993f7e568543c777bee51a140c34fa8953a178a))
## [1.0.1](https://github.com/ReVanced/revanced-library/compare/v1.0.0...v1.0.1) (2023-09-24)
### Bug Fixes
* Check if file exists before trying to open it ([8ddc6e9](https://github.com/ReVanced/revanced-library/commit/8ddc6e9d6f3c41c1528e0d43156d7d811dd6be40))
## [1.0.1-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.0...v1.0.1-dev.1) (2023-09-24)
### Bug Fixes
* Check if file exists before trying to open it ([8ddc6e9](https://github.com/ReVanced/revanced-library/commit/8ddc6e9d6f3c41c1528e0d43156d7d811dd6be40))
# 1.0.0 (2023-09-23)

View File

@@ -2,8 +2,8 @@ public final class app/revanced/library/ApkSigner {
public static final field INSTANCE Lapp/revanced/library/ApkSigner;
public final fun newApkSignerBuilder (Lapp/revanced/library/ApkSigner$PrivateKeyCertificatePair;Ljava/lang/String;Ljava/lang/String;)Lcom/android/apksig/ApkSigner$Builder;
public final fun newApkSignerBuilder (Ljava/security/KeyStore;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/android/apksig/ApkSigner$Builder;
public final fun newKeyStore (Ljava/io/OutputStream;Ljava/lang/String;Ljava/util/List;)V
public final fun newKeyStore (Ljava/util/List;)Ljava/security/KeyStore;
public final fun newKeystore (Ljava/io/OutputStream;Ljava/lang/String;Ljava/util/List;)V
public final fun newPrivateKeyCertificatePair (Ljava/lang/String;Ljava/util/Date;)Lapp/revanced/library/ApkSigner$PrivateKeyCertificatePair;
public static synthetic fun newPrivateKeyCertificatePair$default (Lapp/revanced/library/ApkSigner;Ljava/lang/String;Ljava/util/Date;ILjava/lang/Object;)Lapp/revanced/library/ApkSigner$PrivateKeyCertificatePair;
public final fun readKeyCertificatePair (Ljava/security/KeyStore;Ljava/lang/String;Ljava/lang/String;)Lapp/revanced/library/ApkSigner$PrivateKeyCertificatePair;

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 1.0.0
version = 1.1.1-dev.1

View File

@@ -5,7 +5,7 @@ jackson-module-kotlin = "2.14.3"
jadb = "2531a28109"
kotlin-reflect = "1.9.0"
kotlin-test = "1.8.20-RC"
revanced-patcher = "15.0.1"
revanced-patcher = "16.0.0"
binary-compatibility-validator = "0.13.2"
[libraries]

View File

@@ -45,7 +45,7 @@ object ApkSigner {
// Generate a new key pair.
val keyPair = KeyPairGenerator.getInstance("RSA").apply {
initialize(2048)
initialize(4096)
}.generateKeyPair()
var serialNumber: BigInteger
@@ -116,8 +116,9 @@ object ApkSigner {
logger.fine("Creating keystore")
return KeyStore.getInstance("BKS", BouncyCastleProvider.PROVIDER_NAME).apply {
load(null)
entries.forEach { entry ->
load(null)
// Add all entries to the keystore.
setKeyEntry(
entry.alias,
@@ -136,7 +137,7 @@ object ApkSigner {
* @param keyStorePassword The password for the keystore.
* @param entries The entries to add to the keystore.
*/
fun newKeystore(
fun newKeyStore(
keyStoreOutputStream: OutputStream,
keyStorePassword: String,
entries: List<KeyStoreEntry>

View File

@@ -61,13 +61,15 @@ object Options {
filter { it.options.any() }.let { patches ->
if (patches.isEmpty()) return
val patchOptions = deserialize(json)
val jsonPatches = deserialize(json).associate {
it.patchName to it.options.associate { option -> option.key to option.value }
}
patches.forEach patch@{ patch ->
patchOptions.find { option -> option.patchName == patch.name!! }?.let {
it.options.forEach { option ->
patches.forEach { patch ->
jsonPatches[patch.name]?.let { jsonPatchOptions ->
jsonPatchOptions.forEach { (option, value) ->
try {
patch.options[option.key] = option.value
patch.options[option] = value
} catch (e: PatchOptionException) {
logger.severe(e.toString())
}

View File

@@ -13,7 +13,12 @@ import java.util.zip.Deflater
class ZipFile(file: File) : Closeable {
private var entries: MutableList<ZipEntry> = mutableListOf()
private val filePointer: RandomAccessFile = RandomAccessFile(file, if (file.canWrite()) "rw" else "r")
// Open file for writing if it doesn't exist (because the intention is to write) or is writable.
private val filePointer: RandomAccessFile = RandomAccessFile(
file,
if (!file.exists() || file.canWrite()) "rw" else "r"
)
private var centralDirectoryNeedsRewrite = false
private val compressionLevel = 5