Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
jobs:
release:
name: Release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -56,7 +58,7 @@ jobs:

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEYSTORE_ENTRY_ALIAS: ${{ secrets.KEYSTORE_ENTRY_ALIAS }}
KEYSTORE_ENTRY_PASSWORD: ${{ secrets.KEYSTORE_ENTRY_PASSWORD }}
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,8 @@ gradle-app.setting
node_modules/

# Ignore IDEA files
.idea/
.idea/

.kotlin/

local.properties
6 changes: 3 additions & 3 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
"@semantic-release/git",
{
"assets": [
"README.md",
"CHANGELOG.md",
"gradle.properties",
]
],
"message": "chore: Release v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "build\outputs\apk\release\*.apk",
"path": "build/outputs/apk/release/*.apk?(.asc)",
}
],
successComment: false
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 1.0.0-dev.1 (2025-01-13)


### Features

* Initialize repository ([aa5ce82](https://github.com/ReVanced/revanced-manager-downloader-template/commit/aa5ce824eaedf7b94d5e80eff44954fc7909dd7f))
* Update to account for API changes ([2aa975a](https://github.com/ReVanced/revanced-manager-downloader-template/commit/2aa975ab5a440cd07056fbf911f67e0d979b1fe5))
36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,11 @@
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/ReVanced/revanced-manager-downloader-template/release.yml)
![GPLv3 License](https://img.shields.io/badge/License-GPL%20v3-yellow.svg)

Template repository for ReVanced Manager downloader.
Template repository for ReVanced Manager downloader plugins.

## ❓ About

This is a template to create a new ReVanced Manager downloader repository.

For an example repository, see [TODO](https://github.com/revanced/revanced-manager).
This is a template to create a new ReVanced Manager downloader repository. An example implementation is included.

## 🚀 Get started

Expand All @@ -79,18 +77,15 @@ To start using this template, follow these steps:
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#L49) to your repository
2. Add the passphrase as a secret named [GPG_PASSPHRASE](.github/workflows/release.yml#L50) to your repository
3. Add the fingerprint of the GPG subkey as a secret named [GPG_FINGERPRINT](.github/workflows/release.yml#L51)
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 variable 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#L55) to your repository
2. Add the keystore password as a secret named [KEYSTORE_PASSWORD](.github/workflows/release.yml#L60) to your repository
3. Add the keystore entry alias as a secret named [KEYSTORE_ENTRY_ALIAS](.github/workflows/release.yml#L61) to your repository
4. Add the keystore entry password as a secret named [KEYSTORE_ENTRY_PASSWORD](.github/workflows/release.yml#L62) to your repository
6. [Create a PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
with [push access](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/ci-configuration.md#authentication)
1. Add it as a secret named [REPOSITORY_PUSH_ACCESS](.github/workflows/release.yml#L59) to your repository
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]

Expand All @@ -111,7 +106,7 @@ To develop and release ReVanced Manager downloader using this template, some thi
- 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 of ReVanced Patches
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.

## 📚 Everything else
Expand All @@ -129,6 +124,17 @@ 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
2. Run `gradlew assembleRelease` to build the project

> [!NOTE]
> If the build fails due to authentication, you may need to authenticate to GitHub Packages.
> Create a PAT with the scope `read:packages` [here](https://github.com/settings/tokens/new?scopes=read:packages&description=ReVanced) and add your token to ~/.gradle/gradle.properties.
>
> Example `gradle.properties` file:
>
> ```properties
> gpr.user = user
> gpr.key = key
> ```

## 📜 Licence

ReVanced Manager downloader template is licensed under the GPLv3 licence.
Expand Down
47 changes: 16 additions & 31 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,57 +1,47 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
publishing
signing
}

dependencies {
implementation(libs.compose.activity)
implementation(platform(libs.compose.bom))
implementation(libs.compose.material3)
implementation(libs.compose.ui)
implementation(libs.compose.ui.tooling)

compileOnly(project(":downloader-plugin"))
compileOnly(libs.plugin.api)
}

android {
val packageName = "app.revanced.manager.plugin.downloader.example"

namespace = packageName
compileSdk = 34
compileSdk = 35

defaultConfig {
applicationId = packageName
minSdk = 26
targetSdk = 34
targetSdk = 35
versionName = version.toString()
versionCode = versionName!!.filter { it.isDigit() }.toInt()

buildConfigField("String", "PLUGIN_PACKAGE_NAME", "\"$packageName\"")
}

buildTypes {
release {
if ("CI" in System.getenv()) {
signingConfig = signingConfigs.create("release") {
storeFile = file("keystore.jks")
storePassword = System.getenv("KEYSTORE_PASSWORD")
keyAlias = System.getenv("KEYSTORE_ENTRY_ALIAS")
keyPassword = System.getenv("KEYSTORE_ENTRY_PASSWORD")
}
}

proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
}

debug {
signingConfig = signingConfigs.getByName("debug")
val keystoreFile = file("keystore.jks")
signingConfig =
if (keystoreFile.exists()) {
signingConfigs.create("release") {
storeFile = keystoreFile
storePassword = System.getenv("KEYSTORE_PASSWORD")
keyAlias = System.getenv("KEYSTORE_ENTRY_ALIAS")
keyPassword = System.getenv("KEYSTORE_ENTRY_PASSWORD")
}
} else {
signingConfigs["debug"]
}
}
}

Expand All @@ -64,11 +54,6 @@ android {
jvmTarget = "17"
}

buildFeatures {
compose = true
buildConfig = true
}

applicationVariants.all {
outputs.all {
this as com.android.build.gradle.internal.api.ApkVariantOutputImpl
Expand Down
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
android.useAndroidX=true
android.nonTransitiveRClass=true
android.nonFinalResIds=false
android.useAndroidX = true
android.nonTransitiveRClass = true
android.nonFinalResIds = false
kotlin.code.style = official
org.gradle.parallel = true
org.gradle.caching = true
version = 1.0.0-dev.1
19 changes: 5 additions & 14 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
[versions]
android = "8.5.2"
compose-activity = "1.9.1"
compose-bom = "2024.08.00"
kotlin = "2.0.20"
material3 = "1.3.0-rc01"
ui-tooling = "1.6.8"
plugin-api = "1.0.0"
android-gradle-plugin = "8.7.3"
kotlin = "2.1.0"

[libraries]
compose-activity = { group = "androidx.activity", name = "activity-compose", version.ref = "compose-activity" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3"}
compose-ui = { group = "androidx.compose.ui", name = "ui" }
compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "ui-tooling" }
plugin-api = { group = "app.revanced", name = "revanced-manager-downloader-api", version.ref = "plugin-api" }

[plugins]
android-application = { id = "com.android.application", version.ref = "android" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
Empty file modified gradlew
100644 → 100755
Empty file.
Loading
Loading