Skip to content

Commit

Permalink
chore: Merge branch dev to main (#1350)
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX authored Oct 12, 2023
2 parents 657ba11 + a21b170 commit 38a2fa5
Show file tree
Hide file tree
Showing 36 changed files with 1,905 additions and 399 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

// ReVanced
implementation "app.revanced:revanced-patcher:16.0.2"
implementation "app.revanced:revanced-patcher:17.0.0"

// Signing & aligning
implementation("org.bouncycastle:bcpkix-jdk15on:1.70")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import org.json.JSONObject
import java.io.File
import java.io.PrintWriter
import java.io.StringWriter
import java.lang.Error
import java.util.logging.LogRecord
import java.util.logging.Logger

Expand Down Expand Up @@ -55,6 +54,7 @@ class MainActivity : FlutterActivity() {
val outFilePath = call.argument<String>("outFilePath")
val integrationsPath = call.argument<String>("integrationsPath")
val selectedPatches = call.argument<List<String>>("selectedPatches")
val options = call.argument<Map<String, Map<String, Any>>>("options")
val cacheDirPath = call.argument<String>("cacheDirPath")
val keyStoreFilePath = call.argument<String>("keyStoreFilePath")
val keystorePassword = call.argument<String>("keystorePassword")
Expand All @@ -66,6 +66,7 @@ class MainActivity : FlutterActivity() {
outFilePath != null &&
integrationsPath != null &&
selectedPatches != null &&
options != null &&
cacheDirPath != null &&
keyStoreFilePath != null &&
keystorePassword != null
Expand All @@ -79,6 +80,7 @@ class MainActivity : FlutterActivity() {
outFilePath,
integrationsPath,
selectedPatches,
options,
cacheDirPath,
keyStoreFilePath,
keystorePassword
Expand Down Expand Up @@ -127,6 +129,28 @@ class MainActivity : FlutterActivity() {
put(compatiblePackageJson)
}
})
put("options", JSONArray().apply {
it.options.values.forEach { option ->
val optionJson = JSONObject().apply option@{
put("key", option.key)
put("title", option.title)
put("description", option.description)
put("required", option.required)

when (val value = option.value) {
null -> put("value", null)
is Array<*> -> put("value", JSONArray().apply {

value.forEach { put(it) }
})
else -> put("value", option.value)
}

put("optionClassType", option::class.simpleName)
}
put(optionJson)
}
})
}.let(::put)
}
}.toString().let(result::success)
Expand All @@ -145,6 +169,7 @@ class MainActivity : FlutterActivity() {
outFilePath: String,
integrationsPath: String,
selectedPatches: List<String>,
options: Map<String, Map<String, Any>>,
cacheDirPath: String,
keyStoreFilePath: String,
keystorePassword: String
Expand Down Expand Up @@ -182,7 +207,7 @@ class MainActivity : FlutterActivity() {

object : java.util.logging.Handler() {
override fun publish(record: LogRecord) {
if (record.loggerName?.startsWith("app.revanced") != true) return
if (record.loggerName?.startsWith("app.revanced") != true || cancel) return

updateProgress(-1.0, "", record.message)
}
Expand Down Expand Up @@ -215,6 +240,7 @@ class MainActivity : FlutterActivity() {
cacheDir,
Aapt.binary(applicationContext).absolutePath,
cacheDir.path,
true // TODO: Add option to disable this
)
)

Expand All @@ -234,6 +260,10 @@ class MainActivity : FlutterActivity() {
isCompatible || patch.compatiblePackages.isNullOrEmpty()

compatibleOrUniversal && selectedPatches.any { it == patch.name }
}.onEach { patch ->
options[patch.name]?.forEach { (key, value) ->
patch.options[key] = value
}
}

if (cancel) {
Expand Down
6 changes: 1 addition & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ allprojects {
google()
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/revanced/revanced-patcher")
credentials {
username = (project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")) as String
password = (project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")) as String
}
url 'https://jitpack.io'
}
mavenLocal()
}
Expand Down
4 changes: 1 addition & 3 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=a01b6587e15fe7ed120a0ee299c25982a1eee045abd6a9dd5e216b2f628ef9ac
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
36 changes: 31 additions & 5 deletions assets/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
"yesButton": "Yes",
"noButton": "No",
"warning": "Warning",
"options": "Options",
"notice": "Notice",
"noShowAgain": "Don't show this again",
"new": "New",
"add": "Add",
"remove": "Remove",
"navigationView": {
"dashboardTab": "Dashboard",
"patcherTab": "Patcher",
Expand Down Expand Up @@ -71,7 +73,8 @@

"armv7WarningDialogText": "Patching on ARMv7 devices is not yet supported and might fail. Proceed anyways?",

"removedPatchesWarningDialogText": "The following patches have been removed since the last time you used them.\n\n{patches}\n\nProceed anyways?"
"removedPatchesWarningDialogText": "The following patches have been removed since the last time you used them.\n\n{patches}\n\nProceed anyways?",
"requiredOptionDialogText" : "Some patch options have to be set."
},
"appSelectorCard": {
"widgetTitle": "Select an application",
Expand Down Expand Up @@ -114,6 +117,8 @@
"viewTitle": "Select patches",
"searchBarHint": "Search patches",
"universalPatches": "Universal patches",
"newPatches": "New patches",
"patches": "Patches",

"doneButton": "Done",

Expand All @@ -126,15 +131,29 @@
"loadPatchesSelection": "Load patches selection",
"noSavedPatches": "No saved patches for the selected app.\nPress Done to save current selection.",
"noPatchesFound": "No patches found for the selected app",
"setRequiredOption": "Some patches require options to be set:\n\n{patches}\n\nPlease set them before continuing.",

"selectAllPatchesWarningContent": "You are about to select all patches, that includes non-suggested patches and can cause unwanted behavior."
},
"patchOptionsView": {
"viewTitle": "Patch options",
"saveOptions": "Save",

"addOptions": "Add options",
"deselectPatch": "Deselect patch",
"tooltip": "More input options",
"selectFilePath": "Select file path",
"selectFolder": "Select folder",
"selectOption": "Select option",

"requiredOption": "This option is required",
"unsupportedOption": "This option is not supported",
"requiredOptionNull": "The following options have to be set:\n\n{options}"
},
"patchItem": {
"unsupportedDialogText": "Selecting this patch may result in patching errors.\n\nApp version: {packageVersion}\nSupported versions:\n{supportedVersions}",
"unsupportedPatchVersion": "Patch is not supported for this app version. Enable the experimental toggle in settings to proceed.",

"newPatchDialogText": "This is a new patch that has been added since the last time you have patched this app.",
"newPatch": "New patch",
"unsupportedRequiredOption": "This patch contains a required option that is not supported by this app",

"patchesChangeWarningDialogText": "It is recommended to use the default selection of patches because changing it may cause unexpected issues.\n\nIf you know what you are doing, you can enable \"Enable changing selection\" in the settings.",
"patchesChangeWarningDialogButton": "Use default selection"
Expand Down Expand Up @@ -239,10 +258,17 @@
"resetStoredPatchesLabel": "Reset patches",
"resetStoredPatchesHint": "Reset the stored patches selection",

"resetStoredOptionsLabel": "Reset options",
"resetStoredOptionsHint": "Reset all patch options",

"resetStoredPatchesDialogTitle": "Reset patches selection?",
"resetStoredPatchesDialogText": "Resetting patches selection will remove all selected patches.",
"resetStoredPatches": "Patches selection has been reset",

"resetStoredOptionsDialogTitle": "Reset options?",
"resetStoredOptionsDialogText": "Resetting options will remove all saved options.",
"resetStoredOptions": "Options have been reset",

"deleteLogsLabel": "Delete logs",
"deleteLogsHint": "Delete collected manager logs",
"deletedLogs": "Logs deleted",
Expand Down
11 changes: 3 additions & 8 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN

commit_message: 'chore(i18n): sync translations'

preserve_hierarchy: true
preserve_hierarchy: 1
files:
- source: assets/i18n/en_US.json
translation: assets/i18n/%locale_with_underscore%.json
- source: /assets/i18n/en_US.json
translation: /assets/i18n/%locale_with_underscore%.json
25 changes: 18 additions & 7 deletions docs/2_1_patching.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,27 @@ The following pages will guide you through using ReVanced Manager to patch apps.
1. Navigate to the **Patcher** tab from the bottom navigation bar
2. Tap on the **Select an app** card
3. Choose an app to patch[^1]
> **Note**: The suggested version is visible in each app's card.
4. Tap on the **Select patches** card and select the patches you want to apply[^2]
> **Warning**: If you see a warning you can click on it for more information.

> [!NOTE]
> The suggested version is visible in each app's card.
4. Tap on the **Select patches** card and select the patches you want to apply[^2].

> [!NOTE]
> Some patches have options that can or must be configured by tapping on βš™οΈ icon next to the patch name.
>[!WARNING]
> If you see a warning you can click on it for more information.
5. Tap on the **Done** then **Patch** button
> **Warning**: The patching process may take ~5 minutes. Exiting the app may increase the time it takes to patch.

> [!WARNING]
> The patching process may take ~5 minutes. Exiting the app may cancel patching or increase the time it takes to patch.
6. Tap on the **Install** button
> **Note**: If you are rooted, you can mount the patched app on top of the original app.[^3]
> Optionally, you may export the patched app to storage using the options in the top right corner.

[^1]: Non-root users may be prompted to select an APK from storage, in which case you have to source the APK file yourself. ReVanced does not provide any APK files.
> [!NOTE]
> If you are rooted, you can mount the patched app on top of the original app.[^3]
> Optionally, you may export the patched app to storage using the option in the bottom left corner.
[^1]: Non-root users may be prompted to select an APK from storage, in which case you must source the APK file yourself. ReVanced does not provide any APK files.
[^2]: It is suggested to use the default set of patches by tapping on the **Default** button above the list of patches.
[^3]: Mounting the patched app on top of the original app will only work if the installed app version matches the version of the app selected in step 3. above.

Expand Down
27 changes: 18 additions & 9 deletions docs/2_4_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,38 @@ ReVanced Manager has settings that can be configured to your liking.

- ### πŸ”— API URL

Specify the URL of the API to use. This is used to fetch ReVanced Patches and update ReVanced Manager.
API to use to fetch updates and ReVanced Patches from.

- ### 🧬 Sources

Override the API and change the source of ReVanced Patches.
Override the API and download ReVanced Patches from a different source.

- ### πŸ§ͺ Experimental ReVanced Patches support

Lift app version constraints from ReVanced Patches. This allows you to patch any version of an app, even if the patch is not explicitly compatible with it.
Disable checking for the version of the app when applying ReVanced Patches.

> [!WARNING]
> This may cause issues if the ReVanced Patches are not compatible with the app version.
- ### πŸ§‘β€πŸ”¬ Experimental universal support

This will show or hide ReVanced Patches, which are not meant for any app in particular but rather for all apps but may not work on all apps.
This will show or hide ReVanced Patches, which are not meant for any app in particular but apply to all apps

> [!WARNING]
> Because the patches generalize the app, they may not work on all apps.
- ### πŸ”‘ Export, import or delete keystore
- ### πŸ’Ύ Imports & Exports

Manage the keystore used to sign patched apps.
You can import, export or reset the following settings:

- ### πŸ“„ Export, import or reset ReVanced Patches selection
- πŸ”‘ Keystore
- πŸ“„ ReVanced Patches selection
- βš™οΈ Options

Manage the ReVanced Patches selection. This is useful if you want to share your ReVanced Patches selection with others or reset it to the default selection.
> [!NOTE]
> This is particularly useful if you want to backup or reset your settings.
- ### ℹ️ About
- ### ❓ About

View information about your device and ReVanced Manager. This includes the version of ReVanced Manager and supported architectures of your device.

Expand Down
6 changes: 1 addition & 5 deletions docs/3_troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In case you encounter any issues while using ReVanced Manager, please refer to t

Make sure ReVanced Manager is up to date by following [πŸ”„ Updating ReVanced Manager](2_3_updating.md) and select the **Default** button when choosing patches.

- πŸ’₯ App not installed as package conflicts with an existing package
- 🚫 App not installed as package conflicts with an existing package

An existing installation of the app you're trying to patch is conflicting with the patched app. Uninstall the existing app before installing the patched app.

Expand All @@ -16,10 +16,6 @@ In case you encounter any issues while using ReVanced Manager, please refer to t

Alternatively, you can use [ReVanced CLI](https://github.com/revanced/revanced-cli) to patch the app.

- 🚫 Non-root install is not possible with the current patches selection

Select the **Default** button when choosing patches.

- 🚨 Patched app crashes on launch

Select the **Default** button when choosing patches.
Expand Down
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 38a2fa5

Please sign in to comment.