diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 3f8802559a..99d3aa2e4c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -16,6 +16,8 @@ on:
jobs:
release:
name: Release
+ permissions:
+ contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -35,8 +37,7 @@ jobs:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
- channel: "stable"
- flutter-version: 3.24.x
+ channel: stable
- name: Install dependencies
run: npm ci
@@ -50,13 +51,15 @@ jobs:
- name: Generate code files
run: dart run build_runner build --delete-conflicting-outputs
+ - name: Setup keystore
+ run: |
+ echo "${{ secrets.KEYSTORE }}" | base64 --decode > "keystore.jks"}
+
- name: Release
env:
- GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
- signingKey: "keystore.jks"
- keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
- keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }}
- keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
+ KEYSTORE_ENTRY_ALIAS: ${{ secrets.KEYSTORE_ENTRY_ALIAS }}
+ KEYSTORE_ENTRY_PASSWORD: ${{ secrets.KEYSTORE_ENTRY_PASSWORD }}
run: |
- echo "${{ secrets.SIGNING_KEYSTORE }}" | base64 --decode > android/app/keystore.jks
npx semantic-release
diff --git a/.github/workflows/sync_crowdin.yml b/.github/workflows/sync_crowdin.yml
index fb6aafe0d4..a802dfe019 100644
--- a/.github/workflows/sync_crowdin.yml
+++ b/.github/workflows/sync_crowdin.yml
@@ -68,6 +68,5 @@ jobs:
git config user.name revanced-bot
git config user.email github@revanced.app
sudo chown -R $USER:$USER .git
- git add assets/i18n/strings.*.json
- git commit -m "chore: Remove empty values from JSON" assets/i18n/strings.*.json
+ git commit -m "chore: Remove empty values from JSON" assets/i18n/strings_*.json
git push origin HEAD:feat/translations
diff --git a/.gitignore b/.gitignore
index 88e4e5c76e..8c96735ab6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,50 +1,54 @@
-# See https://www.dartlang.org/guides/libraries/private-files
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+migrate_working_dir/
-# Files and directories created by pub
-.dart_tool/
-.packages
-build/
-# If you're building an application, you may want to check-in your pubspec.lock
-# pubspec.lock
-
-# Directory created by dartdoc
-# If you don't generate documentation locally you can remove this line.
-doc/api/
-
-# dotenv environment variables file
-.env*
-
-# Avoid committing generated Javascript files:
-*.dart.js
-*.info.json # Produced by the --dump-info flag.
-*.js # When generated by dart2js. Don't specify *.js if your
- # project includes source files written in JavaScript.
-*.js_
-*.js.deps
-*.js.map
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+
+# Flutter/Dart/Pub related
+**/doc/api/
+**/ios/Flutter/.last_build_id
+.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
+.pub-cache/
+.pub/
+/build/
-# Generated Builder file
-**/*.g.dart
-**/*.locator.dart
-**/*.router.dart
+# Symbolication related
+app.*.symbols
-flutter_*.png
+# Obfuscation related
+app.*.map.json
-#### Custom
+# Android Studio will place build artifacts here
+/android/app/debug
+/android/app/profile
+/android/app/release
-local.properties
-
-# IntelliJ related
-*.iml
-*.ipr
-*.iws
-.idea/
+# Generated files
+**/*.g.dart
+**/*.locator.dart
+**/*.router.dart
-# Node Dependency directories
+# Project specific
node_modules/
+.vscode/
+
-# FVM
-.fvm
\ No newline at end of file
diff --git a/.metadata b/.metadata
index e7c1001054..c689480b51 100644
--- a/.metadata
+++ b/.metadata
@@ -1,11 +1,11 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
-# This file should be version controlled.
+# This file should be version controlled and should not be manually edited.
version:
- revision: 85684f9300908116a78138ea4c6036c35c9a1236
- channel: stable
+ revision: "2663184aa79047d0a33a14a3b607954f8fdd8730"
+ channel: "stable"
project_type: app
@@ -13,26 +13,11 @@ project_type: app
migration:
platforms:
- platform: root
- create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
- base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
+ create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
+ base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
- platform: android
- create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
- base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
- - platform: ios
- create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
- base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
- - platform: linux
- create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
- base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
- - platform: macos
- create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
- base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
- - platform: web
- create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
- base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
- - platform: windows
- create_revision: 85684f9300908116a78138ea4c6036c35c9a1236
- base_revision: 85684f9300908116a78138ea4c6036c35c9a1236
+ create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
+ base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
# User provided section
diff --git a/.releaserc b/.releaserc
index fbb1210049..5ceed3a89d 100644
--- a/.releaserc
+++ b/.releaserc
@@ -17,15 +17,10 @@
"@semantic-release/changelog",
"@semantic-release/release-notes-generator",
[
- "@droidsolutions-oss/semantic-release-update-file",
+ "semantic-release-pub",
{
- "files": [
- {
- "path": ["pubspec.yaml"],
- "type": "flutter",
- "branches": ["main", "dev"]
- }
- ]
+ "publishPub": false,
+ "updateBuildNumber": true
}
],
[
@@ -48,7 +43,10 @@
"assets": [
{
"path": "build/app/outputs/apk/release/revanced-manager*.apk"
- }
+ },
+ ],
+ "commits": [
+ "message": "chore: Release v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
],
"successComment": false
}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
deleted file mode 100644
index a09c28f5e6..0000000000
--- a/.vscode/tasks.json
+++ /dev/null
@@ -1,91 +0,0 @@
-{
- "version": "2.0.0",
- "tasks": [
- {
- "label": "Generate (Builder)",
- "type": "shell",
- "command": "flutter packages pub run build_runner build --delete-conflicting-outputs",
- "problemMatcher": []
- },
- {
- "label": "Build (Android)",
- "type": "shell",
- "command": "flutter build apk",
- "problemMatcher": [],
- "group": {
- "kind": "build",
- "isDefault": true
- }
- },
- {
- "label": "Install (Android)",
- "type": "shell",
- "command": "adb install build\\app\\outputs\\flutter-apk\\app-release.apk",
- "problemMatcher": []
- },
- {
- "label": "Clean (Flutter)",
- "type": "shell",
- "command": "flutter clean && flutter pub get",
- "problemMatcher": []
- },
- {
- "label": "Clean (Builder)",
- "type": "shell",
- "command": "flutter packages pub run build_runner clean",
- "problemMatcher": []
- },
- {
- "label": "Build all (Android)",
- "dependsOrder": "sequence",
- "dependsOn": [
- "Generate (Builder)",
- "Build (Android)"
- ],
- "problemMatcher": []
- },
- {
- "label": "Clean all",
- "dependsOrder": "sequence",
- "dependsOn": [
- "Clean (Flutter)",
- "Clean (Builder)"
- ],
- "problemMatcher": []
- },
- {
- "label": "Clean all & Build all (Android)",
- "dependsOrder": "sequence",
- "dependsOn": [
- "Clean all",
- "Build all (Android)"
- ],
- "problemMatcher": []
- },
- {
- "label": "Clean all & Install (Android)",
- "dependsOrder": "sequence",
- "dependsOn": [
- "Clean all",
- "Build all (Android)",
- "Install (Android)",
- ],
- "problemMatcher": []
- },
- {
- "label": "Build & Install (Android)",
- "dependsOrder": "sequence",
- "dependsOn": [
- "Build (Android)",
- "Install (Android)"
- ],
- "problemMatcher": []
- },
- {
- "label": "Validate translations",
- "type": "shell",
- "command": "flutter pub run flutter_i18n diff en.json pt.json",
- "problemMatcher": []
- }
- ]
-}
diff --git a/android/.gitignore b/android/.gitignore
index 6f568019d3..55afd919c6 100644
--- a/android/.gitignore
+++ b/android/.gitignore
@@ -7,7 +7,7 @@ gradle-wrapper.jar
GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
-# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
+# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
diff --git a/android/Gemfile b/android/Gemfile
deleted file mode 100644
index 7a118b49be..0000000000
--- a/android/Gemfile
+++ /dev/null
@@ -1,3 +0,0 @@
-source "https://rubygems.org"
-
-gem "fastlane"
diff --git a/android/app/build.gradle b/android/app/build.gradle
deleted file mode 100644
index 94a137717d..0000000000
--- a/android/app/build.gradle
+++ /dev/null
@@ -1,114 +0,0 @@
-plugins {
- id "com.android.application"
- id "kotlin-android"
- id "dev.flutter.flutter-gradle-plugin"
-}
-
-def localProperties = new Properties()
-def localPropertiesFile = rootProject.file('local.properties')
-if (localPropertiesFile.exists()) {
- localPropertiesFile.withReader('UTF-8') { reader ->
- localProperties.load(reader)
- }
-}
-
-def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
-if (flutterVersionCode == null) {
- flutterVersionCode = '1'
-}
-
-def flutterVersionName = localProperties.getProperty('flutter.versionName')
-if (flutterVersionName == null) {
- flutterVersionName = '1.0'
-}
-
-android {
- compileSdk 34
-
- compileOptions {
- coreLibraryDesugaringEnabled true
- sourceCompatibility JavaVersion.VERSION_17
- targetCompatibility JavaVersion.VERSION_17
- }
- kotlinOptions {
- jvmTarget = '17'
- }
- sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
- }
- defaultConfig {
- applicationId "app.revanced.manager.flutter"
- minSdk 26
- targetSdk 34
- versionCode flutterVersionCode.toInteger()
- versionName flutterVersionName
- }
- buildTypes {
- configureEach {
- shrinkResources = false
- minifyEnabled = false
- signingConfig signingConfigs.debug
- ndk {
- abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
- }
- }
- release {
- shrinkResources true
- minifyEnabled true
- if (System.getenv("signingKey") != null) {
- signingConfigs {
- create("release") {
- storeFile = file(System.getenv("signingKey"))
- storePassword = System.getenv("keyStorePassword")
- keyAlias = System.getenv("keyAlias")
- keyPassword = System.getenv("keyPassword")
- }
- }
- signingConfig = signingConfigs.release
- resValue "string", "app_name", "ReVanced Manager"
- applicationVariants.all { variant ->
- variant.outputs.all {
- outputFileName = "revanced-manager-v${flutterVersionName}.apk"
- }
- }
- } else {
- signingConfig = signingConfigs.debug
- resValue "string", "app_name", "ReVanced Manager (Debug)"
- applicationIdSuffix ".debug"
- }
- }
- debug {
- resValue "string", "app_name", "ReVanced Manager (Debug)"
- applicationIdSuffix ".debug"
- }
- profile {
- resValue "string", "app_name", "ReVanced Manager (Profile)"
- applicationIdSuffix ".profile"
- }
- }
- packagingOptions {
- jniLibs {
- useLegacyPackaging true
- excludes += ['/prebuilt/**']
- }
- resources {
- excludes += ['/prebuilt/**']
- }
- }
-
- namespace 'app.revanced.manager.flutter'
-}
-
-kotlin {
- jvmToolchain(17)
-}
-
-flutter {
- source '../..'
-}
-
-dependencies {
- coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4") // https://pub.dev/packages/flutter_local_notifications#gradle-setup
- implementation("app.revanced:revanced-patcher:19.3.1")
- implementation("app.revanced:revanced-library:2.2.1")
-}
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
new file mode 100644
index 0000000000..09ff84d25d
--- /dev/null
+++ b/android/app/build.gradle.kts
@@ -0,0 +1,104 @@
+plugins {
+ id("com.android.application")
+ id("kotlin-android")
+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
+ id("dev.flutter.flutter-gradle-plugin")
+}
+
+android {
+ namespace = "app.revanced.manager.flutter"
+ compileSdk = 35
+ ndkVersion = "27.0.12077973"
+
+ compileOptions {
+ isCoreLibraryDesugaringEnabled = true
+
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ }
+
+ kotlinOptions {
+ jvmTarget = JavaVersion.VERSION_17.toString()
+ }
+
+ defaultConfig {
+ applicationId = "app.revanced.manager.flutter"
+ minSdk = 26
+ targetSdk = 35
+ versionCode = flutter.versionCode
+ versionName = flutter.versionName
+
+ resValue("string", "app_name", "ReVanced Manager")
+ }
+
+ applicationVariants.all {
+ outputs.all {
+ this as com.android.build.gradle.internal.api.ApkVariantOutputImpl
+
+ outputFileName = "revanced-manager-$versionName.apk"
+ }
+ }
+
+ buildTypes {
+ configureEach {
+ isShrinkResources = false
+ isMinifyEnabled = false
+
+ signingConfig = signingConfigs["debug"]
+
+ ndk.abiFilters += setOf("armeabi-v7a", "arm64-v8a", "x86_64")
+ }
+
+ release {
+ isShrinkResources = true
+ isMinifyEnabled = true
+
+ val keystoreFile = file("keystore.jks")
+ if (keystoreFile.exists()) {
+ signingConfig = signingConfigs.create("release") {
+ storeFile = keystoreFile
+ storePassword = System.getenv("KEYSTORE_PASSWORD")
+ keyAlias = System.getenv("KEYSTORE_ENTRY_ALIAS")
+ keyPassword = System.getenv("KEYSTORE_ENTRY_PASSWORD")
+ }
+
+ resValue("string", "app_name", "ReVanced Manager")
+ } else {
+ applicationIdSuffix = ".debug"
+
+ signingConfig = signingConfigs["debug"]
+
+ resValue("string", "app_name", "ReVanced Manager (Debug signed)")
+ }
+ }
+
+ debug {
+ applicationIdSuffix = ".debug"
+
+ resValue("string", "app_name", "ReVanced Manager (Debug)")
+ }
+ }
+
+ packaging {
+ jniLibs {
+ useLegacyPackaging = true
+ excludes.add("/prebuilt/**")
+ }
+
+ resources {
+ excludes.add("/prebuilt/**")
+ }
+ }
+}
+
+
+flutter {
+ source = "../.."
+}
+
+dependencies {
+ coreLibraryDesugaring(libs.desugar.jdk.libs) // https://pub.dev/packages/flutter_local_notifications#gradle-setup
+ implementation(libs.revanced.patcher)
+ implementation(libs.revanced.library)
+}
+
diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro
index ce5df91fdf..88daa53dcb 100644
--- a/android/app/proguard-rules.pro
+++ b/android/app/proguard-rules.pro
@@ -1,10 +1,3 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.kts.kts.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-dontobfuscate
-keep class app.revanced.** { *; }
diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml
index bbd7ee7776..399f6981d5 100644
--- a/android/app/src/debug/AndroidManifest.xml
+++ b/android/app/src/debug/AndroidManifest.xml
@@ -1,3 +1,7 @@
+
diff --git a/android/app/src/main/kotlin/app/revanced/manager/flutter/ExportSettingsActivity.kt b/android/app/src/main/kotlin/app/revanced/manager/flutter/ExportSettingsActivity.kt
index 6acd083a3a..4290cbcc31 100644
--- a/android/app/src/main/kotlin/app/revanced/manager/flutter/ExportSettingsActivity.kt
+++ b/android/app/src/main/kotlin/app/revanced/manager/flutter/ExportSettingsActivity.kt
@@ -3,7 +3,6 @@ package app.revanced.manager.flutter
import android.app.Activity
import android.content.Context
import android.content.Intent
-import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.os.Bundle
import android.util.Base64
@@ -17,9 +16,8 @@ import java.security.MessageDigest
class ExportSettingsActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
- val callingPackageName = getCallingPackage()!!
- if (getFingerprint(callingPackageName) == getFingerprint(getPackageName())) {
+ if (getFingerprint(callingPackage!!) == getFingerprint(packageName)) {
// Create JSON Object
val json = JSONObject()
@@ -64,7 +62,7 @@ class ExportSettingsActivity : Activity() {
fun getFingerprint(packageName: String): String {
// Get the signature of the app that matches the package name
val packageInfo = packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES)
- val signature = packageInfo.signatures[0]
+ val signature = packageInfo.signatures!![0]
// Get the raw certificate data
val rawCert = signature.toByteArray()
diff --git a/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt b/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt
index 4f4ed0d1f5..4a931db979 100644
--- a/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt
+++ b/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt
@@ -9,14 +9,15 @@ import android.os.Handler
import android.os.Looper
import app.revanced.library.ApkUtils
import app.revanced.library.ApkUtils.applyTo
+import app.revanced.library.installation.installer.LocalInstaller
import app.revanced.manager.flutter.utils.Aapt
import app.revanced.manager.flutter.utils.packageInstaller.InstallerReceiver
import app.revanced.manager.flutter.utils.packageInstaller.UninstallerReceiver
-import app.revanced.patcher.PatchBundleLoader
-import app.revanced.patcher.PatchSet
import app.revanced.patcher.Patcher
import app.revanced.patcher.PatcherConfig
+import app.revanced.patcher.patch.Patch
import app.revanced.patcher.patch.PatchResult
+import app.revanced.patcher.patch.loadPatchesFromDex
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
@@ -37,7 +38,7 @@ class MainActivity : FlutterActivity() {
private var cancel: Boolean = false
private var stopResult: MethodChannel.Result? = null
- private lateinit var patches: PatchSet
+ private lateinit var patches: Set>
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
@@ -70,7 +71,6 @@ class MainActivity : FlutterActivity() {
"runPatcher" -> {
val inFilePath = call.argument("inFilePath")
val outFilePath = call.argument("outFilePath")
- val integrationsPath = call.argument("integrationsPath")
val selectedPatches = call.argument>("selectedPatches")
val options = call.argument