From 486a7acff20dcf15125667d6b490c0d4a3603980 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Thu, 15 Feb 2024 02:29:44 +0100 Subject: [PATCH 01/15] ci: Create a GitHub release with changelogs --- .releaserc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.releaserc b/.releaserc index 48f6f5d..8a8bb30 100644 --- a/.releaserc +++ b/.releaserc @@ -32,6 +32,12 @@ backmergeBranches: [{"from": "main", "to": "dev"}], clearWorkspace: true } + ], + [ + "@semantic-release/github", + { + successComment: false + } ] ] } From 244ebc21868c07d1852857f6858c1a53a5561155 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Thu, 15 Feb 2024 02:54:31 +0100 Subject: [PATCH 02/15] feat: Mention APK file name when logging aligning --- src/main/kotlin/app/revanced/library/ApkUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/library/ApkUtils.kt b/src/main/kotlin/app/revanced/library/ApkUtils.kt index f2e43f1..34bc8f9 100644 --- a/src/main/kotlin/app/revanced/library/ApkUtils.kt +++ b/src/main/kotlin/app/revanced/library/ApkUtils.kt @@ -84,7 +84,7 @@ object ApkUtils { } } - logger.info("Aligning APK") + logger.info("Aligning ${apkFile.name}") targetApkZFile.realign() From 1526f98f533398a910521d9735243b85b55b5509 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 15 Feb 2024 03:46:55 +0000 Subject: [PATCH 03/15] chore(release): 2.1.0-dev.1 [skip ci] # [2.1.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v2.0.0...v2.1.0-dev.1) (2024-02-15) ### Features * Mention APK file name when logging aligning ([244ebc2](https://github.com/ReVanced/revanced-library/commit/244ebc21868c07d1852857f6858c1a53a5561155)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a2c9af..6d8ceb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [2.1.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v2.0.0...v2.1.0-dev.1) (2024-02-15) + + +### Features + +* Mention APK file name when logging aligning ([244ebc2](https://github.com/ReVanced/revanced-library/commit/244ebc21868c07d1852857f6858c1a53a5561155)) + # [2.0.0](https://github.com/ReVanced/revanced-library/compare/v1.5.0...v2.0.0) (2024-02-15) diff --git a/gradle.properties b/gradle.properties index 4fd36e1..4951dec 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true kotlin.code.style = official -version = 2.0.0 +version = 2.1.0-dev.1 From d4938c57e8807249225011ffd570c7b26d9dcbe0 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Thu, 22 Feb 2024 04:23:54 +0100 Subject: [PATCH 04/15] ci: Split release into a separate PR build workflow Because the release workflow already runs on dev and main, it is not necessary to also trigger it for PRs. --- .github/workflows/build_pull_request.yml | 25 +++++++++++++++++++ ...pull_request.yml => open_pull_request.yml} | 0 .github/workflows/release.yml | 4 --- 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build_pull_request.yml rename .github/workflows/{pull_request.yml => open_pull_request.yml} (100%) diff --git a/.github/workflows/build_pull_request.yml b/.github/workflows/build_pull_request.yml new file mode 100644 index 0000000..2899502 --- /dev/null +++ b/.github/workflows/build_pull_request.yml @@ -0,0 +1,25 @@ +name: Build pull request + +on: + workflow_dispatch: + pull_request: + branches: + - dev + +jobs: + release: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Cache Gradle + uses: burrunan/gradle-cache-action@v1 + + - name: Build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./gradlew build --no-daemon diff --git a/.github/workflows/pull_request.yml b/.github/workflows/open_pull_request.yml similarity index 100% rename from .github/workflows/pull_request.yml rename to .github/workflows/open_pull_request.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c384f3..2cb2b20 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,10 +6,6 @@ on: branches: - main - dev - pull_request: - branches: - - main - - dev jobs: release: From 24cecb1e5784128847635a3efd41dfa505787a3c Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Fri, 23 Feb 2024 03:03:50 +0100 Subject: [PATCH 05/15] docs: Format markdown code --- CONTRIBUTING.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b1ad077..752eac1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,8 +65,9 @@ This document describes how to contribute to ReVanced Library. ## 📖 Resources to help you get started -* [Our backlog](https://github.com/orgs/ReVanced/projects/12) is where we keep track of what we're working on -* [Issues](https://github.com/ReVanced/revanced-cli/issues) are where we keep track of bugs and feature requests + +- [Our backlog](https://github.com/orgs/ReVanced/projects/12) is where we keep track of what we're working on +- [Issues](https://github.com/ReVanced/revanced-cli/issues) are where we keep track of bugs and feature requests ## 🙏 Submitting a feature request @@ -88,11 +89,11 @@ If you encounter a bug while using ReVanced Library, open an issue using the with the maintainers of ReVanced Library. This will help you determine whether your change is acceptable and whether it is worth your time to implement it 2. Development happens on the `dev` branch. Fork the repository and create your branch from `dev` -3. Commit your changes. +3. Commit your changes 4. Submit a pull request to the `dev` branch of the repository and reference issues that your pull request closes in the description of your pull request 5. Our team will review your pull request and provide feedback. Once your pull request is approved, it will be merged into the `dev` branch and will be included in the next release of ReVanced Library -❤️ Thank you for considering contributing to ReVanced Library, +❤️ Thank you for considering contributing to ReVanced Library, ReVanced From 51d6e9976c03834b88bd1122d1fc1a671ade5d04 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 24 Feb 2024 01:14:44 +0100 Subject: [PATCH 06/15] ci: Fix indentation in workflow --- .github/workflows/build_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_pull_request.yml b/.github/workflows/build_pull_request.yml index 2899502..250871b 100644 --- a/.github/workflows/build_pull_request.yml +++ b/.github/workflows/build_pull_request.yml @@ -22,4 +22,4 @@ jobs: - name: Build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./gradlew build --no-daemon + run: ./gradlew build --no-daemon From 393d74b7d9103adb80b792be445bcf4f1220c902 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 25 Feb 2024 03:14:02 +0100 Subject: [PATCH 07/15] ci: Rename workflow file --- .../{update-documentation.yml => update_documentation.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{update-documentation.yml => update_documentation.yml} (100%) diff --git a/.github/workflows/update-documentation.yml b/.github/workflows/update_documentation.yml similarity index 100% rename from .github/workflows/update-documentation.yml rename to .github/workflows/update_documentation.yml From a73ca721f3c512d7acb3011cc2aa64beed65bd3e Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 25 Feb 2024 03:37:52 +0100 Subject: [PATCH 08/15] chore: Rename issue templates --- .github/ISSUE_TEMPLATE/{bug-report.yml => bug_report.yml} | 0 .../ISSUE_TEMPLATE/{feature-request.yml => feature_request.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/ISSUE_TEMPLATE/{bug-report.yml => bug_report.yml} (100%) rename .github/ISSUE_TEMPLATE/{feature-request.yml => feature_request.yml} (100%) diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/bug-report.yml rename to .github/ISSUE_TEMPLATE/bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/feature-request.yml rename to .github/ISSUE_TEMPLATE/feature_request.yml From 3e574e723c18c335b07d08800f7467cbfc3d9f79 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 25 Feb 2024 04:01:25 +0100 Subject: [PATCH 09/15] docs: Add readme --- README.md | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ac0d03a --- /dev/null +++ b/README.md @@ -0,0 +1,117 @@ +

