Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump org.jetbrains.kotlinx:kotlinx-coroutines-core from 1.7.3 to 1.8.0 #281

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ body:
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="../../assets/revanced-headline/revanced-headline-vertical-dark.svg"
srcset="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="../../assets/revanced-headline/revanced-headline-vertical-light.svg"
src="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="../../assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="../../assets/revanced-logo/revanced-logo.svg" />
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ body:
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="../../assets/revanced-headline/revanced-headline-vertical-dark.svg"
srcset="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="../../assets/revanced-headline/revanced-headline-vertical-light.svg"
src="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="../../assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="../../assets/revanced-logo/revanced-logo.svg" />
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="https://raw.githubusercontent.com/revanced/revanced-patcher/main/assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ This document describes how to contribute to ReVanced Patcher.
## 🙏 Submitting a feature request

Features can be requested by opening an issue using the
[Feature request issue template](https://github.com/ReVanced/revanced-patcher/issues/new?assignees=&labels=Feature+request&projects=&template=feature-request.yml&title=feat%3A+).
[Feature request issue template](https://github.com/ReVanced/revanced-patcher/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 Patcher.
Expand All @@ -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 Patcher, open an issue using the
[Bug report issue template](https://github.com/ReVanced/revanced-patcher/issues/new?assignees=&labels=Bug+report&projects=&template=bug-report.yml&title=bug%3A+).
[Bug report issue template](https://github.com/ReVanced/revanced-patcher/issues/new?assignees=&labels=Bug+report&projects=&template=bug_report.yml&title=bug%3A+).

## 📝 How to contribute

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ you can follow the [ReVanced documentation](https://github.com/ReVanced/revanced
### 📃 Documentation

The documentation contains the fundamentals of ReVanced Patcher and how to use ReVanced Patcher to create patches.
You can find it [here](https://github.com/ReVanced/revanced-patcher/tree/docs/docs).
You can find it [here](https://github.com/ReVanced/revanced-patcher/tree/main/docs).

## 📜 Licence

Expand Down
22 changes: 11 additions & 11 deletions docs/2_1_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

# 👶 Setting up a development environment

To get started developing patches with ReVanced Patcher, you need to prepare a development environment.
To start developing patches with ReVanced Patcher, you must prepare a development environment.

## 📝 Prerequisites

Expand All @@ -84,16 +84,16 @@ Throughout the documentation, [ReVanced Patches](https://github.com/revanced/rev
./gradlew build
```

> [!NOTE]
> If the build fails due to authentication, you may need to authenticate to GitHub Packages.
> Create a PAT with the scope `read:packages` [here](https://github.com/settings/tokens/new?scopes=read:packages&description=ReVanced) and add your token to ~/.gradle/gradle.properties.
>
> Example `gradle.properties` file:
>
> ```properties
> gpr.user = user
> gpr.key = key
> ```
> [!NOTE]
> If the build fails due to authentication, you may need to authenticate to GitHub Packages.
> Create a PAT with the scope `read:packages` [here](https://github.com/settings/tokens/new?scopes=read:packages&description=ReVanced) and add your token to ~/.gradle/gradle.properties.
>
> Example `gradle.properties` file:
>
> ```properties
> gpr.user = user
> gpr.key = key
> ```

3. Open the project in your IDE

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
android = "4.1.1.4"
apktool-lib = "2.9.3"
kotlin = "1.9.22"
kotlinx-coroutines-core = "1.7.3"
kotlinx-coroutines-core = "1.8.0"
multidexlib2 = "3.0.3.r3"
smali = "3.0.4"
binary-compatibility-validator = "0.14.0"
Expand Down
90 changes: 45 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"gradle-semantic-release-plugin": "^1.9.1",
"semantic-release": "^23.0.0"
"semantic-release": "^23.0.2"
}
}
15 changes: 1 addition & 14 deletions src/main/kotlin/app/revanced/patcher/Patcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package app.revanced.patcher
import app.revanced.patcher.PatchBundleLoader.Utils.getInstance
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.fingerprint.LookupMap
import app.revanced.patcher.fingerprint.MethodFingerprint.Companion.resolveUsingLookupMap
import app.revanced.patcher.patch.*
import kotlinx.coroutines.flow.flow
import java.io.Closeable
Expand Down Expand Up @@ -166,19 +165,7 @@ class Patcher(
}

return try {
// TODO: Implement this in a more polymorphic way.
when (patch) {
is BytecodePatch -> {
patch.fingerprints.resolveUsingLookupMap(context.bytecodeContext)
patch.execute(context.bytecodeContext)
}
is RawResourcePatch -> {
patch.execute(context.resourceContext)
}
is ResourcePatch -> {
patch.execute(context.resourceContext)
}
}
patch.execute(context)

PatchResult(patch)
} catch (exception: PatchException) {
Expand Down
7 changes: 7 additions & 0 deletions src/main/kotlin/app/revanced/patcher/patch/BytecodePatch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package app.revanced.patcher.patch

import app.revanced.patcher.PatchClass
import app.revanced.patcher.Patcher
import app.revanced.patcher.PatcherContext
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.fingerprint.MethodFingerprint
import app.revanced.patcher.fingerprint.MethodFingerprint.Companion.resolveUsingLookupMap
import java.io.Closeable

/**
Expand Down Expand Up @@ -58,4 +60,9 @@ abstract class BytecodePatch : Patch<BytecodeContext> {
ReplaceWith("BytecodePatch(emptySet())"),
)
constructor() : this(emptySet())

override fun execute(context: PatcherContext) {
fingerprints.resolveUsingLookupMap(context.bytecodeContext)
execute(context.bytecodeContext)
}
}
9 changes: 9 additions & 0 deletions src/main/kotlin/app/revanced/patcher/patch/Patch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package app.revanced.patcher.patch

import app.revanced.patcher.PatchClass
import app.revanced.patcher.Patcher
import app.revanced.patcher.PatcherContext
import app.revanced.patcher.data.Context
import app.revanced.patcher.extensions.AnnotationExtensions.findAnnotationRecursively
import app.revanced.patcher.patch.options.PatchOptions
Expand Down Expand Up @@ -90,6 +91,14 @@ sealed class Patch<out T : Context<*>> {
*/
val options = PatchOptions()

/**
* The execution function of the patch.
* This function is called by [Patcher].
*
* @param context The [PatcherContext] the patch will work on.
*/
internal abstract fun execute(context: PatcherContext)

/**
* The execution function of the patch.
*
Expand Down
Loading
Loading