Skip to content

Commit

Permalink
build(Needs bump): Bump ReVanced Patcher & merge ReVanced Integration…
Browse files Browse the repository at this point in the history
…s by using ReVanced Patches Gradle plugin (#3462)
  • Loading branch information
oSumAtrIX authored Oct 26, 2024
2 parents 5848269 + e798a9c commit c7216fc
Show file tree
Hide file tree
Showing 1,671 changed files with 50,953 additions and 32,880 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ jobs:
with:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"

- name: Cache Gradle
uses: burrunan/gradle-cache-action@v1

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/open_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ jobs:
- name: Open pull request
uses: repo-sync/pull-request@v2
with:
destination_branch: "main"
pr_title: "chore: ${{ env.MESSAGE }}"
destination_branch: main
pr_title: 'chore: ${{ env.MESSAGE }}'
pr_body: |
This pull request will ${{ env.MESSAGE }}.
## Before merging this PR
- [ ] Remember about https://github.com/revanced/revanced-integrations
- [ ] Pull translations from Crowdin
pr_draft: true
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ jobs:
persist-credentials: false
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"

- name: Cache Gradle
uses: burrunan/gradle-cache-action@v1

- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew generateMeta clean
run: ./gradlew build clean

- name: Setup Node.js
uses: actions/setup-node@v4
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,8 @@ gradle-app.setting
# Dependency directories
node_modules/

# gradle properties, due to Github token
# Gradle properties, due to Github token
./gradle.properties

# One package is called the same as the Gradle build folder
!**/src/**/build/
2 changes: 1 addition & 1 deletion .idea/misc.xml

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

6 changes: 1 addition & 5 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"assets": [
"CHANGELOG.md",
"gradle.properties",
"patches.json"
],
"message": "chore: Release v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
Expand All @@ -33,11 +32,8 @@
{
"assets": [
{
"path": "build/libs/revanced-patches*"
"path": "patches/build/libs/patches-!(*sources*|*javadoc*).rvp?(.asc)"
},
{
"path": "patches.json"
}
],
successComment: false
}
Expand Down
2,308 changes: 0 additions & 2,308 deletions api/revanced-patches.api

This file was deleted.

155 changes: 0 additions & 155 deletions build.gradle.kts

This file was deleted.

4 changes: 2 additions & 2 deletions crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ api_token_env: "CROWDIN_PERSONAL_TOKEN"

preserve_hierarchy: false
files:
- source: src/main/resources/addresources/values/strings.xml
translation: src/main/resources/addresources/values-%android_code%/strings.xml
- source: patches/src/main/resources/addresources/values/strings.xml
translation: patches/src/main/resources/addresources/values-%android_code%/strings.xml
skip_untranslated_strings: true
11 changes: 11 additions & 0 deletions extensions/remove-screen-capture-restriction/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extension {
name = "extensions/all/screencapture/remove-screen-capture-restriction.rve"
}

android {
namespace = "app.revanced.extension"
}

dependencies {
compileOnly(libs.annotation)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<manifest/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package app.revanced.extension.all.screencapture.removerestriction;

import android.media.AudioAttributes;
import android.os.Build;

import androidx.annotation.RequiresApi;

public final class RemoveScreencaptureRestrictionPatch {
// Member of AudioAttributes.Builder
@RequiresApi(api = Build.VERSION_CODES.Q)
public static AudioAttributes.Builder setAllowedCapturePolicy(final AudioAttributes.Builder builder, final int capturePolicy) {
builder.setAllowedCapturePolicy(AudioAttributes.ALLOW_CAPTURE_BY_ALL);

return builder;
}

// Member of AudioManager static class
public static void setAllowedCapturePolicy(final int capturePolicy) {
// Ignore request
}
}
7 changes: 7 additions & 0 deletions extensions/remove-screenshot-restriction/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extension {
name = "extensions/all/screenshot/remove-screenshot-restriction.rve"
}

android {
namespace = "app.revanced.extension"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<manifest/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package app.revanced.extension.all.screenshot.removerestriction;

import android.view.Window;
import android.view.WindowManager;

public class RemoveScreenshotRestrictionPatch {

public static void addFlags(Window window, int flags) {
window.addFlags(flags & ~WindowManager.LayoutParams.FLAG_SECURE);
}

public static void setFlags(Window window, int flags, int mask) {
window.setFlags(flags & ~WindowManager.LayoutParams.FLAG_SECURE, mask & ~WindowManager.LayoutParams.FLAG_SECURE);
}
}
22 changes: 22 additions & 0 deletions extensions/shared/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
extension {
name = "extensions/shared.rve"
}

android {
namespace = "app.revanced.extension"

buildTypes {
release {
isMinifyEnabled = true
}
}
}

dependencies {
compileOnly(libs.appcompat)
compileOnly(libs.annotation)
compileOnly(libs.okhttp)
compileOnly(libs.retrofit)

compileOnly(project(":extensions:shared:stub"))
}
9 changes: 9 additions & 0 deletions extensions/shared/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-dontobfuscate
-dontoptimize
-keepattributes *
-keep class app.revanced.** {
*;
}
-keep class com.google.** {
*;
}
4 changes: 4 additions & 0 deletions extensions/shared/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package app.revanced.extension.boostforreddit;

import com.rubenmayayo.reddit.ui.activities.WebViewActivity;

import app.revanced.extension.shared.fixes.slink.BaseFixSLinksPatch;

/** @noinspection unused*/
public class FixSLinksPatch extends BaseFixSLinksPatch {
static {
INSTANCE = new FixSLinksPatch();
}

private FixSLinksPatch() {
webViewActivityClass = WebViewActivity.class;
}

public static boolean patchResolveSLink(String link) {
return INSTANCE.resolveSLink(link);
}

public static void patchSetAccessToken(String accessToken) {
INSTANCE.setAccessToken(accessToken);
}
}
Loading

0 comments on commit c7216fc

Please sign in to comment.