mirror of
https://github.com/ReVanced/revanced-manager-downloaders.git
synced 2026-01-10 21:36:18 +00:00
feat: Move implementation from the manager repo
This commit is contained in:
18
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
18
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -11,18 +11,18 @@ body:
|
||||
<source
|
||||
width="256px"
|
||||
media="(prefers-color-scheme: dark)"
|
||||
srcset="https://raw.githubusercontent.com/revanced/revanced-manager-downloader-template/main/assets/revanced-headline/revanced-headline-vertical-dark.svg"
|
||||
srcset="https://raw.githubusercontent.com/revanced/revanced-manager-apkmirror-downloader/main/assets/revanced-headline/revanced-headline-vertical-dark.svg"
|
||||
>
|
||||
<img
|
||||
<img
|
||||
width="256px"
|
||||
src="https://raw.githubusercontent.com/revanced/revanced-manager-downloader-template/main/assets/revanced-headline/revanced-headline-vertical-light.svg"
|
||||
src="https://raw.githubusercontent.com/revanced/revanced-manager-apkmirror-downloader/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="https://raw.githubusercontent.com/revanced/revanced-manager-downloader-template/main/assets/revanced-logo/revanced-logo.svg" />
|
||||
<img height="24px" src="https://raw.githubusercontent.com/revanced/revanced-manager-downloader-template/main/assets/revanced-logo/revanced-logo.svg" />
|
||||
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/revanced/revanced-manager-apkmirror-downloader/main/assets/revanced-logo/revanced-logo.svg" />
|
||||
<img height="24px" src="https://raw.githubusercontent.com/revanced/revanced-manager-apkmirror-downloader/main/assets/revanced-logo/revanced-logo.svg" />
|
||||
</picture>
|
||||
</a>
|
||||
<a href="https://github.com/ReVanced">
|
||||
@@ -66,12 +66,10 @@ body:
|
||||
Continuing the legacy of Vanced
|
||||
</p>
|
||||
|
||||
# ReVanced Manager downloader template bug report
|
||||
|
||||
Before creating a new bug report, please keep the following in mind:
|
||||
|
||||
- **Do not submit a duplicate bug report**: Search for existing bug reports [here](https://github.com/ReVanced/revanced-manager-downloader-template/issues?q=label%3A%22Bug+report%22).
|
||||
- **Review the contribution guidelines**: Make sure your bug report adheres to it. You can find the guidelines [here](https://github.com/ReVanced/revanced-manager-downloader-template/blob/main/CONTRIBUTING.md).
|
||||
- **Do not submit a duplicate bug report**: Search for existing bug reports [here](https://github.com/ReVanced/revanced-manager-apkmirror-downloader/issues?q=label%3A%22Bug+report%22).
|
||||
- **Review the contribution guidelines**: Make sure your bug report adheres to it. You can find the guidelines [here](https://github.com/ReVanced/revanced-manager-apkmirror-downloader/blob/main/CONTRIBUTING.md).
|
||||
- **Do not use the issue page for support**: If you need help or have questions, check out other platforms on [revanced.app](https://revanced.app).
|
||||
- type: textarea
|
||||
attributes:
|
||||
@@ -85,7 +83,7 @@ body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Error logs
|
||||
description: Exceptions can be captured by running `logcat | grep AndroidRuntime` in a shell.
|
||||
description: These can be exported from the Patcher screen or from the Manager settings.
|
||||
render: shell
|
||||
- type: textarea
|
||||
attributes:
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -2,4 +2,4 @@ blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: 🗨 Discussions
|
||||
url: https://github.com/revanced/revanced-suggestions/discussions
|
||||
about: Have something unspecific to ReVanced Manager downloader in mind? Search for or start a new discussion!
|
||||
about: Have something unspecific to this plugin in mind? Search for or start a new discussion!
|
||||
|
||||
22
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
22
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -11,18 +11,18 @@ body:
|
||||
<source
|
||||
width="256px"
|
||||
media="(prefers-color-scheme: dark)"
|
||||
srcset="https://raw.githubusercontent.com/revanced/revanced-manager-downloader-template/main/assets/revanced-headline/revanced-headline-vertical-dark.svg"
|
||||
srcset="https://raw.githubusercontent.com/revanced/revanced-manager-apkmirror-downloader/main/assets/revanced-headline/revanced-headline-vertical-dark.svg"
|
||||
>
|
||||
<img
|
||||
<img
|
||||
width="256px"
|
||||
src="https://raw.githubusercontent.com/revanced/revanced-manager-downloader-template/main/assets/revanced-headline/revanced-headline-vertical-light.svg"
|
||||
src="https://raw.githubusercontent.com/revanced/revanced-manager-apkmirror-downloader/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="https://raw.githubusercontent.com/revanced/revanced-manager-downloader-template/main/assets/revanced-logo/revanced-logo.svg" />
|
||||
<img height="24px" src="https://raw.githubusercontent.com/revanced/revanced-manager-downloader-template/main/assets/revanced-logo/revanced-logo.svg" />
|
||||
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/revanced/revanced-manager-apkmirror-downloader/main/assets/revanced-logo/revanced-logo.svg" />
|
||||
<img height="24px" src="https://raw.githubusercontent.com/revanced/revanced-manager-apkmirror-downloader/main/assets/revanced-logo/revanced-logo.svg" />
|
||||
</picture>
|
||||
</a>
|
||||
<a href="https://github.com/ReVanced">
|
||||
@@ -66,12 +66,10 @@ body:
|
||||
Continuing the legacy of Vanced
|
||||
</p>
|
||||
|
||||
# ReVanced Manager downloader template feature request
|
||||
|
||||
Before creating a new feature request, please keep the following in mind:
|
||||
|
||||
- **Do not submit a duplicate feature request**: Search for existing feature requests [here](https://github.com/ReVanced/revanced-manager-downloader-template/issues?q=label%3A%22Feature+request%22).
|
||||
- **Review the contribution guidelines**: Make sure your feature request adheres to it. You can find the guidelines [here](https://github.com/ReVanced/revanced-manager-downloader-template/blob/main/CONTRIBUTING.md).
|
||||
- **Do not submit a duplicate feature request**: Search for existing feature requests [here](https://github.com/ReVanced/revanced-manager-apkmirror-downloader/issues?q=label%3A%22Feature+request%22).
|
||||
- **Review the contribution guidelines**: Make sure your feature request adheres to it. You can find the guidelines [here](https://github.com/ReVanced/revanced-manager-apkmirror-downloader/blob/main/CONTRIBUTING.md).
|
||||
- **Do not use the issue page for support**: If you need help or have questions, check out other platforms on [revanced.app](https://revanced.app).
|
||||
- type: textarea
|
||||
attributes:
|
||||
@@ -82,10 +80,10 @@ body:
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Motivation
|
||||
description: |
|
||||
description: |
|
||||
A strong motivation is necessary for a feature request to be considered.
|
||||
|
||||
- Why should this feature be implemented?
|
||||
|
||||
- Why should this feature be implemented?
|
||||
- What is the explicit use case?
|
||||
- What are the benefits?
|
||||
- What makes this feature important?
|
||||
|
||||
64
README.md
64
README.md
@@ -5,7 +5,7 @@
|
||||
media="(prefers-color-scheme: dark)"
|
||||
srcset="assets/revanced-headline/revanced-headline-vertical-dark.svg"
|
||||
>
|
||||
<img
|
||||
<img
|
||||
width="256px"
|
||||
src="assets/revanced-headline/revanced-headline-vertical-light.svg"
|
||||
>
|
||||
@@ -58,70 +58,34 @@
|
||||
Continuing the legacy of Vanced
|
||||
</p>
|
||||
|
||||
# 👋🔌 ReVanced Manager downloader template
|
||||
# 👋🔌 ReVanced Manager APKMirror downloader
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
Template repository for ReVanced Manager downloader plugins.
|
||||
|
||||
## ❓ About
|
||||
|
||||
This is a template to create a new ReVanced Manager downloader repository. An example implementation is included.
|
||||
|
||||
## 🚀 Get started
|
||||
|
||||
To start using this template, follow these steps:
|
||||
|
||||
1. [Create a new repository using this template](https://github.com/new?template_name=revanced-manager-downloader-template&template_owner=ReVanced)
|
||||
2. Set up the [build.gradle.kts](build.gradle.kts) file (Specifically, the [package nme](build.gradle.kts#L21).
|
||||
3. Update dependencies in the [libs.versions.toml](gradle/libs.versions.toml) file
|
||||
4. [Create a pass-phrased GPG master key and subkey](https://mikeross.xyz/create-gpg-key-pair-with-subkeys/)
|
||||
1. Add the private key as a secret named [GPG_PRIVATE_KEY](.github/workflows/release.yml#L51) to your repository
|
||||
2. Add the passphrase as a secret named [GPG_PASSPHRASE](.github/workflows/release.yml#L52) to your repository
|
||||
3. Add the fingerprint of the GPG subkey as a secret named [GPG_FINGERPRINT](.github/workflows/release.yml#L53)
|
||||
to your repository
|
||||
5. [Generate a keystore](https://developer.android.com/studio/publish/app-signing#generate-key)
|
||||
1. Add the Base64 encoded key store as a secret named [KEYSTORE](.github/workflows/release.yml#L57) to your repository
|
||||
2. Add the keystore password as a secret named [KEYSTORE_PASSWORD](.github/workflows/release.yml#L62) to your repository
|
||||
3. Add the keystore entry alias as a secret named [KEYSTORE_ENTRY_ALIAS](.github/workflows/release.yml#L63) to your repository
|
||||
4. Add the keystore entry password as a secret named [KEYSTORE_ENTRY_PASSWORD](.github/workflows/release.yml#L64) to your repository
|
||||
7. Set up the [README.md](README.md) file[^1] (e.g, title, description, license, summary),
|
||||
the [issue templates](.github/ISSUE_TEMPLATE)[^2] and the [contribution guidelines](CONTRIBUTING.md)[^3]
|
||||
|
||||
🎉 You are now ready to develop and release a ReVanced Manager downloader!
|
||||
|
||||
[^1]: [Example README.md file](https://github.com/ReVanced/revanced-manager/blob/main/README.md)
|
||||
[^2]: [Example issue templates](https://github.com/ReVanced/revanced-manager/tree/main/.github/ISSUE_TEMPLATE)
|
||||
[^3]: [Example contribution guidelines](https://github.com/ReVanced/revanced-manager/blob/main/CONTRIBUTING.md)
|
||||
An [APKMirror](https://www.apkmirror.com/) plugin for ReVanced Manager.
|
||||
|
||||
## 🧑💻 Usage
|
||||
|
||||
To develop and release ReVanced Manager downloader using this template, some things need to be considered:
|
||||
- Plugins are managed as Android apps. Download and install the APK file from the releases page.
|
||||
- After installing, restart ReVanced Manager and enable the plugin in the settings.
|
||||
- The plugin will now be usable.
|
||||
|
||||
- Development starts in feature branches. Once a feature branch is ready, it is squashed and merged into the `dev` branch
|
||||
- The `dev` branch is merged into the `main` branch once it is ready for release
|
||||
- Semantic versioning is used to version ReVanced Manager downloader.
|
||||
- Semantic commit messages are used for commits
|
||||
- Commits on the `dev` branch and `main` branch are automatically released
|
||||
via the [release.yml](.github/workflows/release.yml) workflow, which is also responsible for generating the changelog
|
||||
and updating the version of ReVanced Manager downloader. It is triggered by pushing to the `dev` or `main` branch.
|
||||
The workflow uses the `publish` task to publish the release.
|
||||
- The `publish` task depends on the `assembleRelease` task, so it will be run automatically when publishing a release.
|
||||
The plugin works by opening the APKMirror website in an embedded browser. If the search string contains a version, you must select that version. Selecting another version in that situation will cause patching to fail.
|
||||
|
||||
## 📚 Everything else
|
||||
|
||||
### 📙 Contributing
|
||||
|
||||
Thank you for considering contributing to ReVanced Manager downloader.
|
||||
Thank you for considering contributing to ReVanced Manager APKMirror downloader.
|
||||
You can find the contribution guidelines [here](CONTRIBUTING.md).
|
||||
|
||||
### 🛠️ Building
|
||||
|
||||
To build ReVanced Manager downloader template, a Java Development Kit (JDK) and Git must be installed.
|
||||
To build ReVanced Manager downloader template, a Java Development Kit (JDK) and Git must be installed.
|
||||
Follow the steps below to build ReVanced Manager downloader template:
|
||||
|
||||
1. Run `git clone git@github.com:ReVanced/revanced-manager-downloader-template.git` to clone the repository
|
||||
1. Run `git clone git@github.com:ReVanced/revanced-manager-apkmirror-downloader.git` to clone the repository
|
||||
2. Run `gradlew assembleRelease` to build the project
|
||||
|
||||
> [!NOTE]
|
||||
@@ -137,9 +101,9 @@ Follow the steps below to build ReVanced Manager downloader template:
|
||||
|
||||
## 📜 Licence
|
||||
|
||||
ReVanced Manager downloader template is licensed under the GPLv3 licence.
|
||||
This project is licensed under the GPLv3 licence.
|
||||
Please see the [license 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 Manager downloader template as long as you track changes/dates in source files.
|
||||
Any modifications to ReVanced Manager downloader template must also be made available under the GPL,
|
||||
and modify the plugin as long as you track changes/dates in source files.
|
||||
Any modifications must also be made available under the GPL,
|
||||
along with build & install instructions.
|
||||
|
||||
@@ -10,7 +10,7 @@ dependencies {
|
||||
}
|
||||
|
||||
android {
|
||||
val packageName = "app.revanced.manager.plugin.downloader.example"
|
||||
val packageName = "app.revanced.manager.plugin.downloader.apkmirror"
|
||||
|
||||
namespace = packageName
|
||||
compileSdk = 35
|
||||
|
||||
2
proguard-rules.pro
vendored
2
proguard-rules.pro
vendored
@@ -1 +1 @@
|
||||
-keep public class app.revanced.manager.plugin.downloader.example.*
|
||||
-keep public class app.revanced.manager.plugin.downloader.apkmirror.*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
rootProject.name = "revanced-manager-downloader-template"
|
||||
rootProject.name = "revanced-manager-apkmirror-downloader"
|
||||
|
||||
pluginManagement.repositories {
|
||||
gradlePluginPortal()
|
||||
|
||||
@@ -9,12 +9,8 @@
|
||||
android:label="@string/app_name"
|
||||
tools:targetApi="35">
|
||||
|
||||
<!--
|
||||
ReVanced Manager will look for a plugin definition in this class.
|
||||
CHeck the file for more information.
|
||||
-->
|
||||
<meta-data
|
||||
android:name="app.revanced.manager.plugin.downloader.class"
|
||||
android:value="app.revanced.manager.plugin.downloader.example.ExampleDownloaderKt" />
|
||||
android:value="app.revanced.manager.plugin.downloader.apkmirror.APKMirrorDownloaderKt" />
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,23 @@
|
||||
@file:Suppress("Unused")
|
||||
|
||||
package app.revanced.manager.plugin.downloader.apkmirror
|
||||
|
||||
import android.net.Uri
|
||||
import app.revanced.manager.plugin.downloader.webview.WebViewDownloader
|
||||
|
||||
val apkMirrorDownloader = WebViewDownloader { packageName, version ->
|
||||
with(Uri.Builder()) {
|
||||
scheme("https")
|
||||
authority("www.apkmirror.com")
|
||||
mapOf(
|
||||
"post_type" to "app_release",
|
||||
"searchtype" to "apk",
|
||||
"s" to (version?.let { "$packageName $it" } ?: packageName),
|
||||
"bundles%5B%5D" to "apk_files" // bundles[]
|
||||
).forEach { (key, value) ->
|
||||
appendQueryParameter(key, value)
|
||||
}
|
||||
|
||||
build().toString()
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
@file:Suppress("Unused")
|
||||
|
||||
package app.revanced.manager.plugin.downloader.example
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Application
|
||||
import android.content.Intent
|
||||
import android.content.res.AssetFileDescriptor
|
||||
import app.revanced.manager.plugin.downloader.*
|
||||
|
||||
// This file contains an example downloader implementation using the system file picker.
|
||||
// Remember to update the Android manifest if you move the definition file.
|
||||
|
||||
val exampleDownloader = Downloader {
|
||||
get { packageName, version ->
|
||||
// Use the requestStartActivity API to open the system file picker and get the resulting content URI.
|
||||
val uri = requestStartActivity(
|
||||
Intent(Intent.ACTION_GET_CONTENT)
|
||||
.addCategory(Intent.CATEGORY_OPENABLE)
|
||||
.setType("application/vnd.android.package-archive")
|
||||
)?.data ?: return@get null
|
||||
|
||||
println("Package name: $packageName, version: $version")
|
||||
|
||||
// We assume the user has selected the correct version, but this might not be the case.
|
||||
// Real plugins should verify the version and package name if possible.
|
||||
uri to version
|
||||
}
|
||||
|
||||
// Get an Android context. This is only used for reading the file that the user selected.
|
||||
// This hack should not be necessary in a real plugin.
|
||||
@SuppressLint("PrivateApi")
|
||||
val application = with(Class.forName("android.app.ActivityThread")) {
|
||||
val activityThread = getMethod("currentActivityThread")(null)
|
||||
getMethod("getApplication")(activityThread) as Application
|
||||
}
|
||||
download { uri ->
|
||||
// Open the file and return an InputStream to it along with the size.
|
||||
val fd = application.contentResolver.openAssetFileDescriptor(uri, "r")!!
|
||||
AssetFileDescriptor.AutoCloseInputStream(fd) to fd.length.takeIf { it > 0L }
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">Example downloader</string>
|
||||
<string name="app_name">ReVanced Manager: APKMirror downloader</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user