Skip to content

Commit

Permalink
feat: Move implementation from the manager repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelen123 committed Jan 13, 2025
1 parent c102f74 commit b06cc39
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 124 deletions.
18 changes: 8 additions & 10 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="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>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 10 additions & 12 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="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>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
Expand Down Expand Up @@ -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:
Expand All @@ -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?
Expand Down
64 changes: 14 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
Expand Down Expand Up @@ -58,70 +58,34 @@
Continuing the legacy of Vanced
</p>

# 👋🔌 ReVanced Manager downloader template
# 👋🔌 ReVanced Manager APKMirror downloader

![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/ReVanced/revanced-manager-downloader-template/release.yml)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/ReVanced/revanced-manager-apkmirror-downloader/release.yml)
![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)

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 [email protected]:ReVanced/revanced-manager-downloader-template.git` to clone the repository
1. Run `git clone [email protected]:ReVanced/revanced-manager-apkmirror-downloader.git` to clone the repository
2. Run `gradlew assembleRelease` to build the project

> [!NOTE]
Expand All @@ -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.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-keep public class app.revanced.manager.plugin.downloader.example.*
-keep public class app.revanced.manager.plugin.downloader.apkmirror.*
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = "revanced-manager-downloader-template"
rootProject.name = "revanced-manager-apkmirror-downloader"

pluginManagement.repositories {
gradlePluginPortal()
Expand Down
6 changes: 1 addition & 5 deletions src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
@@ -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()
}
}

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Example downloader</string>
<string name="app_name">ReVanced Manager: APKMirror downloader</string>
</resources>

0 comments on commit b06cc39

Please sign in to comment.