Skip to content

Commit

Permalink
Bunny-fication
Browse files Browse the repository at this point in the history
  • Loading branch information
pylixonly committed Apr 30, 2024
1 parent 931e295 commit a71370b
Show file tree
Hide file tree
Showing 24 changed files with 57 additions and 83 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<div align="center">

<img src="images/vendetta_logo.png" alt="Vendetta logo" width="200px" style="border-radius: 50%" />
<img src="images/bunny_logo.png" alt="Bunny logo" width="200px" style="border-radius: 50%" />

# Vendetta Manager
# Bunny Manager

Easily install Vendetta on Android
Easily install Bunny on Android

[![Latest release](https://img.shields.io/github/v/release/vendetta-mod/VendettaManager?color=3AB8BA&display_name=release&label=Latest&style=for-the-badge)](https://github.com/vendetta-mod/VendettaManager/releases/latest)
[![Latest release](https://img.shields.io/github/v/release/pyoncord/BunnyManager?color=3AB8BA&display_name=release&label=Latest&style=for-the-badge)](https://github.com/pyoncord/BunnyManager/releases/latest)

---

<br>

![Debug build status](https://img.shields.io/github/actions/workflow/status/vendetta-mod/VendettaManager/build-debug.yml?label=Debug%20Build&logo=github&style=for-the-badge&branch=main)
[![Stars](https://img.shields.io/github/stars/vendetta-mod/VendettaManager?logo=github&style=for-the-badge)](https://github.com/vendetta-mod/VendettaManager/stargazers)
[![Discord](https://img.shields.io/discord/1015931589865246730?logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/n9QQ4XhhJP)
![Debug build status](https://img.shields.io/github/actions/workflow/status/pyoncord/BunnyManager/build-debug.yml?label=Debug%20Build&logo=github&style=for-the-badge&branch=main)
[![Stars](https://img.shields.io/github/stars/pyoncord/BunnyManager?logo=github&style=for-the-badge)](https://github.com/pyoncord/BunnyManager/stargazers)
[![Discord](https://img.shields.io/discord/1015931589865246730?logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/XjYgWXHb9Q)

<br>

![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/vendetta-mod/VendettaManager?logo=github&logoColor=%23fff&style=for-the-badge)
![Downloads (latest)](https://img.shields.io/github/downloads/vendetta-mod/VendettaManager/latest/total?style=for-the-badge&logo=github&label=Downloads%20(Latest)&color=blue)
![Total downloads](https://img.shields.io/github/downloads/vendetta-mod/VendettaManager/total?style=for-the-badge&logo=github&label=Downloads%20(Total)&color=blue)
![GitHub top language](https://img.shields.io/github/languages/top/vendetta-mod/VendettaManager?style=for-the-badge)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/pyoncord/BunnyManager?logo=github&logoColor=%23fff&style=for-the-badge)
![Downloads (latest)](https://img.shields.io/github/downloads/pyoncord/BunnyManager/latest/total?style=for-the-badge&logo=github&label=Downloads%20(Latest)&color=blue)
![Total downloads](https://img.shields.io/github/downloads/pyoncord/BunnyManager/total?style=for-the-badge&logo=github&label=Downloads%20(Total)&color=blue)
![GitHub top language](https://img.shields.io/github/languages/top/pyoncord/BunnyManager?style=for-the-badge)

<br>

Expand All @@ -40,12 +40,12 @@ Build
#### Instructions

1. Clone the repo
- `git clone https://github.com/vendetta-mod/VendettaManager.git && cd VendettaManager`
- `git clone https://github.com/pyoncord/BunnyManager.git && cd BunnyManager`
2. Build the project
- Linux: `chmod +x ./gradlew && gradlew assembleDebug`
- Windows: `./gradlew assembleDebug`
3. Install on device
- [Enable usb debugging](https://developer.android.com/studio/debug/dev-options) and plug in your phone
- [Enable USB debugging](https://developer.android.com/studio/debug/dev-options) and plug in your phone
- Run `adb install app/build/outputs/apk/debug/app-debug.apk`

## Contributing
Expand All @@ -54,11 +54,11 @@ This is an open-source project, you can do so without any programming.

Here are a few things you can do:

- [Test and report issues](https://github.com/vendetta-mod/VendettaManager/issues/new/choose)
- [Test and report issues](https://github.com/pyoncord/BunnyManager/issues/new/choose)
<!-- - [Translate the app into your language](https://crowdin.com/project/vendetta-manager) -->

License
---
Vendetta is licensed under the Open Software License version 3.0
Bunny Manager is licensed under the Open Software License version 3.0

[![License: OSL v3](https://img.shields.io/badge/License-OSL%20v3-blue.svg?style=for-the-badge)](https://github.com/vendetta-mod/VendettaManager/blob/main/LICENSE)
[![License: OSL v3](https://img.shields.io/badge/License-OSL%20v3-blue.svg?style=for-the-badge)](https://github.com/pyoncord/BunnyManager/blob/main/LICENSE)
6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ android {
compileSdk = 34

defaultConfig {
applicationId = "dev.beefers.vendetta.manager"
applicationId = "io.github.pyoncord.manager"
minSdk = 28
targetSdk = 34
versionCode = 1123
versionName = "1.1.23"
versionCode = 1000
versionName = "1.0.0"

buildConfigField("String", "GIT_BRANCH", "\"${getCurrentBranch()}\"")
buildConfigField("String", "GIT_COMMIT", "\"${getLatestCommit()}\"")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ class DownloadManager(

suspend fun downloadVendetta(out: File, onProgressUpdate: (Float?) -> Unit) =
download(
"https://github.com/pyoncord/PyoncordXposed/releases/latest/download/app-release.apk",
"https://github.com/pyoncord/BunnyXposed/releases/latest/download/app-release.apk",
out,
onProgressUpdate
)

suspend fun downloadUpdate(out: File) =
download(
"https://github.com/pyoncord/PyoncordManager/releases/latest/download/Manager.apk",
"https://github.com/pyoncord/BunnyManager/releases/latest/download/Manager.apk",
out
) {
/* TODO: Update a progress bar in the update dialog */
Expand All @@ -54,7 +54,7 @@ class DownloadManager(
?: throw IllegalStateException("DownloadManager service is not available")

val downloadId = DownloadManager.Request(Uri.parse(url))
.setTitle("Pyoncord Manager")
.setTitle("Bunny Manager")
.setDescription("Downloading ${out.name}...")
.setDestinationUri(Uri.fromFile(out))
.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class PreferenceManager(context: Context) :
BasePreferenceManager(context.getSharedPreferences("prefs", Context.MODE_PRIVATE)) {

val DEFAULT_MODULE_LOCATION =
(context.externalCacheDir ?: File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DOWNLOADS).resolve("PyoncordManager").also { it.mkdirs() }).resolve("xposed.apk")
(context.externalCacheDir ?: File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DOWNLOADS).resolve("BunnyManager").also { it.mkdirs() }).resolve("xposed.apk")

var packageName by stringPreference("package_name", "io.github.pyoncord.app")

var appName by stringPreference("app_name", "Pyoncord")
var appName by stringPreference("app_name", "Bunny")

var discordVersion by stringPreference("discord_version", "")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ class StepRunner(
private val preferenceManager: PreferenceManager by inject()
private val context: Context by inject()
private val debugInfo = """
Pyoncord Manager v${BuildConfig.VERSION_NAME}
Bunny Manager v${BuildConfig.VERSION_NAME}
Built from commit ${BuildConfig.GIT_COMMIT} on ${BuildConfig.GIT_BRANCH} ${if (BuildConfig.GIT_LOCAL_CHANGES || BuildConfig.GIT_LOCAL_COMMITS) "(Changes Present)" else ""}
Running Android ${Build.VERSION.RELEASE}, API level ${Build.VERSION.SDK_INT}
Supported ABIs: ${Build.SUPPORTED_ABIS.joinToString()}
Device: ${Build.MANUFACTURER} - ${Build.MODEL} (${Build.DEVICE})
${if(Build.VERSION.SDK_INT > Build.VERSION_CODES.S) "SOC: ${Build.SOC_MANUFACTURER} ${Build.SOC_MODEL}\n" else "\n\n"}
Adding Pyoncord to Discord v$discordVersion
Adding Bunny to Discord v$discordVersion
""".trimIndent()
Expand All @@ -71,7 +71,7 @@ class StepRunner(
private val cacheDir =
context.externalCacheDir
?: File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DOWNLOADS)
.resolve("PyoncordManager")
.resolve("BunnyManager")
.also { it.mkdirs() }

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import java.io.File
/**
* Downloads the Vendetta XPosed module
*
* https://github.com/pyoncord/PyoncordXposed
* https://github.com/pyoncord/BunnyXposed
*/
@Stable
class DownloadVendettaStep(
Expand All @@ -17,7 +17,7 @@ class DownloadVendettaStep(

override val nameRes = R.string.step_dl_vd

override val url: String = "https://github.com/pyoncord/PyoncordXposed/releases/latest/download/app-release.apk"
override val url: String = "https://github.com/pyoncord/BunnyXposed/releases/latest/download/app-release.apk"
override val destination = preferenceManager.moduleLocation
override val workingCopy = workingDir.resolve("bunny.apk")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AddVendettaStep(
override suspend fun run(runner: StepRunner) {
val vendetta = runner.getCompletedStep<DownloadVendettaStep>().workingCopy

runner.logger.i("Adding Pyoncord module with LSPatch")
runner.logger.i("Adding BunnyXposed module with LSPatch")
val files = signedDir.listFiles()
?.takeIf { it.isNotEmpty() }
?: throw Error("Missing APKs from signing step")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ReplaceIconStep : Step() {

runner.logger.i("Patching icon assets (squareIcon=$squareIconFile, roundIcon=$roundIconFile)")

val backgroundColor = arsc.getPackageChunk().addColorResource("pyoncord_color", Color(0xFF48488B))
val backgroundColor = arsc.getPackageChunk().addColorResource("bunny_color", Color(0xFF48488B))

val postfix = when (preferences.channel) {
DiscordVersion.Type.BETA -> "beta"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object Signer : KoinComponent {
val certificate = keyStore.getCertificate(alias) as X509Certificate

ApkSigner.SignerConfig.Builder(
"Pyoncord",
"Bunny",
keyStore.getKey(alias, password) as PrivateKey,
listOf(certificate)
).build()
Expand All @@ -75,7 +75,7 @@ object Signer : KoinComponent {
do serialNumber = SecureRandom().nextInt().toBigInteger()
while (serialNumber < BigInteger.ZERO)

val x500Name = X500Name("CN=Pyoncord Manager")
val x500Name = X500Name("CN=Bunny Manager")
val pair = KeyPairGenerator.getInstance("RSA").run {
initialize(2048)
generateKeyPair()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class CommitsPagingSource(
override suspend fun load(params: LoadParams<Int>): LoadResult<Int, Commit> {
val page = params.key ?: 0

return when (val response = repo.getCommits("pyoncord/Pyoncord", page)) {
return when (val response = repo.getCommits("pyoncord/Bunny", page)) {
is ApiResponse.Success -> LoadResult.Page(
data = response.data,
prevKey = if (page > 0) page - 1 else null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class HomeViewModel(
private val cacheDir = context.externalCacheDir ?: File(
Environment.getExternalStorageDirectory(),
Environment.DIRECTORY_DOWNLOADS
).resolve("PyoncordManager").also { it.mkdirs() }
).resolve("BunnyManager").also { it.mkdirs() }

var discordVersions by mutableStateOf<Map<DiscordVersion.Type, DiscordVersion?>?>(null)
private set
Expand Down Expand Up @@ -107,11 +107,11 @@ class HomeViewModel(

private fun checkForUpdate() {
screenModelScope.launch {
release = repo.getLatestRelease("pyoncord/PyoncordManager").dataOrNull
release = repo.getLatestRelease("pyoncord/BunnyManager").dataOrNull
release?.let {
showUpdateDialog = it.tagName.toInt() > BuildConfig.VERSION_CODE
}
repo.getLatestRelease("pyoncord/PyoncordXposed").ifSuccessful {
repo.getLatestRelease("pyoncord/BunnyXposed").ifSuccessful {
if (prefs.moduleVersion != it.tagName) {
prefs.moduleVersion = it.tagName
val module = File(cacheDir, "bunny.apk")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AdvancedSettingsViewModel(
private val context: Context,
private val prefs: PreferenceManager,
) : ScreenModel {
private val cacheDir = context.externalCacheDir ?: File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DOWNLOADS).resolve("PyoncordManager").also { it.mkdirs() }
private val cacheDir = context.externalCacheDir ?: File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DOWNLOADS).resolve("BunnyManager").also { it.mkdirs() }

fun clearCache() {
cacheDir.deleteRecursively()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import dev.beefers.vendetta.manager.BuildConfig
object Constants {

val TEAM_MEMBERS = listOf(
TeamMember("Pylix", "Developer - Pyoncord/Vendetta", "amsyarasyiq"),
TeamMember("Pylix", "Developer - Bunny & Vendetta", "amsyarasyiq"),
TeamMember("Kasi", "Developer - Xposed Module", "redstonekasi")
)

// NOTE: This is no longer used
val VENDETTA_DIR = Environment.getExternalStorageDirectory().resolve("Pyoncord")
val VENDETTA_DIR = Environment.getExternalStorageDirectory().resolve("Bunny")

val DUMMY_VERSION = DiscordVersion(1, 0, DiscordVersion.Type.STABLE)

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/drawable-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/vendetta_brand" />
<foreground android:drawable="@drawable/vendetta_logo" />
<monochrome android:drawable="@drawable/vendetta_logo" />
<background android:drawable="@color/bunny_brand" />
<foreground android:drawable="@drawable/bunny_logo" />
<monochrome android:drawable="@drawable/bunny_logo" />
</adaptive-icon>
18 changes: 0 additions & 18 deletions app/src/main/res/drawable-v26/vendetta_logo.xml

This file was deleted.

10 changes: 10 additions & 0 deletions app/src/main/res/drawable/bunny_logo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt"
android:viewportWidth="1024"
android:viewportHeight="1024"
android:width="1024dp"
android:height="1024dp">
<path
android:pathData="M609.332 411.689C615.011 434.45 617.274 456.024 616.433 473.487C686.495 520.19 723.419 549.406 689.187 577.24L687.835 577.12L713.41 619.67C715.508 623.159 711.612 627.23 707.993 625.366C594.412 566.856 509.331 565.278 346.508 680.553C343.283 682.836 338.923 679.639 340.289 675.931L369.178 597.52C351.374 597.335 337 583.271 337 565.948C337 551.66 346.779 539.588 360.197 535.694C367.36 533.305 374.586 534.478 384.334 536.061C396.367 538.014 412.241 540.592 436.578 537.862C476.446 533.39 507.559 502 519.545 486.839C507.557 480.206 494.889 471.671 482.409 461.545C439.976 427.113 415.798 387.335 428.408 372.699C441.017 358.062 485.638 374.109 528.072 408.541C531.35 411.2 534.518 413.892 537.57 416.601C527.923 369.273 533.459 329.516 551.166 325.355C570.272 320.864 596.313 359.518 609.332 411.689ZM636.43 545.531C645.943 545.531 653.654 538.048 653.654 528.816C653.654 519.584 645.943 512.1 636.43 512.1C626.918 512.1 619.207 519.584 619.207 528.816C619.207 538.048 626.918 545.531 636.43 545.531Z"
android:fillType="evenOdd"
android:fillColor="#FFFFFF" />
</vector>
Binary file modified app/src/main/res/drawable/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a71370b

Please sign in to comment.