+ + + + +
+ + + + + +     + + + + + +     + + + + + +     + + + + + +     + + + + + +     + + + + + +     + + + + + + +
+
+ Continuing the legacy of Vanced +

+ +# 📚 ReVanced Library + +![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/ReVanced/revanced-library/release.yml) +![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg) + +Library containing common utilities for ReVanced. + +## ❓ About + +ReVanced Library powers projects such as [ReVanced Manager](https://github.com/ReVanced/revanced-manager), +[ReVanced CLI](https://github.com/ReVanced/revanced-cli) with common utilities and functionalities +by providing shared code. + +## 💪 Features + +Some of the features the ReVanced Library provides are: + +- 📝 **Signing APKs**: Read and write keystores, and sign APK files +- 🧩 **Common utility functions**: Various APIs for ReVanced patches such as JSON serialization, + reading and setting patch options, calculating the most common compatible version for a set of patches and more +- 💾 **Install and uninstall APKs**: Install and uninstall APK files using ADB locally, + using the Android package manager, or by mounting using root permissions +- 📦 **Repackage patched files to an APK**: Apply patched files from + [ReVanced Patcher](https://github.com/revanced/revanced-patcher) to an APK file, and align & sign the APK file automatically + +## 🚀 How to get started + +To use ReVanced Library in your project, follow these steps: + +1. [Add the repository](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package) + to your project +2. Add the dependency to your project: + + ```kt + dependencies { + implementation("app.revanced:revanced-library:{$version}") + } + ``` + +## 📚 Everything else + +### 📙 Contributing + +Thank you for considering contributing to ReVanced Library. +You can find the contribution guidelines [here](CONTRIBUTING.md). + +### 🛠️ Building + +To build ReVanced Library, +you can follow the [ReVanced documentation](https://github.com/ReVanced/revanced-documentation). + +## 📜 Licence + +ReVanced Library is licensed under the GPLv3 license. Please see the [licence file](LICENSE) for more information. +[tl;dr](https://www.tldrlegal.com/license/gnu-general-public-license-v3-gpl-3) you may copy, distribute and modify ReVanced Library as long as you track changes/dates in source files. +Any modifications to ReVanced Library must also be made available under the GPL, +along with build & install instructions. From f28a7ddeec462595ed9eed878485fdd7eb4bf563 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 26 Feb 2024 04:37:46 +0100 Subject: [PATCH 10/15] docs: Fix broken links --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 752eac1..4374c60 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,7 +72,7 @@ This document describes how to contribute to ReVanced Library. ## 🙏 Submitting a feature request Features can be requested by opening an issue using the -[Feature request issue template](https://github.com/ReVanced/revanced-cli/issues/new?assignees=&labels=Feature+request&projects=&template=feature-request.yml&title=feat%3A+). +[Feature request issue template](https://github.com/ReVanced/revanced-cli/issues/new?assignees=&labels=Feature+request&projects=&template=feature_request.yml&title=feat%3A+). > [!NOTE] > Requests can be accepted or rejected at the discretion of maintainers of ReVanced Library. @@ -81,7 +81,7 @@ Features can be requested by opening an issue using the ## 🐞 Submitting a bug report If you encounter a bug while using ReVanced Library, open an issue using the -[Bug report issue template](https://github.com/ReVanced/revanced-cli/issues/new?assignees=&labels=Bug+report&projects=&template=bug-report.yml&title=bug%3A+). +[Bug report issue template](https://github.com/ReVanced/revanced-cli/issues/new?assignees=&labels=Bug+report&projects=&template=bug_report.yml&title=bug%3A+). ## 📝 How to contribute From 0e9939f70de4e8c8dd5c7e0c7f198f678efdfd4d Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 26 Feb 2024 04:37:58 +0100 Subject: [PATCH 11/15] docs: Fix spelling mistakes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ac0d03a..c59b11f 100644 --- a/README.md +++ b/README.md @@ -78,8 +78,8 @@ Some of the features the ReVanced Library provides are: - 📝 **Signing APKs**: Read and write keystores, and sign APK files - 🧩 **Common utility functions**: Various APIs for ReVanced patches such as JSON serialization, reading and setting patch options, calculating the most common compatible version for a set of patches and more -- 💾 **Install and uninstall APKs**: Install and uninstall APK files using ADB locally, - using the Android package manager, or by mounting using root permissions +- 💾 **Install and uninstall APKs**: Install and uninstall APK files via ADB or locally, + the Android package manager, or by mounting using root permissions - 📦 **Repackage patched files to an APK**: Apply patched files from [ReVanced Patcher](https://github.com/revanced/revanced-patcher) to an APK file, and align & sign the APK file automatically From 41805fcb0bdc778fe0870427a0a1caa6d4369cee Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 4 Mar 2024 15:31:26 +0100 Subject: [PATCH 12/15] fix: Use `BKS` instead of default signing provider to fix backwards compatibility --- src/main/kotlin/app/revanced/library/ApkSigner.kt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/revanced/library/ApkSigner.kt b/src/main/kotlin/app/revanced/library/ApkSigner.kt index 75ce9fb..e7c71d9 100644 --- a/src/main/kotlin/app/revanced/library/ApkSigner.kt +++ b/src/main/kotlin/app/revanced/library/ApkSigner.kt @@ -7,6 +7,7 @@ import org.bouncycastle.asn1.x500.X500Name import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo import org.bouncycastle.cert.X509v3CertificateBuilder import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter +import org.bouncycastle.jce.provider.BouncyCastleProvider import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder import java.io.File import java.io.IOException @@ -24,7 +25,13 @@ import kotlin.time.Duration.Companion.days */ @Suppress("MemberVisibilityCanBePrivate", "unused") object ApkSigner { - private val logger = Logger.getLogger(Signer::class.java.name) + private val logger = Logger.getLogger(ApkSigner::class.java.name) + + init { + if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) { + Security.addProvider(BouncyCastleProvider()) + } + } /** * Create a new [PrivateKeyCertificatePair]. @@ -117,7 +124,7 @@ object ApkSigner { fun newKeyStore(entries: Set): KeyStore { logger.fine("Creating keystore") - return KeyStore.getInstance(KeyStore.getDefaultType()).apply { + return newKeyStoreInstance().apply { load(null) entries.forEach { entry -> @@ -132,6 +139,8 @@ object ApkSigner { } } + private fun newKeyStoreInstance() = KeyStore.getInstance("BKS", BouncyCastleProvider.PROVIDER_NAME) + /** * Create a new keystore with a new keypair and saves it to the given [keyStoreOutputStream]. * @@ -164,7 +173,7 @@ object ApkSigner { ): KeyStore { logger.fine("Reading keystore") - return KeyStore.getInstance(KeyStore.getDefaultType()).apply { + return newKeyStoreInstance().apply { try { load(keyStoreInputStream, keyStorePassword?.toCharArray()) } catch (exception: IOException) { From 1670ceff9f93ad953d71813dc8712fa31733072f Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 4 Mar 2024 14:33:02 +0000 Subject: [PATCH 13/15] chore(release): 2.1.0-dev.2 [skip ci] # [2.1.0-dev.2](https://github.com/ReVanced/revanced-library/compare/v2.1.0-dev.1...v2.1.0-dev.2) (2024-03-04) ### Bug Fixes * Use `BKS` instead of default signing provider to fix backwards compatibility ([41805fc](https://github.com/ReVanced/revanced-library/commit/41805fcb0bdc778fe0870427a0a1caa6d4369cee)) --- CHANGELOG.md | 7 +++++++ gradle.properties | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d8ceb5..cc17d27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [2.1.0-dev.2](https://github.com/ReVanced/revanced-library/compare/v2.1.0-dev.1...v2.1.0-dev.2) (2024-03-04) + + +### Bug Fixes + +* Use `BKS` instead of default signing provider to fix backwards compatibility ([41805fc](https://github.com/ReVanced/revanced-library/commit/41805fcb0bdc778fe0870427a0a1caa6d4369cee)) + # [2.1.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v2.0.0...v2.1.0-dev.1) (2024-02-15) diff --git a/gradle.properties b/gradle.properties index 4951dec..83695ea 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ org.gradle.parallel = true org.gradle.caching = true kotlin.code.style = official -version = 2.1.0-dev.1 +version = 2.1.0-dev.2 From 132ad1367061d4bb5d232ed5c5be8304b8ba1b6e Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 4 Mar 2024 15:35:16 +0100 Subject: [PATCH 14/15] build: Bump dependencies --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index afcd91f..e0fc88e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ jadb = "1.2.1" kotlin = "1.9.22" revanced-patcher = "19.3.1" binary-compatibility-validator = "0.14.0" -apkzlib = "8.2.2" +apkzlib = "8.3.0" bcpkix-jdk15on = "1.70" guava = "33.0.0-jre" From dfe48a24bf18818e5274a6ad6835b1ddec3fc76f Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 4 Mar 2024 15:36:03 +0100 Subject: [PATCH 15/15] ci: Update action --- .github/workflows/update_documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_documentation.yml b/.github/workflows/update_documentation.yml index 77097e2..541a7aa 100644 --- a/.github/workflows/update_documentation.yml +++ b/.github/workflows/update_documentation.yml @@ -11,7 +11,7 @@ jobs: name: Dispatch event to documentation repository if: github.ref == 'refs/heads/main' steps: - - uses: peter-evans/repository-dispatch@v2 + - uses: peter-evans/repository-dispatch@v3 with: token: ${{ secrets.DOCUMENTATION_REPO_ACCESS_TOKEN }} repository: revanced/revanced-documentation