Compare commits
248 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cc79c59d0 | ||
|
|
3ba2f9a460 | ||
|
|
0045d3b2a4 | ||
|
|
71fab34c98 | ||
|
|
fdf93c7b1e | ||
|
|
460375e4ac | ||
|
|
28fe88c157 | ||
|
|
eaad9755ea | ||
|
|
50d58dc4e1 | ||
|
|
62c5659245 | ||
|
|
7411ceb7a7 | ||
|
|
ac57f05cae | ||
|
|
dcc33736a3 | ||
|
|
35dca04b37 | ||
|
|
748bb9dc59 | ||
|
|
1fa78ab647 | ||
|
|
6a3c90d12b | ||
|
|
a00a6fdf66 | ||
|
|
17b40741ea | ||
|
|
5c17dc3f9d | ||
|
|
0cd04a473a | ||
|
|
f234785571 | ||
|
|
98625b22b8 | ||
|
|
15a81b53ac | ||
|
|
3c8f78ef68 | ||
|
|
1725bb6f0d | ||
|
|
2b62ed13a3 | ||
|
|
d414b9c20a | ||
|
|
e331dbb030 | ||
|
|
ecd5c55008 | ||
|
|
7b82e406a4 | ||
|
|
eee219a4d1 | ||
|
|
012ece1855 | ||
|
|
2b12b2fb4e | ||
|
|
0c58003936 | ||
|
|
6a5114cad0 | ||
|
|
17cd3d552e | ||
|
|
9aefa5fed7 | ||
|
|
5df4a74536 | ||
|
|
94720320d8 | ||
|
|
3f29feecec | ||
|
|
3529f5f7c1 | ||
|
|
ad6e5eb850 | ||
|
|
546d97844e | ||
|
|
d0aff56a91 | ||
|
|
665b60654e | ||
|
|
6eebcdb494 | ||
|
|
f3f352977e | ||
|
|
e0aac86ec2 | ||
|
|
1b29c8070b | ||
|
|
f60c24a259 | ||
|
|
bcf39e1e65 | ||
|
|
1dea909ef5 | ||
|
|
b90183d4a6 | ||
|
|
ca59a08cc2 | ||
|
|
28dc73b7ae | ||
|
|
84677d92c2 | ||
|
|
57f7d8b3dc | ||
|
|
3c1c423283 | ||
|
|
aa4a3a6847 | ||
|
|
fedb711333 | ||
|
|
4b7b0009fa | ||
|
|
b033d53c5b | ||
|
|
cb3021e2a2 | ||
|
|
82e69d5ab1 | ||
|
|
e499c7d228 | ||
|
|
2759b71df1 | ||
|
|
6663e4a912 | ||
|
|
1e4b846dbd | ||
|
|
d6fd188dce | ||
|
|
c5d9dc9821 | ||
|
|
45f14b92fe | ||
|
|
79a215d318 | ||
|
|
8cf989a239 | ||
|
|
d07c8e953d | ||
|
|
3c14917b2f | ||
|
|
48b5e39f3a | ||
|
|
eb41f0ec8e | ||
|
|
5dcee025b6 | ||
|
|
49392ab273 | ||
|
|
ba79a54b83 | ||
|
|
96400eb22c | ||
|
|
2d213f46e8 | ||
|
|
a51e82c077 | ||
|
|
a1d70359a2 | ||
|
|
4f96d33abd | ||
|
|
af71c66820 | ||
|
|
54312834b8 | ||
|
|
b99015fa99 | ||
|
|
87190ad7aa | ||
|
|
13ec434a2d | ||
|
|
2ddd8b5964 | ||
|
|
974119863e | ||
|
|
9783e33885 | ||
|
|
855869f2d9 | ||
|
|
a6ab500b8a | ||
|
|
48de3a521e | ||
|
|
c1cf8365ff | ||
|
|
38dec41e9e | ||
|
|
c41083a237 | ||
|
|
72b669d349 | ||
|
|
d8e7984302 | ||
|
|
3952c72540 | ||
|
|
e76bd45ef6 | ||
|
|
c67a6a116f | ||
|
|
7680cb7b3b | ||
|
|
cbe6392946 | ||
|
|
2142ba837e | ||
|
|
de1cbb9009 | ||
|
|
c5e3bd7c6b | ||
|
|
2e8b3b07d8 | ||
|
|
47737d1c19 | ||
|
|
87d5c1efce | ||
|
|
37e4553df5 | ||
|
|
383af45097 | ||
|
|
0db19a65fe | ||
|
|
9cdb4e78e7 | ||
|
|
e9bd7b6253 | ||
|
|
8d2edb6f58 | ||
|
|
e319e2b0f4 | ||
|
|
9f87a3dff6 | ||
|
|
8c2777e713 | ||
|
|
a4cb364a24 | ||
|
|
321b3ad3e0 | ||
|
|
9185bfa37a | ||
|
|
8d4a93fc38 | ||
|
|
770d624256 | ||
|
|
aff5822da1 | ||
|
|
ff545d86fc | ||
|
|
1e815a3991 | ||
|
|
03300a8fbb | ||
|
|
5e961e4ec7 | ||
|
|
8d2662f919 | ||
|
|
69829fa3cf | ||
|
|
840d6232e3 | ||
|
|
bc7cb499ef | ||
|
|
bbfc129d1e | ||
|
|
3576f16ad4 | ||
|
|
f6e5f7283d | ||
|
|
162627d571 | ||
|
|
3394490dd9 | ||
|
|
828a0c9696 | ||
|
|
09fcea6f1b | ||
|
|
e861642964 | ||
|
|
79025f0e97 | ||
|
|
61438c48a5 | ||
|
|
91fa48d134 | ||
|
|
8c26fe34b7 | ||
|
|
4f8fc65996 | ||
|
|
467a781efd | ||
|
|
e5ddf7df90 | ||
|
|
2c8495a219 | ||
|
|
75730992f8 | ||
|
|
f3114a72be | ||
|
|
28e8e7c708 | ||
|
|
0b93228fcc | ||
|
|
d5a6647f01 | ||
|
|
80cb5e46c7 | ||
|
|
74df4c8446 | ||
|
|
70108328d1 | ||
|
|
8d48dc2e0d | ||
|
|
0d7f730841 | ||
|
|
091d241d13 | ||
|
|
1d7293f1dd | ||
|
|
7632ac1fa8 | ||
|
|
7e7cd04527 | ||
|
|
40fccfd0f9 | ||
|
|
269f7043c4 | ||
|
|
f0a4045642 | ||
|
|
3c5a7087f2 | ||
|
|
c4c20aeeaa | ||
|
|
c2a8cc9f8a | ||
|
|
3aae7baef5 | ||
|
|
0e5a29a862 | ||
|
|
4e33b98130 | ||
|
|
03f8d320d3 | ||
|
|
97cf2a9b6c | ||
|
|
705bea72ed | ||
|
|
dea0483ce6 | ||
|
|
e425354833 | ||
|
|
68b808b98f | ||
|
|
5907dd50b2 | ||
|
|
762c0a0043 | ||
|
|
6b5ef4ae38 | ||
|
|
a7f0ab2aa6 | ||
|
|
2c248a8520 | ||
|
|
395a9ca595 | ||
|
|
10e9c66e77 | ||
|
|
3a1122ebc3 | ||
|
|
32772a10d8 | ||
|
|
62be760583 | ||
|
|
c20c2b88ad | ||
|
|
a3292620c8 | ||
|
|
2f0deb09bd | ||
|
|
a921d97452 | ||
|
|
de9ecb42cb | ||
|
|
9c9d45e734 | ||
|
|
e65067d300 | ||
|
|
c251ad69c2 | ||
|
|
5b97dccb2e | ||
|
|
ec4f077722 | ||
|
|
366c772bc8 | ||
|
|
aef3873bbd | ||
|
|
07473077f0 | ||
|
|
b82334a121 | ||
|
|
1c9fd9cac0 | ||
|
|
1710bddad4 | ||
|
|
e4498c9f77 | ||
|
|
1e0834f682 | ||
|
|
e2a1efbd4c | ||
|
|
e887ae202e | ||
|
|
af7eaa2e45 | ||
|
|
80e0dbf802 | ||
|
|
cc4cd6333c | ||
|
|
8fd16ad03b | ||
|
|
50de8f82e8 | ||
|
|
0ded5d941e | ||
|
|
255c1713bd | ||
|
|
ca19cbff65 | ||
|
|
c085ec10a3 | ||
|
|
d5fae8be78 | ||
|
|
7e47c3090c | ||
|
|
3e7e548e5d | ||
|
|
8688f68300 | ||
|
|
ae70891761 | ||
|
|
7f4551d8f7 | ||
|
|
ef0f321eb9 | ||
|
|
2c191f710c | ||
|
|
0e95128735 | ||
|
|
45a57e182d | ||
|
|
3cc6f0d9bf | ||
|
|
6371bcd356 | ||
|
|
94351c2de7 | ||
|
|
e209ad1863 | ||
|
|
6a9d25f5d2 | ||
|
|
c28d379314 | ||
|
|
13d23fc2b9 | ||
|
|
7a52223e42 | ||
|
|
82d7517d56 | ||
|
|
0ade279070 | ||
|
|
721b936486 | ||
|
|
63dd895588 | ||
|
|
2d3d52b405 | ||
|
|
f162522a60 | ||
|
|
c087f3718c | ||
|
|
7e957c9624 | ||
|
|
b18fea83ed | ||
|
|
4af5186cc0 |
157 changed files with 847 additions and 1629 deletions
|
|
@ -26,7 +26,7 @@ Goon Manager makes installing and managing Discord mods simple and safe. It's bu
|
||||||
|
|
||||||
<p><strong>Download & run</strong> — get a released APK from Releases and install with:</p>
|
<p><strong>Download & run</strong> — get a released APK from Releases and install with:</p>
|
||||||
|
|
||||||
Get newest apk from [release list](https://github.com/OTKUSteyler/GoonManager/releases/tag/V1.0) and install it.
|
Get newest apk from [release list](https://github.com/OTKUSteyler/GoonManager/releases/tag/v1.1.3) and install it.
|
||||||
|
|
||||||
<p><strong>Build from source</strong> — clone and assemble:</p>
|
<p><strong>Build from source</strong> — clone and assemble:</p>
|
||||||
|
|
||||||
|
|
@ -127,3 +127,5 @@ Goon Manager is open source under the OSL License. See `LICENSE` for details.
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<strong>Made with ❤️ for the GoonCord community — keep it playful, keep it safe.</strong>
|
<strong>Made with ❤️ for the GoonCord community — keep it playful, keep it safe.</strong>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|

|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,13 @@ val gitHasHasLocalChanges = providers.execIgnoreCode("git", "status", "-s").isNo
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "dev.shiggy.manager"
|
namespace = "dev.shiggy.manager"
|
||||||
compileSdk = 36
|
compileSdk = 37
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdk = 28
|
minSdk = 28
|
||||||
targetSdk = 36
|
targetSdk = 37
|
||||||
versionCode = 10_10_00
|
versionCode = 10_12_01
|
||||||
versionName = "1.1.0"
|
versionName = "1.1.2"
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
useSupportLibrary = true
|
useSupportLibrary = true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
30
app/libs/convert-lspatch.sh
Executable file
30
app/libs/convert-lspatch.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Download LSPatch jar and convert it to an aar
|
||||||
|
# Jars cannot be used as a dependency without breaking R8 optimization
|
||||||
|
|
||||||
|
LSPATCH_URL="https://github.com/JingMatrix/LSPatch/releases/latest/download/lspatch.jar"
|
||||||
|
LSPATCH_FILE_NAME="lspatch"
|
||||||
|
|
||||||
|
function cleanup {
|
||||||
|
rm -rf $LSPATCH_FILE_NAME.jar META-INF AndroidManifest.xml classes.jar R.txt
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanup
|
||||||
|
|
||||||
|
# download lspatch
|
||||||
|
curl -sSL -o $LSPATCH_FILE_NAME.jar $LSPATCH_URL
|
||||||
|
|
||||||
|
# prepare aar contents
|
||||||
|
unzip -q $LSPATCH_FILE_NAME.jar "META-INF/**"
|
||||||
|
mv $LSPATCH_FILE_NAME.jar classes.jar
|
||||||
|
touch R.txt
|
||||||
|
cat >AndroidManifest.xml <<EOF
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.lsposed.lspatch">
|
||||||
|
<uses-sdk android:minSdkVersion="28" android:targetSdkVersion="36" />
|
||||||
|
</manifest>
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# add everything to aar
|
||||||
|
rm -f $LSPATCH_FILE_NAME.aar
|
||||||
|
zip -rq $LSPATCH_FILE_NAME.aar R.txt AndroidManifest.xml META-INF classes.jar
|
||||||
|
cleanup
|
||||||
Binary file not shown.
|
|
@ -18,11 +18,11 @@
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name="com.aliucord.manager.ManagerApplication"
|
android:name="com.aliucord.manager.ManagerApplication"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@drawable/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.AppCompat.NoActionBar"
|
android:theme="@style/Theme.AppCompat.NoActionBar"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import com.aliucord.manager.ui.screens.home.HomeScreen
|
||||||
import com.aliucord.manager.ui.theme.ManagerTheme
|
import com.aliucord.manager.ui.theme.ManagerTheme
|
||||||
import com.aliucord.manager.ui.widgets.updater.UpdaterDialog
|
import com.aliucord.manager.ui.widgets.updater.UpdaterDialog
|
||||||
import com.aliucord.manager.util.back
|
import com.aliucord.manager.util.back
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import org.koin.android.ext.android.inject
|
import org.koin.android.ext.android.inject
|
||||||
|
|
||||||
class MainActivity : ComponentActivity() {
|
class MainActivity : ComponentActivity() {
|
||||||
|
|
@ -42,6 +42,7 @@ class MainActivity : ComponentActivity() {
|
||||||
ManagerTheme(
|
ManagerTheme(
|
||||||
theme = preferences.theme,
|
theme = preferences.theme,
|
||||||
dynamicColor = preferences.dynamicColor,
|
dynamicColor = preferences.dynamicColor,
|
||||||
|
amoled = preferences.amoled,
|
||||||
) {
|
) {
|
||||||
if (BuildConfig.RELEASE) {
|
if (BuildConfig.RELEASE) {
|
||||||
UpdaterDialog()
|
UpdaterDialog()
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import com.aliucord.manager.ui.screens.log.LogScreenModel
|
||||||
import com.aliucord.manager.ui.screens.logs.LogsListScreenModel
|
import com.aliucord.manager.ui.screens.logs.LogsListScreenModel
|
||||||
import com.aliucord.manager.ui.screens.patching.PatchingScreenModel
|
import com.aliucord.manager.ui.screens.patching.PatchingScreenModel
|
||||||
import com.aliucord.manager.ui.screens.patchopts.PatchOptionsModel
|
import com.aliucord.manager.ui.screens.patchopts.PatchOptionsModel
|
||||||
import com.aliucord.manager.ui.screens.plugins.PluginsModel
|
|
||||||
import com.aliucord.manager.ui.screens.settings.SettingsModel
|
import com.aliucord.manager.ui.screens.settings.SettingsModel
|
||||||
import com.aliucord.manager.ui.widgets.updater.UpdaterViewModel
|
import com.aliucord.manager.ui.widgets.updater.UpdaterViewModel
|
||||||
import com.aliucord.manager.installers.root.RootInstaller
|
import com.aliucord.manager.installers.root.RootInstaller
|
||||||
|
|
@ -57,7 +57,7 @@ class ManagerApplication : Application() {
|
||||||
// UI Models
|
// UI Models
|
||||||
modules(module {
|
modules(module {
|
||||||
factory { HomeModel(get<Application>(), get<AliucordGithubService>(), get<AliucordMavenService>(), get<ShiggyGithubService>(), get<RNATrackerService>(), get<kotlinx.serialization.json.Json>(), get<com.aliucord.manager.manager.PreferencesManager>()) }
|
factory { HomeModel(get<Application>(), get<AliucordGithubService>(), get<AliucordMavenService>(), get<ShiggyGithubService>(), get<RNATrackerService>(), get<kotlinx.serialization.json.Json>(), get<com.aliucord.manager.manager.PreferencesManager>()) }
|
||||||
factoryOf(::PluginsModel)
|
|
||||||
factoryOf(::AboutModel)
|
factoryOf(::AboutModel)
|
||||||
factoryOf(::PatchingScreenModel)
|
factoryOf(::PatchingScreenModel)
|
||||||
factory { SettingsModel(get<Application>(), get<PathManager>(), get<PreferencesManager>(), get<InstallerManager>()) }
|
factory { SettingsModel(get<Application>(), get<PathManager>(), get<PreferencesManager>(), get<InstallerManager>()) }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.aliucord.manager.di
|
package com.aliucord.manager.di
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.call.HttpClientCall
|
import io.ktor.client.call.HttpClientCall
|
||||||
import io.ktor.client.engine.okhttp.OkHttp
|
import io.ktor.client.engine.okhttp.OkHttp
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.aliucord.manager.installers
|
package com.aliucord.manager.installers
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
|
|
||||||
@Parcelize
|
@Parcelize
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import android.app.Application
|
||||||
import android.content.pm.PackageInstaller
|
import android.content.pm.PackageInstaller
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import com.aliucord.manager.installers.Installer
|
import com.aliucord.manager.installers.Installer
|
||||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import android.content.Context
|
||||||
import android.content.pm.PackageInstaller
|
import android.content.pm.PackageInstaller
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import com.aliucord.manager.installers.InstallerResult
|
import com.aliucord.manager.installers.InstallerResult
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import android.util.Log
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import com.aliucord.manager.installers.InstallerResult
|
import com.aliucord.manager.installers.InstallerResult
|
||||||
import com.aliucord.manager.installers.UnknownInstallerError
|
import com.aliucord.manager.installers.UnknownInstallerError
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is used as a callback receiver for [PackageInstaller] events,
|
* This class is used as a callback receiver for [PackageInstaller] events,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import android.content.pm.PackageInstaller
|
||||||
import com.aliucord.manager.installers.InstallerResult
|
import com.aliucord.manager.installers.InstallerResult
|
||||||
import com.aliucord.manager.installers.UnknownInstallerError
|
import com.aliucord.manager.installers.UnknownInstallerError
|
||||||
import com.aliucord.manager.util.showToast
|
import com.aliucord.manager.util.showToast
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This receiver is meant to be registered dynamically in combination with [PMIntentReceiver] in order to
|
* This receiver is meant to be registered dynamically in combination with [PMIntentReceiver] in order to
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import com.aliucord.manager.installers.InstallerResult
|
||||||
import com.aliucord.manager.installers.pm.PMUtils
|
import com.aliucord.manager.installers.pm.PMUtils
|
||||||
import com.aliucord.manager.util.showToast
|
import com.aliucord.manager.util.showToast
|
||||||
import dev.rikka.tools.refine.Refine
|
import dev.rikka.tools.refine.Refine
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.flow.StateFlow
|
import kotlinx.coroutines.flow.StateFlow
|
||||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import android.os.Bundle
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.aliucord.manager.installers.shizuku.ShizukuInstallerError
|
import com.aliucord.manager.installers.shizuku.ShizukuInstallerError
|
||||||
import com.aliucord.manager.installers.InstallerResult
|
import com.aliucord.manager.installers.InstallerResult
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
|
|
||||||
class ShizukuIntentReceiver : BroadcastReceiver() {
|
class ShizukuIntentReceiver : BroadcastReceiver() {
|
||||||
override fun onReceive(context: Context, intent: Intent) {
|
override fun onReceive(context: Context, intent: Intent) {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import androidx.core.content.getSystemService
|
||||||
import com.aliucord.manager.ui.screens.patchopts.PatchOptions
|
import com.aliucord.manager.ui.screens.patchopts.PatchOptions
|
||||||
import com.aliucord.manager.util.IS_PROBABLY_EMULATOR
|
import com.aliucord.manager.util.IS_PROBABLY_EMULATOR
|
||||||
import com.aliucord.manager.util.isPlayProtectEnabled
|
import com.aliucord.manager.util.isPlayProtectEnabled
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import kotlinx.serialization.json.decodeFromStream
|
import kotlinx.serialization.json.decodeFromStream
|
||||||
|
|
|
||||||
|
|
@ -11,28 +11,12 @@ import java.io.File
|
||||||
class PathManager(
|
class PathManager(
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
) {
|
) {
|
||||||
/**
|
|
||||||
* The Aliucord folder in which plugins/settings/themes are stored.
|
|
||||||
* Standard path: `~/Aliucord`
|
|
||||||
*/
|
|
||||||
val aliucordDir = Environment.getExternalStorageDirectory().resolve("Aliucord")
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Shiggy folder where shared Shiggy files are stored.
|
* The Shiggy folder where shared Shiggy files are stored.
|
||||||
* Standard path: `~/Shiggy`
|
* Standard path: `~/Shiggy`
|
||||||
*/
|
*/
|
||||||
val shiggyDir = Environment.getExternalStorageDirectory().resolve("Shiggy")
|
val shiggyDir = Environment.getExternalStorageDirectory().resolve("Shiggy")
|
||||||
|
|
||||||
/**
|
|
||||||
* The directory in external storage in which plugins are stored by Aliucord.
|
|
||||||
*/
|
|
||||||
val pluginsDir = aliucordDir.resolve("plugins")
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The settings file in which Aliucord's core uses.
|
|
||||||
*/
|
|
||||||
val coreSettingsFile = aliucordDir.resolve("settings/Aliucord.json")
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global keystore used for signing APKs.
|
* Global keystore used for signing APKs.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import com.aliucord.manager.ui.theme.Theme
|
||||||
@Stable
|
@Stable
|
||||||
class PreferencesManager(preferences: SharedPreferences) : BasePreferenceManager(preferences) {
|
class PreferencesManager(preferences: SharedPreferences) : BasePreferenceManager(preferences) {
|
||||||
var theme by enumPreference("theme", Theme.System)
|
var theme by enumPreference("theme", Theme.System)
|
||||||
|
var amoled by booleanPreference("amoled", false)
|
||||||
var dynamicColor by booleanPreference("dynamic_color", true)
|
var dynamicColor by booleanPreference("dynamic_color", true)
|
||||||
var devMode by booleanPreference("dev_mode", false)
|
var devMode by booleanPreference("dev_mode", false)
|
||||||
var installer by enumPreference<InstallerSetting>("installer", InstallerSetting.PM)
|
var installer by enumPreference<InstallerSetting>("installer", InstallerSetting.PM)
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import androidx.core.content.getSystemService
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import com.aliucord.manager.manager.download.IDownloadManager.ProgressListener
|
import com.aliucord.manager.manager.download.IDownloadManager.ProgressListener
|
||||||
import com.aliucord.manager.manager.download.IDownloadManager.Result
|
import com.aliucord.manager.manager.download.IDownloadManager.Result
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
|
||||||
|
|
@ -9,18 +9,20 @@ import androidx.core.content.getSystemService
|
||||||
import com.aliucord.manager.manager.download.IDownloadManager.Result
|
import com.aliucord.manager.manager.download.IDownloadManager.Result
|
||||||
import com.aliucord.manager.patcher.util.InsufficientStorageException
|
import com.aliucord.manager.patcher.util.InsufficientStorageException
|
||||||
import com.aliucord.manager.util.IS_PROBABLY_EMULATOR
|
import com.aliucord.manager.util.IS_PROBABLY_EMULATOR
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.request.header
|
import io.ktor.client.request.header
|
||||||
import io.ktor.client.request.prepareGet
|
import io.ktor.client.request.prepareGet
|
||||||
import io.ktor.client.statement.bodyAsChannel
|
import io.ktor.client.statement.bodyAsChannel
|
||||||
import io.ktor.http.HttpHeaders
|
import io.ktor.http.HttpHeaders
|
||||||
import io.ktor.http.contentLength
|
import io.ktor.http.contentLength
|
||||||
|
import io.ktor.http.isSuccess
|
||||||
import io.ktor.utils.io.readAvailable
|
import io.ktor.utils.io.readAvailable
|
||||||
import kotlinx.coroutines.CancellationException
|
import kotlinx.coroutines.CancellationException
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.net.SocketTimeoutException
|
import java.net.SocketTimeoutException
|
||||||
|
import java.net.URI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle downloading remote urls to a path with Ktor.
|
* Handle downloading remote urls to a path with Ktor.
|
||||||
|
|
@ -39,55 +41,108 @@ class KtorDownloadManager(
|
||||||
.apply { exists() || createNewFile() }
|
.apply { exists() || createNewFile() }
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val httpStmt = http.prepareGet(url) {
|
val downloadUrl = rewriteRawGithubUrl(url)
|
||||||
header(HttpHeaders.CacheControl, "no-cache, no-store")
|
|
||||||
|
|
||||||
// Disable compression due to bug on emulators
|
// Try the CDN first (jsDelivr), then an alternate raw proxy (raw.githack.com), and finally
|
||||||
// This header cannot be set with Android's DownloadManager
|
// fall back to the original URL if all CDN attempts fail.
|
||||||
if (IS_PROBABLY_EMULATOR) {
|
val rawGithack = try {
|
||||||
header(HttpHeaders.AcceptEncoding, null)
|
when {
|
||||||
|
// direct raw.githubusercontent.com -> raw.githack.com
|
||||||
|
url.contains("raw.githubusercontent.com", ignoreCase = true) ->
|
||||||
|
url.replace("raw.githubusercontent.com", "raw.githack.com")
|
||||||
|
// github.com/.../raw/... -> convert to raw.githack.com/ORG/REPO/BRANCH/path
|
||||||
|
url.contains("/raw/", ignoreCase = true) && url.contains("github.com", ignoreCase = true) -> {
|
||||||
|
try {
|
||||||
|
val u = URI(url)
|
||||||
|
val segs = u.path.trimStart('/').split('/', limit = 6)
|
||||||
|
if (segs.size >= 5 && segs[2].equals("raw", ignoreCase = true)) {
|
||||||
|
"https://raw.githack.com/${segs[0]}/${segs[1]}/${segs.subList(3, segs.size).joinToString("/")}"
|
||||||
|
} else url
|
||||||
|
} catch (_: Throwable) {
|
||||||
|
url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else -> url
|
||||||
|
}
|
||||||
|
} catch (_: Throwable) {
|
||||||
|
url
|
||||||
|
}
|
||||||
|
val attempts = listOf(downloadUrl, rawGithack, url).distinct()
|
||||||
|
var lastException: Throwable? = null
|
||||||
|
var downloaded = false
|
||||||
|
|
||||||
|
for (attemptUrl in attempts) {
|
||||||
|
val httpStmt = http.prepareGet(attemptUrl) {
|
||||||
|
header(HttpHeaders.CacheControl, "no-cache, no-store")
|
||||||
|
|
||||||
|
// Disable compression due to bug on emulators
|
||||||
|
// This header cannot be set with Android's DownloadManager
|
||||||
|
if (IS_PROBABLY_EMULATOR) {
|
||||||
|
header(HttpHeaders.AcceptEncoding, null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
httpStmt.execute { resp ->
|
||||||
|
if (!resp.status.isSuccess()) {
|
||||||
|
throw IOException("HTTP error ${resp.status.value} for $attemptUrl")
|
||||||
|
}
|
||||||
|
|
||||||
|
val channel = resp.bodyAsChannel()
|
||||||
|
val total = resp.contentLength() ?: 0
|
||||||
|
var retrieved = 0L
|
||||||
|
|
||||||
|
val buf = ByteArray(1024 * 1024 * 1)
|
||||||
|
var bufLen: Int
|
||||||
|
|
||||||
|
tmpOut.outputStream().use { stream ->
|
||||||
|
// Preallocate space for this file
|
||||||
|
if (total > 0 && Build.VERSION.SDK_INT >= 26) {
|
||||||
|
val storageManager = application.getSystemService<StorageManager>()!!
|
||||||
|
|
||||||
|
try {
|
||||||
|
storageManager.allocateBytes(stream.fd, total)
|
||||||
|
} catch (e: IOException) {
|
||||||
|
throw InsufficientStorageException(e.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (!channel.isClosedForRead) {
|
||||||
|
bufLen = channel.readAvailable(buf)
|
||||||
|
if (bufLen <= 0) break
|
||||||
|
|
||||||
|
stream.write(buf, 0, bufLen)
|
||||||
|
stream.flush()
|
||||||
|
|
||||||
|
retrieved += bufLen
|
||||||
|
|
||||||
|
if (total > 0) {
|
||||||
|
if (retrieved > total)
|
||||||
|
throw IOException("Total bytes received exceeds header total!")
|
||||||
|
|
||||||
|
onProgressUpdate?.onUpdate(retrieved / total.toFloat())
|
||||||
|
} else {
|
||||||
|
onProgressUpdate?.onUpdate(null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we reach here, the attempt succeeded
|
||||||
|
downloaded = true
|
||||||
|
break
|
||||||
|
} catch (e: CancellationException) {
|
||||||
|
// Propagate cancellations immediately
|
||||||
|
throw e
|
||||||
|
} catch (t: Throwable) {
|
||||||
|
// Record the last exception and try the next URL (if any)
|
||||||
|
lastException = t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
httpStmt.execute { resp ->
|
if (!downloaded) {
|
||||||
val channel = resp.bodyAsChannel()
|
// No attempt succeeded, throw the last failure to be handled by outer catch blocks
|
||||||
val total = resp.contentLength() ?: 0
|
throw lastException ?: IOException("Failed to download resource from $url")
|
||||||
var retrieved = 0L
|
|
||||||
|
|
||||||
val buf = ByteArray(1024 * 1024 * 1)
|
|
||||||
var bufLen: Int
|
|
||||||
|
|
||||||
tmpOut.outputStream().use { stream ->
|
|
||||||
// Preallocate space for this file
|
|
||||||
if (total > 0 && Build.VERSION.SDK_INT >= 26) {
|
|
||||||
val storageManager = application.getSystemService<StorageManager>()!!
|
|
||||||
|
|
||||||
try {
|
|
||||||
storageManager.allocateBytes(stream.fd, total)
|
|
||||||
} catch (e: IOException) {
|
|
||||||
throw InsufficientStorageException(e.message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (!channel.isClosedForRead) {
|
|
||||||
bufLen = channel.readAvailable(buf)
|
|
||||||
if (bufLen <= 0) break
|
|
||||||
|
|
||||||
stream.write(buf, 0, bufLen)
|
|
||||||
stream.flush()
|
|
||||||
|
|
||||||
retrieved += bufLen
|
|
||||||
|
|
||||||
if (total > 0) {
|
|
||||||
if (retrieved > total)
|
|
||||||
throw IOException("Total bytes received exceeds header total!")
|
|
||||||
|
|
||||||
onProgressUpdate?.onUpdate(retrieved / total.toFloat())
|
|
||||||
} else {
|
|
||||||
onProgressUpdate?.onUpdate(null)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (_: CancellationException) {
|
} catch (_: CancellationException) {
|
||||||
tmpOut.delete()
|
tmpOut.delete()
|
||||||
|
|
@ -107,6 +162,17 @@ class KtorDownloadManager(
|
||||||
return Result.Success(out)
|
return Result.Success(out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun rewriteRawGithubUrl(url: String): String {
|
||||||
|
val regex = Regex("^https?://raw\\.githubusercontent\\.com/([^/]+)/([^/]+)/([^/]+)/(.*)$", RegexOption.IGNORE_CASE)
|
||||||
|
val match = regex.matchEntire(url)
|
||||||
|
return if (match != null) {
|
||||||
|
val (org, repo, branch, path) = match.destructured
|
||||||
|
"https://cdn.jsdelivr.net/gh/$org/$repo@$branch/$path"
|
||||||
|
} else {
|
||||||
|
url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper around an exception that occurred from invoking Ktor
|
* Wrapper around an exception that occurred from invoking Ktor
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
package com.aliucord.manager.network.models
|
|
||||||
|
|
||||||
import androidx.compose.runtime.Immutable
|
|
||||||
import com.aliucord.manager.util.serialization.ImmutableListSerializer
|
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
|
||||||
import kotlinx.serialization.Serializable
|
|
||||||
|
|
||||||
@Immutable
|
|
||||||
@Serializable
|
|
||||||
data class Contributor(
|
|
||||||
val username: String,
|
|
||||||
val avatarUrl: String,
|
|
||||||
val commits: Int,
|
|
||||||
@Serializable(with = ImmutableListSerializer::class)
|
|
||||||
val repositories: ImmutableList<Repository>,
|
|
||||||
) {
|
|
||||||
@Immutable
|
|
||||||
@Serializable
|
|
||||||
data class Repository(
|
|
||||||
val name: String,
|
|
||||||
val commits: Int,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.aliucord.manager.network.models
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class Developer(
|
||||||
|
val username: String,
|
||||||
|
val avatarUrl: String,
|
||||||
|
val commits: Int,
|
||||||
|
val repositories: List<Repository>,
|
||||||
|
val role: String? = null
|
||||||
|
) {
|
||||||
|
@Serializable
|
||||||
|
data class Repository(
|
||||||
|
val name: String,
|
||||||
|
val commits: Int
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,7 @@ package com.aliucord.manager.network.services
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.aliucord.manager.network.utils.*
|
import com.aliucord.manager.network.utils.*
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.request.HttpRequestBuilder
|
import io.ktor.client.request.HttpRequestBuilder
|
||||||
import io.ktor.client.request.request
|
import io.ktor.client.request.request
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ class ShiggyGithubService(
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val ORG = "kmmiio99o"
|
const val ORG = "OTKUSteyler"
|
||||||
const val MANAGER_REPO = "ShiggyManager"
|
const val MANAGER_REPO = "GoonManager"
|
||||||
const val XPOSED_REPO = "ShiggyXposed"
|
const val XPOSED_REPO = "GoonXposed"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ data class SemVer(
|
||||||
?: throw IllegalArgumentException("Invalid semver string $version")
|
?: throw IllegalArgumentException("Invalid semver string $version")
|
||||||
|
|
||||||
fun parseOrNull(version: String): SemVer? {
|
fun parseOrNull(version: String): SemVer? {
|
||||||
val parts = version.removePrefix("v").split(".")
|
val parts = version.removePrefix("v").removePrefix("V").split(".")
|
||||||
|
|
||||||
if (parts.size != 3)
|
if (parts.size != 3)
|
||||||
return null
|
return null
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data stored inside patched APKs as ~~"aliucord.json"~~ "shiggy.json" in order to preserve install-time information about Aliucord and the Manager.
|
* Data stored inside patched APKs as ~~"aliucord.json"~~ "shiggy.json" in order to preserve install-time information about Aliucord and the Manager.
|
||||||
|
* Metadata about an Aliucord installation embedded in the APK.
|
||||||
|
* @param options The patch options used for this installation
|
||||||
|
* @param goonXposedVersion The version of GoonXposed used for this installation
|
||||||
*/
|
*/
|
||||||
@Serializable
|
@Serializable
|
||||||
data class InstallMetadata(
|
data class InstallMetadata(
|
||||||
|
|
@ -47,5 +50,5 @@ data class InstallMetadata(
|
||||||
/**
|
/**
|
||||||
* Version of ShiggyXposed embedded into the APK.
|
* Version of ShiggyXposed embedded into the APK.
|
||||||
*/
|
*/
|
||||||
val shiggyXposedVersion: SemVer?,
|
val goonXposedVersion: SemVer,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import com.aliucord.manager.patcher.steps.StepGroup
|
||||||
import com.aliucord.manager.patcher.steps.base.DownloadStep
|
import com.aliucord.manager.patcher.steps.base.DownloadStep
|
||||||
import com.aliucord.manager.patcher.steps.base.Step
|
import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import com.aliucord.manager.ui.util.InstallNotifications
|
import com.aliucord.manager.ui.util.InstallNotifications
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package com.aliucord.manager.patcher.steps
|
||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.compose.runtime.Immutable
|
import androidx.compose.runtime.Immutable
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import com.aliucord.manager.manager.download.KtorDownloadManager
|
||||||
import com.aliucord.manager.patcher.StepRunner
|
import com.aliucord.manager.patcher.StepRunner
|
||||||
import com.aliucord.manager.patcher.steps.StepGroup
|
import com.aliucord.manager.patcher.steps.StepGroup
|
||||||
import com.aliucord.manager.util.*
|
import com.aliucord.manager.util.*
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import com.aliucord.manager.patcher.StepRunner
|
||||||
import com.aliucord.manager.patcher.steps.StepGroup
|
import com.aliucord.manager.patcher.steps.StepGroup
|
||||||
import com.aliucord.manager.patcher.steps.base.Step
|
import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import com.aliucord.manager.patcher.util.InsufficientStorageException
|
import com.aliucord.manager.patcher.util.InsufficientStorageException
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import com.aliucord.manager.patcher.steps.base.DownloadStep
|
||||||
import com.aliucord.manager.patcher.steps.base.IDexProvider
|
import com.aliucord.manager.patcher.steps.base.IDexProvider
|
||||||
import com.aliucord.manager.patcher.steps.patch.ReorganizeDexStep
|
import com.aliucord.manager.patcher.steps.patch.ReorganizeDexStep
|
||||||
import com.github.diamondminer88.zip.ZipReader
|
import com.github.diamondminer88.zip.ZipReader
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package com.aliucord.manager.patcher.steps.download
|
||||||
import com.aliucord.manager.manager.PathManager
|
import com.aliucord.manager.manager.PathManager
|
||||||
import com.aliucord.manager.network.services.RNATrackerService.Companion.BASE_URL
|
import com.aliucord.manager.network.services.RNATrackerService.Companion.BASE_URL
|
||||||
import com.aliucord.manager.patcher.steps.base.DownloadDiscordRNAStep
|
import com.aliucord.manager.patcher.steps.base.DownloadDiscordRNAStep
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
class DownloadDiscordRNABaseStep : DownloadDiscordRNAStep() {
|
class DownloadDiscordRNABaseStep : DownloadDiscordRNAStep() {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package com.aliucord.manager.patcher.steps.download
|
||||||
import com.aliucord.manager.manager.PathManager
|
import com.aliucord.manager.manager.PathManager
|
||||||
import com.aliucord.manager.network.services.RNATrackerService.Companion.BASE_URL
|
import com.aliucord.manager.network.services.RNATrackerService.Companion.BASE_URL
|
||||||
import com.aliucord.manager.patcher.steps.base.DownloadDiscordRNAStep
|
import com.aliucord.manager.patcher.steps.base.DownloadDiscordRNAStep
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
class DownloadDiscordRNALangStep : DownloadDiscordRNAStep() {
|
class DownloadDiscordRNALangStep : DownloadDiscordRNAStep() {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import android.os.Build
|
||||||
import com.aliucord.manager.manager.PathManager
|
import com.aliucord.manager.manager.PathManager
|
||||||
import com.aliucord.manager.network.services.RNATrackerService.Companion.BASE_URL
|
import com.aliucord.manager.network.services.RNATrackerService.Companion.BASE_URL
|
||||||
import com.aliucord.manager.patcher.steps.base.DownloadDiscordRNAStep
|
import com.aliucord.manager.patcher.steps.base.DownloadDiscordRNAStep
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
class DownloadDiscordRNALibStep : DownloadDiscordRNAStep() {
|
class DownloadDiscordRNALibStep : DownloadDiscordRNAStep() {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package com.aliucord.manager.patcher.steps.download
|
||||||
import com.aliucord.manager.manager.PathManager
|
import com.aliucord.manager.manager.PathManager
|
||||||
import com.aliucord.manager.network.services.RNATrackerService.Companion.BASE_URL
|
import com.aliucord.manager.network.services.RNATrackerService.Companion.BASE_URL
|
||||||
import com.aliucord.manager.patcher.steps.base.DownloadDiscordRNAStep
|
import com.aliucord.manager.patcher.steps.base.DownloadDiscordRNAStep
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
class DownloadDiscordRNAResourcesStep : DownloadDiscordRNAStep() {
|
class DownloadDiscordRNAResourcesStep : DownloadDiscordRNAStep() {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ package com.aliucord.manager.patcher.steps.download
|
||||||
import androidx.compose.runtime.Stable
|
import androidx.compose.runtime.Stable
|
||||||
import com.aliucord.manager.manager.PathManager
|
import com.aliucord.manager.manager.PathManager
|
||||||
import com.aliucord.manager.patcher.steps.base.DownloadStep
|
import com.aliucord.manager.patcher.steps.base.DownloadStep
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ import com.aliucord.manager.patcher.steps.base.*
|
||||||
import com.aliucord.manager.patcher.steps.patch.ReorganizeDexStep
|
import com.aliucord.manager.patcher.steps.patch.ReorganizeDexStep
|
||||||
import com.aliucord.manager.patcher.steps.prepare.FetchInfoStep
|
import com.aliucord.manager.patcher.steps.prepare.FetchInfoStep
|
||||||
import com.aliucord.manager.ui.components.dialogs.CustomComponentVersionPicker
|
import com.aliucord.manager.ui.components.dialogs.CustomComponentVersionPicker
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import com.aliucord.manager.manager.PathManager
|
||||||
import com.aliucord.manager.patcher.steps.base.DownloadStep
|
import com.aliucord.manager.patcher.steps.base.DownloadStep
|
||||||
import com.aliucord.manager.patcher.steps.base.IDexProvider
|
import com.aliucord.manager.patcher.steps.base.IDexProvider
|
||||||
import com.aliucord.manager.patcher.steps.patch.ReorganizeDexStep
|
import com.aliucord.manager.patcher.steps.patch.ReorganizeDexStep
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ import com.aliucord.manager.patcher.steps.base.DownloadStep
|
||||||
import com.aliucord.manager.patcher.steps.base.StepState
|
import com.aliucord.manager.patcher.steps.base.StepState
|
||||||
import com.aliucord.manager.patcher.steps.prepare.FetchInfoStep
|
import com.aliucord.manager.patcher.steps.prepare.FetchInfoStep
|
||||||
import com.aliucord.manager.ui.components.dialogs.CustomComponentVersionPicker
|
import com.aliucord.manager.ui.components.dialogs.CustomComponentVersionPicker
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import com.aliucord.manager.network.utils.SemVer
|
||||||
import com.aliucord.manager.network.utils.getOrThrow
|
import com.aliucord.manager.network.utils.getOrThrow
|
||||||
import com.aliucord.manager.patcher.StepRunner
|
import com.aliucord.manager.patcher.StepRunner
|
||||||
import com.aliucord.manager.patcher.steps.base.DownloadStep
|
import com.aliucord.manager.patcher.steps.base.DownloadStep
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
class DownloadShiggyXposedStep : DownloadStep() {
|
class DownloadShiggyXposedStep : DownloadStep() {
|
||||||
|
|
@ -22,7 +22,7 @@ class DownloadShiggyXposedStep : DownloadStep() {
|
||||||
|
|
||||||
override suspend fun execute(container: StepRunner) {
|
override suspend fun execute(container: StepRunner) {
|
||||||
val latestRelease = shiggyGithubService.getLatestXposedRelease().getOrThrow()
|
val latestRelease = shiggyGithubService.getLatestXposedRelease().getOrThrow()
|
||||||
container.log("Latest ShiggyXposed release is ${latestRelease.name}")
|
container.log("Latest GoonXposed release is ${latestRelease.name}")
|
||||||
|
|
||||||
targetVersion = SemVer.parse(latestRelease.name)
|
targetVersion = SemVer.parse(latestRelease.name)
|
||||||
targetUrl = latestRelease.assets.first { it.name == "app-release.apk" }.browserDownloadUrl
|
targetUrl = latestRelease.assets.first { it.name == "app-release.apk" }.browserDownloadUrl
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import com.aliucord.manager.patcher.steps.StepGroup
|
||||||
import com.aliucord.manager.patcher.steps.base.Step
|
import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import com.aliucord.manager.patcher.steps.download.CopyDependenciesStep
|
import com.aliucord.manager.patcher.steps.download.CopyDependenciesStep
|
||||||
import com.github.diamondminer88.zip.*
|
import com.github.diamondminer88.zip.*
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import com.aliucord.manager.manager.PreferencesManager
|
||||||
import com.aliucord.manager.patcher.StepRunner
|
import com.aliucord.manager.patcher.StepRunner
|
||||||
import com.aliucord.manager.patcher.steps.StepGroup
|
import com.aliucord.manager.patcher.steps.StepGroup
|
||||||
import com.aliucord.manager.patcher.steps.base.Step
|
import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,18 @@ import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import com.aliucord.manager.patcher.steps.download.CopyDependenciesStep
|
import com.aliucord.manager.patcher.steps.download.CopyDependenciesStep
|
||||||
import com.aliucord.manager.patcher.steps.download.DownloadShiggyXposedStep
|
import com.aliucord.manager.patcher.steps.download.DownloadShiggyXposedStep
|
||||||
import com.aliucord.manager.patcher.util.Signer
|
import com.aliucord.manager.patcher.util.Signer
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import org.lsposed.lspatch.share.LSPConfig
|
import org.lsposed.lspatch.share.LSPConfig
|
||||||
import org.lsposed.patch.LSPatch
|
import org.lsposed.patch.LSPatch
|
||||||
import org.lsposed.patch.util.Logger
|
import org.lsposed.patch.util.Logger
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
class InjectShiggyXposedStep : Step() {
|
class InjectGoonXposedStep : Step() {
|
||||||
override val group: StepGroup = StepGroup.Install
|
override val group: StepGroup = StepGroup.Install
|
||||||
override val localizedName: Int = R.string.patch_step_inject_shiggy
|
override val localizedName: Int = R.string.patch_step_inject_goon
|
||||||
|
|
||||||
suspend fun patch(
|
suspend fun patch(
|
||||||
container: StepRunner,
|
container: StepRunner,
|
||||||
|
|
@ -82,7 +83,15 @@ class InjectShiggyXposedStep : Step() {
|
||||||
// FilenameUtils.getBaseName(apkFileName),
|
// FilenameUtils.getBaseName(apkFileName),
|
||||||
// LSPConfig.instance.VERSION_CODE)
|
// LSPConfig.instance.VERSION_CODE)
|
||||||
// )
|
// )
|
||||||
val patchedApkName = "${baseName}-${LSPConfig.instance.VERSION_CODE}-lspatched.apk"
|
// Note: LSPatch uses Locale.getDefault() which can produce locale-specific numerals
|
||||||
|
// (e.g., Arabic numerals on Arabic locales). We must use Locale.US to ensure
|
||||||
|
// consistent filename matching regardless of device locale.
|
||||||
|
val patchedApkName = String.format(
|
||||||
|
Locale.US,
|
||||||
|
"%s-%d-lspatched.apk",
|
||||||
|
baseName,
|
||||||
|
LSPConfig.instance.VERSION_CODE
|
||||||
|
)
|
||||||
val patchedApk = File(tempDir, patchedApkName)
|
val patchedApk = File(tempDir, patchedApkName)
|
||||||
|
|
||||||
if (patchedApk.exists()) {
|
if (patchedApk.exists()) {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import com.aliucord.manager.ui.screens.patchopts.PatchOptions
|
||||||
import com.aliucord.manager.ui.util.InstallNotifications
|
import com.aliucord.manager.ui.util.InstallNotifications
|
||||||
import com.aliucord.manager.util.isPackageInstalled
|
import com.aliucord.manager.util.isPackageInstalled
|
||||||
import com.aliucord.manager.util.isPlayProtectEnabled
|
import com.aliucord.manager.util.isPlayProtectEnabled
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import com.aliucord.manager.patcher.steps.StepGroup
|
||||||
import com.aliucord.manager.patcher.steps.base.Step
|
import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import com.aliucord.manager.patcher.steps.download.CopyDependenciesStep
|
import com.aliucord.manager.patcher.steps.download.CopyDependenciesStep
|
||||||
import com.aliucord.manager.patcher.util.Signer
|
import com.aliucord.manager.patcher.util.Signer
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import com.aliucord.manager.patcher.steps.download.CopyDependenciesStep
|
import com.aliucord.manager.patcher.steps.download.CopyDependenciesStep
|
||||||
import com.aliucord.manager.patcher.steps.download.DownloadAliuhookStep
|
import com.aliucord.manager.patcher.steps.download.DownloadAliuhookStep
|
||||||
import com.github.diamondminer88.zip.*
|
import com.github.diamondminer88.zip.*
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ import com.aliucord.manager.ui.screens.patchopts.PatchOptions.IconReplacement
|
||||||
import com.aliucord.manager.util.getResBytes
|
import com.aliucord.manager.util.getResBytes
|
||||||
import com.github.diamondminer88.zip.ZipWriter
|
import com.github.diamondminer88.zip.ZipWriter
|
||||||
import com.google.devrel.gmscore.tools.apk.arsc.*
|
import com.google.devrel.gmscore.tools.apk.arsc.*
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import com.aliucord.manager.patcher.util.ManifestPatcher
|
||||||
import com.aliucord.manager.ui.screens.patchopts.PatchOptions
|
import com.aliucord.manager.ui.screens.patchopts.PatchOptions
|
||||||
import com.github.diamondminer88.zip.ZipReader
|
import com.github.diamondminer88.zip.ZipReader
|
||||||
import com.github.diamondminer88.zip.ZipWriter
|
import com.github.diamondminer88.zip.ZipWriter
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Patch the APK's AndroidManifest.xml
|
* Patch the APK's AndroidManifest.xml
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import com.aliucord.manager.patcher.steps.base.IDexProvider
|
||||||
import com.aliucord.manager.patcher.steps.base.Step
|
import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import com.aliucord.manager.patcher.steps.download.CopyDependenciesStep
|
import com.aliucord.manager.patcher.steps.download.CopyDependenciesStep
|
||||||
import com.github.diamondminer88.zip.*
|
import com.github.diamondminer88.zip.*
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import com.aliucord.manager.patcher.steps.download.*
|
import com.aliucord.manager.patcher.steps.download.*
|
||||||
import com.aliucord.manager.ui.screens.patchopts.PatchOptions
|
import com.aliucord.manager.ui.screens.patchopts.PatchOptions
|
||||||
import com.github.diamondminer88.zip.ZipWriter
|
import com.github.diamondminer88.zip.ZipWriter
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
@ -31,7 +31,7 @@ class SaveMetadataStep(private val options: PatchOptions) : Step(), KoinComponen
|
||||||
val aliuhook = container.getStepOrNull<DownloadAliuhookStep>()
|
val aliuhook = container.getStepOrNull<DownloadAliuhookStep>()
|
||||||
val injector = container.getStepOrNull<DownloadInjectorStep>()
|
val injector = container.getStepOrNull<DownloadInjectorStep>()
|
||||||
val patches = container.getStepOrNull<DownloadPatchesStep>()
|
val patches = container.getStepOrNull<DownloadPatchesStep>()
|
||||||
val shiggyXposed = container.getStepOrNull<DownloadShiggyXposedStep>()
|
val goonXposed = container.getStepOrNull<DownloadShiggyXposedStep>()
|
||||||
|
|
||||||
val metadata = InstallMetadata(
|
val metadata = InstallMetadata(
|
||||||
options = options,
|
options = options,
|
||||||
|
|
@ -41,12 +41,12 @@ class SaveMetadataStep(private val options: PatchOptions) : Step(), KoinComponen
|
||||||
injectorVersion = injector?.targetVersion,
|
injectorVersion = injector?.targetVersion,
|
||||||
patchesVersion = patches?.targetVersion,
|
patchesVersion = patches?.targetVersion,
|
||||||
lspatchVersion = LSPConfig.instance.VERSION_CODE,
|
lspatchVersion = LSPConfig.instance.VERSION_CODE,
|
||||||
shiggyXposedVersion = shiggyXposed?.targetVersion,
|
goonXposedVersion = goonXposed?.targetVersion ?: SemVer.parse("0.0.0"), // Provide a default if null
|
||||||
)
|
)
|
||||||
|
|
||||||
container.log("Writing serialized install metadata to APK")
|
container.log("Writing serialized install metadata to APK")
|
||||||
ZipWriter(apk, /* append = */ true).use {
|
ZipWriter(apk, /* append = */ true).use {
|
||||||
it.writeEntry("shiggy.json", json.encodeToString<InstallMetadata>(metadata))
|
it.writeEntry("goon.json", json.encodeToString<InstallMetadata>(metadata))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import com.github.diamondminer88.zip.ZipReader
|
||||||
import com.github.difflib.DiffUtils
|
import com.github.difflib.DiffUtils
|
||||||
import com.github.difflib.UnifiedDiffUtils
|
import com.github.difflib.UnifiedDiffUtils
|
||||||
import com.github.difflib.patch.Patch
|
import com.github.difflib.patch.Patch
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
import java.io.FileNotFoundException
|
import java.io.FileNotFoundException
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import com.aliucord.manager.patcher.steps.base.StepState
|
import com.aliucord.manager.patcher.steps.base.StepState
|
||||||
import com.aliucord.manager.ui.screens.patchopts.PatchOptions
|
import com.aliucord.manager.ui.screens.patchopts.PatchOptions
|
||||||
import com.aliucord.manager.util.*
|
import com.aliucord.manager.util.*
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import com.aliucord.manager.patcher.steps.StepGroup
|
||||||
import com.aliucord.manager.patcher.steps.base.Step
|
import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import com.aliucord.manager.ui.screens.patchopts.PatchOptions
|
import com.aliucord.manager.ui.screens.patchopts.PatchOptions
|
||||||
import com.aliucord.manager.ui.screens.patchopts.VersionPreference
|
import com.aliucord.manager.ui.screens.patchopts.VersionPreference
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
import kotlin.properties.Delegates
|
import kotlin.properties.Delegates
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import com.aliucord.manager.network.utils.getOrThrow
|
||||||
import com.aliucord.manager.patcher.StepRunner
|
import com.aliucord.manager.patcher.StepRunner
|
||||||
import com.aliucord.manager.patcher.steps.StepGroup
|
import com.aliucord.manager.patcher.steps.StepGroup
|
||||||
import com.aliucord.manager.patcher.steps.base.Step
|
import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import com.aliucord.manager.patcher.StepRunner
|
||||||
import com.aliucord.manager.patcher.steps.StepGroup
|
import com.aliucord.manager.patcher.steps.StepGroup
|
||||||
import com.aliucord.manager.patcher.steps.base.Step
|
import com.aliucord.manager.patcher.steps.base.Step
|
||||||
import com.aliucord.manager.patcher.steps.base.StepState
|
import com.aliucord.manager.patcher.steps.base.StepState
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.inject
|
import org.koin.core.component.inject
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -252,6 +252,8 @@ object ManifestPatcher {
|
||||||
extractNativeLibs ?: false
|
extractNativeLibs ?: false
|
||||||
private var shouldAddMetadata =
|
private var shouldAddMetadata =
|
||||||
addManagerMetadata ?: false
|
addManagerMetadata ?: false
|
||||||
|
private var shouldAddCleartext = true
|
||||||
|
|
||||||
|
|
||||||
override fun attr(
|
override fun attr(
|
||||||
ns: String?,
|
ns: String?,
|
||||||
|
|
@ -269,6 +271,12 @@ object ManifestPatcher {
|
||||||
shouldAddExtractNativeLibs = false
|
shouldAddExtractNativeLibs = false
|
||||||
if (name == DEBUGGABLE)
|
if (name == DEBUGGABLE)
|
||||||
shouldAddDebuggable = false
|
shouldAddDebuggable = false
|
||||||
|
if (name == "usesCleartextTraffic") {
|
||||||
|
shouldAddCleartext = false
|
||||||
|
super.attr(ns, name, 0x010104ec, TYPE_INT_BOOLEAN, 1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
super.attr(
|
super.attr(
|
||||||
ns,
|
ns,
|
||||||
name,
|
name,
|
||||||
|
|
@ -425,7 +433,15 @@ object ManifestPatcher {
|
||||||
0
|
0
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (shouldAddCleartext) {
|
||||||
|
super.attr(
|
||||||
|
ANDROID_NAMESPACE,
|
||||||
|
"usesCleartextTraffic",
|
||||||
|
0x010104ec,
|
||||||
|
TYPE_INT_BOOLEAN,
|
||||||
|
1
|
||||||
|
)
|
||||||
|
}
|
||||||
super.end()
|
super.end()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ package com.aliucord.manager.patcher.util
|
||||||
|
|
||||||
import com.aliucord.manager.manager.PathManager
|
import com.aliucord.manager.manager.PathManager
|
||||||
import com.android.apksig.ApkSigner
|
import com.android.apksig.ApkSigner
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import org.bouncycastle.asn1.x500.X500Name
|
import org.bouncycastle.asn1.x500.X500Name
|
||||||
import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
|
import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
|
||||||
import org.bouncycastle.cert.X509v3CertificateBuilder
|
import org.bouncycastle.cert.X509v3CertificateBuilder
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import cafe.adriel.voyager.navigator.LocalNavigator
|
import cafe.adriel.voyager.navigator.LocalNavigator
|
||||||
import com.aliucord.manager.util.back
|
import com.aliucord.manager.util.back
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standalone back button for interacting with the current navigator.
|
* Standalone back button for interacting with the current navigator.
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import androidx.core.graphics.applyCanvas
|
||||||
import androidx.core.graphics.createBitmap
|
import androidx.core.graphics.createBitmap
|
||||||
import androidx.core.graphics.drawable.toDrawable
|
import androidx.core.graphics.drawable.toDrawable
|
||||||
import com.aliucord.manager.ui.screens.patchopts.PatchOptions.IconReplacement
|
import com.aliucord.manager.ui.screens.patchopts.PatchOptions.IconReplacement
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
// Sizing information is obtained from here:
|
// Sizing information is obtained from here:
|
||||||
// https://medium.com/google-design/designing-adaptive-icons-515af294c783
|
// https://medium.com/google-design/designing-adaptive-icons-515af294c783
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@ import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.font.FontStyle
|
import androidx.compose.ui.text.font.FontStyle
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import coil3.compose.SubcomposeAsyncImage
|
import coil3.compose.SubcomposeAsyncImage
|
||||||
import com.aliucord.manager.network.models.Contributor
|
import com.aliucord.manager.network.models.Developer
|
||||||
import com.valentinilk.shimmer.shimmer
|
import com.valentinilk.shimmer.shimmer
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ContributorCommitsItem(
|
fun ContributorCommitsItem(
|
||||||
user: Contributor,
|
user: Developer,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
val uriHandler = LocalUriHandler.current
|
val uriHandler = LocalUriHandler.current
|
||||||
|
|
@ -8,7 +8,7 @@ import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LoadFailure(modifier: Modifier = Modifier) {
|
fun LoadFailure(modifier: Modifier = Modifier) {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ProjectHeader(
|
fun ProjectHeader(
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.aliucord.manager.ui.util.mirrorVertically
|
import com.aliucord.manager.ui.util.mirrorVertically
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ResetToDefaultButton(
|
fun ResetToDefaultButton(
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.window.DialogProperties
|
import androidx.compose.ui.window.DialogProperties
|
||||||
import com.aliucord.manager.network.utils.SemVer
|
import com.aliucord.manager.network.utils.SemVer
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun CustomComponentVersionPicker(
|
fun CustomComponentVersionPicker(
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun InstallerAbortDialog(
|
fun InstallerAbortDialog(
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.window.DialogProperties
|
import androidx.compose.ui.window.DialogProperties
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun NetworkWarningDialog(
|
fun NetworkWarningDialog(
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.window.DialogProperties
|
import androidx.compose.ui.window.DialogProperties
|
||||||
import com.aliucord.manager.ui.theme.customColors
|
import com.aliucord.manager.ui.theme.customColors
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun PlayProtectDialog(
|
fun PlayProtectDialog(
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.window.DialogProperties
|
import androidx.compose.ui.window.DialogProperties
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import com.google.accompanist.permissions.*
|
import com.google.accompanist.permissions.*
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@OptIn(ExperimentalPermissionsApi::class)
|
@OptIn(ExperimentalPermissionsApi::class)
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.window.DialogProperties
|
import androidx.compose.ui.window.DialogProperties
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun UnknownSourcesPermissionDialog() {
|
fun UnknownSourcesPermissionDialog() {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import androidx.compose.ui.tooling.preview.*
|
||||||
import com.aliucord.manager.ui.screens.patching.components.TextBanner
|
import com.aliucord.manager.ui.screens.patching.components.TextBanner
|
||||||
import com.aliucord.manager.ui.theme.ManagerTheme
|
import com.aliucord.manager.ui.theme.ManagerTheme
|
||||||
import com.aliucord.manager.ui.theme.customColors
|
import com.aliucord.manager.ui.theme.customColors
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||||
|
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
package com.aliucord.manager.ui.previews.dialogs
|
|
||||||
|
|
||||||
import android.content.res.Configuration
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
|
||||||
import com.aliucord.manager.ui.screens.plugins.components.dialogs.UninstallPluginDialog
|
|
||||||
import com.aliucord.manager.ui.theme.ManagerTheme
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
||||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
|
||||||
private fun UninstallPluginDialogPreview() {
|
|
||||||
ManagerTheme {
|
|
||||||
UninstallPluginDialog(
|
|
||||||
pluginName = "FakeNitro",
|
|
||||||
onConfirm = {},
|
|
||||||
onDismiss = {},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -14,7 +14,7 @@ import com.aliucord.manager.ui.screens.iconopts.IconOptionsMode
|
||||||
import com.aliucord.manager.ui.screens.iconopts.IconOptionsScreenContent
|
import com.aliucord.manager.ui.screens.iconopts.IconOptionsScreenContent
|
||||||
import com.aliucord.manager.ui.screens.patchopts.PatchOptions.IconReplacement
|
import com.aliucord.manager.ui.screens.patchopts.PatchOptions.IconReplacement
|
||||||
import com.aliucord.manager.ui.theme.ManagerTheme
|
import com.aliucord.manager.ui.theme.ManagerTheme
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import dev.zt64.compose.pipette.HsvColor
|
import dev.zt64.compose.pipette.HsvColor
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
package com.aliucord.manager.ui.previews.screens.about
|
|
||||||
|
|
||||||
import android.content.res.Configuration
|
|
||||||
import androidx.compose.runtime.*
|
|
||||||
import androidx.compose.ui.tooling.preview.*
|
|
||||||
import com.aliucord.manager.network.models.Contributor
|
|
||||||
import com.aliucord.manager.ui.screens.about.AboutScreenContent
|
|
||||||
import com.aliucord.manager.ui.screens.about.AboutScreenState
|
|
||||||
import com.aliucord.manager.ui.theme.ManagerTheme
|
|
||||||
import com.aliucord.manager.ui.util.emptyImmutableList
|
|
||||||
import com.aliucord.manager.util.serialization.ImmutableListSerializer
|
|
||||||
import kotlinx.collections.immutable.*
|
|
||||||
import kotlinx.serialization.json.Json
|
|
||||||
|
|
||||||
// This preview has scrollable content that cannot be properly viewed from an IDE preview
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
||||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
|
||||||
private fun AboutScreenLoadedPreview(
|
|
||||||
@PreviewParameter(ContributorsProvider::class) contributors: ImmutableList<Contributor>,
|
|
||||||
) {
|
|
||||||
ManagerTheme {
|
|
||||||
AboutScreenContent(
|
|
||||||
state = remember { mutableStateOf(AboutScreenState.Loaded(contributors)) },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ContributorsProvider : PreviewParameterProvider<ImmutableList<Contributor>> {
|
|
||||||
private val realDataRaw =
|
|
||||||
"[{\"username\":\"maisymoe\",\"avatarUrl\":\"https://avatars.githubusercontent.com/u/61095277?v=4\",\"repositories\":]"
|
|
||||||
private val realData =
|
|
||||||
Json.decodeFromString(ImmutableListSerializer(Contributor.serializer()), realDataRaw)
|
|
||||||
|
|
||||||
override val values =
|
|
||||||
sequenceOf(
|
|
||||||
emptyImmutableList<Contributor>(),
|
|
||||||
persistentListOf(
|
|
||||||
Contributor(
|
|
||||||
username =
|
|
||||||
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
|
|
||||||
avatarUrl = "UNUSED",
|
|
||||||
commits = Int.MAX_VALUE,
|
|
||||||
repositories =
|
|
||||||
(realData[0].repositories + realData[0].repositories)
|
|
||||||
.toImmutableList(),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
realData,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
@ -34,7 +34,6 @@ private fun HomeScreenLoadedPreview(
|
||||||
onUpdate = {},
|
onUpdate = {},
|
||||||
onOpenApp = {},
|
onOpenApp = {},
|
||||||
onOpenAppInfo = {},
|
onOpenAppInfo = {},
|
||||||
onOpenPlugins = {},
|
|
||||||
onUninstall = {},
|
onUninstall = {},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
package com.aliucord.manager.ui.previews.screens.plugins
|
|
||||||
|
|
||||||
import android.content.res.Configuration
|
|
||||||
import androidx.compose.runtime.*
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
|
||||||
import com.aliucord.manager.ui.screens.plugins.PluginsScreenContent
|
|
||||||
import com.aliucord.manager.ui.theme.ManagerTheme
|
|
||||||
import com.aliucord.manager.ui.util.emptyImmutableList
|
|
||||||
|
|
||||||
// This preview has interactable content that cannot be tested from an IDE preview
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
||||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
|
||||||
private fun PluginsScreenFailedPreview() {
|
|
||||||
val filterState = remember { mutableStateOf("") }
|
|
||||||
|
|
||||||
ManagerTheme {
|
|
||||||
PluginsScreenContent(
|
|
||||||
searchText = filterState,
|
|
||||||
setSearchText = filterState::value::set,
|
|
||||||
isError = true,
|
|
||||||
plugins = emptyImmutableList(),
|
|
||||||
onPluginUninstall = {},
|
|
||||||
onPluginChangelog = {},
|
|
||||||
onPluginToggle = { name, enabled -> },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
||||||
package com.aliucord.manager.ui.previews.screens.plugins
|
|
||||||
|
|
||||||
import android.content.res.Configuration
|
|
||||||
import androidx.compose.runtime.*
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
|
||||||
import com.aliucord.manager.ui.screens.plugins.PluginsScreenContent
|
|
||||||
import com.aliucord.manager.ui.screens.plugins.model.PluginItem
|
|
||||||
import com.aliucord.manager.ui.screens.plugins.model.PluginManifest
|
|
||||||
import com.aliucord.manager.ui.theme.ManagerTheme
|
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
|
||||||
import java.util.UUID
|
|
||||||
|
|
||||||
// This preview has scrollable/interactable content that cannot be tested from an IDE preview
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
||||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
|
||||||
private fun PluginsScreenLoadedPreview() {
|
|
||||||
val filterState = remember { mutableStateOf("test") }
|
|
||||||
|
|
||||||
ManagerTheme {
|
|
||||||
PluginsScreenContent(
|
|
||||||
searchText = filterState,
|
|
||||||
setSearchText = filterState::value::set,
|
|
||||||
isError = false,
|
|
||||||
plugins = plugins,
|
|
||||||
onPluginUninstall = {},
|
|
||||||
onPluginChangelog = {},
|
|
||||||
onPluginToggle = { name, enabled -> },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private val plugins: ImmutableList<PluginItem> = persistentListOf(
|
|
||||||
PluginItem(
|
|
||||||
path = UUID.randomUUID().toString(),
|
|
||||||
manifest = PluginManifest(
|
|
||||||
name = "CloseDMs",
|
|
||||||
authors = persistentListOf(
|
|
||||||
PluginManifest.Author(name = "Diamond", id = 0L),
|
|
||||||
),
|
|
||||||
description = "Shortcut to close DMs in the DM context menu.",
|
|
||||||
version = "1.0.0",
|
|
||||||
updateUrl = "",
|
|
||||||
changelog = "",
|
|
||||||
changelogMedia = null,
|
|
||||||
)
|
|
||||||
),
|
|
||||||
PluginItem(
|
|
||||||
path = UUID.randomUUID().toString(),
|
|
||||||
manifest = PluginManifest(
|
|
||||||
name = "ConfigurableStickerSizes",
|
|
||||||
authors = persistentListOf(
|
|
||||||
PluginManifest.Author(name = "rushii", id = 0L, hyperlink = false),
|
|
||||||
),
|
|
||||||
description = "Makes sticker sizes configurable.",
|
|
||||||
version = "1.1.5",
|
|
||||||
updateUrl = "",
|
|
||||||
changelog = "",
|
|
||||||
changelogMedia = null,
|
|
||||||
)
|
|
||||||
),
|
|
||||||
PluginItem(
|
|
||||||
path = UUID.randomUUID().toString(),
|
|
||||||
manifest = PluginManifest(
|
|
||||||
name = "AudioPlayer",
|
|
||||||
authors = persistentListOf(
|
|
||||||
PluginManifest.Author(name = "rushii", id = 0L, hyperlink = false),
|
|
||||||
),
|
|
||||||
description = "Makes audio files playable.",
|
|
||||||
version = "0.0.1",
|
|
||||||
updateUrl = "",
|
|
||||||
changelog = "",
|
|
||||||
changelogMedia = null,
|
|
||||||
)
|
|
||||||
),
|
|
||||||
PluginItem(
|
|
||||||
path = UUID.randomUUID().toString(),
|
|
||||||
manifest = PluginManifest(
|
|
||||||
name = "TypingIndicators",
|
|
||||||
authors = persistentListOf(
|
|
||||||
PluginManifest.Author(name = "rushii", id = 0L, hyperlink = false),
|
|
||||||
),
|
|
||||||
description = "Adds typing indicators to channels that people are currently typing in.",
|
|
||||||
version = "1.1.0",
|
|
||||||
updateUrl = "",
|
|
||||||
changelog = "",
|
|
||||||
changelogMedia = null,
|
|
||||||
)
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
package com.aliucord.manager.ui.previews.screens.plugins
|
|
||||||
|
|
||||||
import android.content.res.Configuration
|
|
||||||
import androidx.compose.runtime.*
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
|
||||||
import com.aliucord.manager.ui.screens.plugins.PluginsScreenContent
|
|
||||||
import com.aliucord.manager.ui.theme.ManagerTheme
|
|
||||||
import com.aliucord.manager.ui.util.emptyImmutableList
|
|
||||||
|
|
||||||
// This preview has interactable content that cannot be tested from an IDE preview
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
|
|
||||||
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO)
|
|
||||||
private fun PluginsScreenNonePreview() {
|
|
||||||
val filterState = remember { mutableStateOf("") }
|
|
||||||
|
|
||||||
ManagerTheme {
|
|
||||||
PluginsScreenContent(
|
|
||||||
searchText = filterState,
|
|
||||||
setSearchText = filterState::value::set,
|
|
||||||
isError = false,
|
|
||||||
plugins = emptyImmutableList(),
|
|
||||||
onPluginUninstall = {},
|
|
||||||
onPluginChangelog = {},
|
|
||||||
onPluginToggle = { name, enabled -> },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -2,56 +2,67 @@ package com.aliucord.manager.ui.screens.about
|
||||||
|
|
||||||
import cafe.adriel.voyager.core.model.StateScreenModel
|
import cafe.adriel.voyager.core.model.StateScreenModel
|
||||||
import cafe.adriel.voyager.core.model.screenModelScope
|
import cafe.adriel.voyager.core.model.screenModelScope
|
||||||
import com.aliucord.manager.network.models.Contributor
|
import com.aliucord.manager.network.models.Developer
|
||||||
import com.aliucord.manager.network.services.HttpService
|
import com.aliucord.manager.network.services.HttpService
|
||||||
import com.aliucord.manager.network.utils.fold
|
|
||||||
import com.aliucord.manager.ui.util.toUnsafeImmutable
|
import com.aliucord.manager.ui.util.toUnsafeImmutable
|
||||||
import com.aliucord.manager.util.launchIO
|
import com.aliucord.manager.util.launchIO
|
||||||
import io.ktor.client.request.url
|
|
||||||
import kotlinx.serialization.Serializable
|
|
||||||
import kotlinx.serialization.SerialName
|
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
|
|
||||||
class AboutModel(
|
class AboutModel(
|
||||||
private val http: HttpService,
|
private val http: HttpService,
|
||||||
) : StateScreenModel<AboutScreenState>(AboutScreenState.Loading) {
|
) : StateScreenModel<AboutScreenState>(AboutScreenState.Loading) {
|
||||||
init {
|
init {
|
||||||
fetchContributors()
|
fetchDevelopers()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun fetchContributors() = screenModelScope.launchIO {
|
fun fetchDevelopers() = screenModelScope.launchIO {
|
||||||
mutableState.value = AboutScreenState.Loading
|
mutableState.value = AboutScreenState.Loading
|
||||||
|
|
||||||
// Use a curated static list of GitHub usernames (profiles + static avatar URLs).
|
val allDevelopers = persistentListOf(
|
||||||
// This avoids pulling from a specific repo and lets us include people
|
Developer(
|
||||||
// who are not contributors to any particular repository.
|
username = "OTKUSteyler",
|
||||||
val staticContributors = persistentListOf(
|
avatarUrl = "https://github.com/OTKUSteyler.png",
|
||||||
Contributor(
|
|
||||||
username = "rushiiMachine",
|
|
||||||
avatarUrl = "https://github.com/rushiiMachine.png",
|
|
||||||
commits = 0,
|
commits = 0,
|
||||||
repositories = persistentListOf<com.aliucord.manager.network.models.Contributor.Repository>()
|
repositories = emptyList(),
|
||||||
|
role = "GoonCord - Creator"
|
||||||
),
|
),
|
||||||
Contributor(
|
Developer(
|
||||||
username = "maisymoe",
|
|
||||||
avatarUrl = "https://github.com/maisymoe.png",
|
|
||||||
commits = 0,
|
|
||||||
repositories = persistentListOf<com.aliucord.manager.network.models.Contributor.Repository>()
|
|
||||||
),
|
|
||||||
Contributor(
|
|
||||||
username = "kmmiio99o",
|
username = "kmmiio99o",
|
||||||
avatarUrl = "https://github.com/kmmiio99o.png",
|
avatarUrl = "https://github.com/kmmiio99o.png",
|
||||||
commits = 0,
|
commits = 0,
|
||||||
repositories = persistentListOf<com.aliucord.manager.network.models.Contributor.Repository>()
|
repositories = emptyList(),
|
||||||
|
role = "ShiggyCord - Creator"
|
||||||
),
|
),
|
||||||
Contributor(
|
Developer(
|
||||||
|
username = "rushiiMachine",
|
||||||
|
avatarUrl = "https://github.com/rushiiMachine.png",
|
||||||
|
commits = 0,
|
||||||
|
repositories = emptyList(),
|
||||||
|
role = "Manager - Creator"
|
||||||
|
),
|
||||||
|
Developer(
|
||||||
|
username = "maisymoe",
|
||||||
|
avatarUrl = "https://github.com/maisymoe.png",
|
||||||
|
commits = 0,
|
||||||
|
repositories = emptyList(),
|
||||||
|
role = "Vendetta - Creator"
|
||||||
|
),
|
||||||
|
Developer(
|
||||||
username = "pylixonly",
|
username = "pylixonly",
|
||||||
avatarUrl = "https://github.com/pylixonly.png",
|
avatarUrl = "https://github.com/pylixonly.png",
|
||||||
commits = 0,
|
commits = 0,
|
||||||
repositories = persistentListOf<com.aliucord.manager.network.models.Contributor.Repository>()
|
repositories = emptyList(),
|
||||||
)
|
role = "Bunny - Creator"
|
||||||
|
),
|
||||||
|
Developer(
|
||||||
|
username = "jonatanktk",
|
||||||
|
avatarUrl = "https://github.com/jonatanktk.png",
|
||||||
|
commits = 0,
|
||||||
|
repositories = emptyList(),
|
||||||
|
role = "Random Person there"
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
mutableState.value = AboutScreenState.Loaded(staticContributors.toUnsafeImmutable())
|
mutableState.value = AboutScreenState.Loaded(allDevelopers.toUnsafeImmutable())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
|
import androidx.compose.foundation.lazy.itemsIndexed
|
||||||
import androidx.compose.material3.*
|
import androidx.compose.material3.*
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
|
|
@ -20,15 +21,16 @@ import androidx.compose.ui.unit.dp
|
||||||
import cafe.adriel.voyager.core.screen.Screen
|
import cafe.adriel.voyager.core.screen.Screen
|
||||||
import cafe.adriel.voyager.koin.koinScreenModel
|
import cafe.adriel.voyager.koin.koinScreenModel
|
||||||
import com.aliucord.manager.ui.components.*
|
import com.aliucord.manager.ui.components.*
|
||||||
import com.aliucord.manager.ui.screens.about.components.LeadContributor
|
import com.aliucord.manager.ui.screens.about.components.RegularContributorListItem
|
||||||
import com.aliucord.manager.ui.util.paddings.*
|
import com.aliucord.manager.ui.util.paddings.*
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.parcelize.IgnoredOnParcel
|
import kotlinx.parcelize.IgnoredOnParcel
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
|
|
||||||
@Parcelize
|
@Parcelize
|
||||||
class AboutScreen : Screen, Parcelable {
|
class AboutScreen : Screen, Parcelable {
|
||||||
@IgnoredOnParcel override val key = "About"
|
@IgnoredOnParcel
|
||||||
|
override val key = "About"
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun Content() {
|
override fun Content() {
|
||||||
|
|
@ -41,107 +43,92 @@ class AboutScreen : Screen, Parcelable {
|
||||||
@Composable
|
@Composable
|
||||||
fun AboutScreenContent(state: State<AboutScreenState>) {
|
fun AboutScreenContent(state: State<AboutScreenState>) {
|
||||||
Scaffold(
|
Scaffold(
|
||||||
topBar = {
|
topBar = {
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
title = { Text(stringResource(R.string.navigation_about_manager)) },
|
title = { Text(stringResource(R.string.navigation_about_manager)) },
|
||||||
navigationIcon = { BackButton() },
|
navigationIcon = { BackButton() },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
) { paddingValues ->
|
) { paddingValues ->
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
verticalArrangement = Arrangement.spacedBy(2.dp),
|
verticalArrangement = Arrangement.spacedBy(2.dp),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
contentPadding =
|
contentPadding = paddingValues
|
||||||
paddingValues
|
.exclude(PaddingValuesSides.Horizontal + PaddingValuesSides.Top)
|
||||||
.exclude(PaddingValuesSides.Horizontal + PaddingValuesSides.Top)
|
.add(PaddingValues(vertical = 16.dp)),
|
||||||
.add(PaddingValues(vertical = 16.dp)),
|
modifier = Modifier
|
||||||
modifier =
|
.padding(paddingValues.exclude(PaddingValuesSides.Bottom))
|
||||||
Modifier.padding(paddingValues.exclude(PaddingValuesSides.Bottom))
|
|
||||||
.padding(horizontal = 14.dp),
|
|
||||||
) {
|
) {
|
||||||
item(key = "MANAGER_CREDIT_DISCLAIMER_BANNER") {
|
item(key = "MANAGER_CREDIT_DISCLAIMER_BANNER") {
|
||||||
Box(
|
Box(
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
modifier =
|
modifier = Modifier
|
||||||
Modifier.padding(bottom = 24.dp)
|
.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||||
.border(
|
.fillMaxWidth()
|
||||||
width = 2.dp,
|
.border(
|
||||||
color = MaterialTheme.colorScheme.surfaceVariant,
|
width = 1.dp,
|
||||||
shape = MaterialTheme.shapes.medium
|
color = MaterialTheme.colorScheme.outline.copy(alpha = 0.3f),
|
||||||
)
|
shape = MaterialTheme.shapes.large
|
||||||
.clip(MaterialTheme.shapes.medium)
|
|
||||||
.background(MaterialTheme.colorScheme.surfaceContainerHigh)
|
|
||||||
) {
|
|
||||||
Row(
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(12.dp),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
modifier = Modifier.padding(horizontal = 20.dp, vertical = 14.dp)
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text =
|
|
||||||
stringResource(
|
|
||||||
R.string.about_manager_credit_disclaimer_notice
|
|
||||||
),
|
|
||||||
style = MaterialTheme.typography.labelMedium,
|
|
||||||
)
|
)
|
||||||
|
.clip(MaterialTheme.shapes.large)
|
||||||
|
.background(MaterialTheme.colorScheme.surfaceContainerLow)
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.about_manager_credit_disclaimer_notice),
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
modifier = Modifier.padding(horizontal = 20.dp, vertical = 16.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
item(key = "PROJECT_HEADER") {
|
||||||
|
Box(modifier = Modifier.padding(horizontal = 16.dp)) {
|
||||||
|
ProjectHeader()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
item(key = "TEAM_SPACER") {
|
||||||
|
Spacer(modifier = Modifier.height(32.dp))
|
||||||
|
}
|
||||||
|
|
||||||
|
when (val currentState = state.value) {
|
||||||
|
AboutScreenState.Loading -> {
|
||||||
|
item(key = "LOADING") {
|
||||||
|
Box(
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(vertical = 48.dp)
|
||||||
|
) {
|
||||||
|
CircularProgressIndicator()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
item(key = "PROJECT_HEADER") { ProjectHeader() }
|
AboutScreenState.Failure -> {
|
||||||
|
item(key = "LOAD_FAILURE") {
|
||||||
item(key = "HEADER_DIVIDER") {
|
Box(
|
||||||
TextDivider(
|
contentAlignment = Alignment.Center,
|
||||||
text = stringResource(R.string.contributors_lead),
|
modifier = Modifier
|
||||||
modifier = Modifier.padding(top = 18.dp, bottom = 20.dp),
|
.fillMaxWidth()
|
||||||
)
|
.padding(vertical = 48.dp)
|
||||||
}
|
|
||||||
|
|
||||||
item(key = "MAIN_CONTRIBUTORS") {
|
|
||||||
Row(
|
|
||||||
horizontalArrangement = Arrangement.SpaceEvenly,
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
modifier = Modifier.fillMaxWidth(),
|
|
||||||
) {
|
|
||||||
LeadContributor("C0C0B01", stringResource(R.string.lead_role_kettu))
|
|
||||||
LeadContributor("kmmiio99o", stringResource(R.string.lead_role_shiggycord))
|
|
||||||
LeadContributor("pylixonly", stringResource(R.string.lead_role_bunny))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
item(key = "CONTRIBUTORS_DIVIDER") {
|
|
||||||
TextDivider(
|
|
||||||
text = stringResource(R.string.contributors),
|
|
||||||
modifier = Modifier.padding(top = 16.dp, bottom = 6.dp)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
when (val state = state.value) {
|
|
||||||
AboutScreenState.Loading ->
|
|
||||||
item(key = "CONTRIBUTIONS_LOADING") {
|
|
||||||
Box(
|
|
||||||
contentAlignment = Alignment.Center,
|
|
||||||
content = { CircularProgressIndicator() },
|
|
||||||
modifier = Modifier.fillMaxWidth().padding(vertical = 38.dp),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
AboutScreenState.Failure ->
|
|
||||||
item(key = "LOAD_FAILURE") {
|
|
||||||
LoadFailure(modifier = Modifier.fillMaxSize().padding(vertical = 38.dp))
|
|
||||||
}
|
|
||||||
is AboutScreenState.Loaded -> {
|
|
||||||
// Render the two requested contributors as LeadContributor entries
|
|
||||||
item(key = "SELECTED_CONTRIBUTORS") {
|
|
||||||
Row(
|
|
||||||
horizontalArrangement = Arrangement.SpaceEvenly,
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
modifier = Modifier.fillMaxWidth(),
|
|
||||||
) {
|
) {
|
||||||
LeadContributor("maisymoe", "Creator - Vendetta")
|
LoadFailure()
|
||||||
LeadContributor("rushiiMachine", "Manager - Creator")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is AboutScreenState.Loaded -> {
|
||||||
|
itemsIndexed(
|
||||||
|
items = currentState.contributors,
|
||||||
|
key = { index, developer -> developer.username }
|
||||||
|
) { index, developer ->
|
||||||
|
RegularContributorListItem(
|
||||||
|
contributor = developer,
|
||||||
|
isLast = index == currentState.contributors.lastIndex
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package com.aliucord.manager.ui.screens.about
|
package com.aliucord.manager.ui.screens.about
|
||||||
|
|
||||||
import com.aliucord.manager.network.models.Contributor
|
import com.aliucord.manager.network.models.Developer
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
|
|
||||||
sealed interface AboutScreenState {
|
sealed interface AboutScreenState {
|
||||||
data object Loading : AboutScreenState
|
data object Loading : AboutScreenState
|
||||||
data object Failure : AboutScreenState
|
data object Failure : AboutScreenState
|
||||||
data class Loaded(val contributors: ImmutableList<Contributor>) : AboutScreenState
|
data class Loaded(val contributors: ImmutableList<Developer>) : AboutScreenState
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
package com.aliucord.manager.ui.screens.about.components
|
||||||
|
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
|
import androidx.compose.material3.*
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.layout.ContentScale
|
||||||
|
import androidx.compose.ui.platform.LocalUriHandler
|
||||||
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import coil3.compose.SubcomposeAsyncImage
|
||||||
|
import com.aliucord.manager.network.models.Developer
|
||||||
|
import com.valentinilk.shimmer.shimmer
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun RegularContributorListItem(
|
||||||
|
contributor: Developer,
|
||||||
|
isLast: Boolean = false,
|
||||||
|
modifier: Modifier = Modifier
|
||||||
|
) {
|
||||||
|
val uriHandler = LocalUriHandler.current
|
||||||
|
|
||||||
|
Column(modifier = modifier.fillMaxWidth()) {
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clickable(
|
||||||
|
onClick = { uriHandler.openUri("https://github.com/${contributor.username}") }
|
||||||
|
)
|
||||||
|
.padding(horizontal = 24.dp, vertical = 16.dp)
|
||||||
|
) {
|
||||||
|
SubcomposeAsyncImage(
|
||||||
|
model = contributor.avatarUrl,
|
||||||
|
contentDescription = contributor.username,
|
||||||
|
contentScale = ContentScale.Crop,
|
||||||
|
loading = {
|
||||||
|
Surface(
|
||||||
|
color = MaterialTheme.colorScheme.surfaceVariant,
|
||||||
|
modifier = Modifier
|
||||||
|
.size(56.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.shimmer()
|
||||||
|
) {}
|
||||||
|
},
|
||||||
|
error = {
|
||||||
|
Surface(
|
||||||
|
color = MaterialTheme.colorScheme.surfaceVariant,
|
||||||
|
modifier = Modifier
|
||||||
|
.size(56.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
) {}
|
||||||
|
},
|
||||||
|
modifier = Modifier
|
||||||
|
.size(56.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
)
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.width(20.dp))
|
||||||
|
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.weight(1f)
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = contributor.username,
|
||||||
|
style = MaterialTheme.typography.titleMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis
|
||||||
|
)
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
|
|
||||||
|
contributor.role?.let { role ->
|
||||||
|
Text(
|
||||||
|
text = role,
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isLast) {
|
||||||
|
HorizontalDivider(
|
||||||
|
color = MaterialTheme.colorScheme.outline.copy(alpha = 0.1f),
|
||||||
|
thickness = 1.dp,
|
||||||
|
modifier = Modifier.padding(start = 100.dp, end = 24.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,94 +1,96 @@
|
||||||
package com.aliucord.manager.ui.screens.about.components
|
package com.aliucord.manager.ui.screens.about.components
|
||||||
|
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.material3.*
|
import androidx.compose.material3.*
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.remember
|
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.platform.LocalUriHandler
|
import androidx.compose.ui.platform.LocalUriHandler
|
||||||
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
|
||||||
import coil3.compose.SubcomposeAsyncImage
|
import coil3.compose.SubcomposeAsyncImage
|
||||||
|
import com.aliucord.manager.network.models.Developer
|
||||||
import com.valentinilk.shimmer.shimmer
|
import com.valentinilk.shimmer.shimmer
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LeadContributor(
|
fun LeadContributorItem(
|
||||||
name: String,
|
contributor: Developer,
|
||||||
roles: String,
|
isLast: Boolean = false,
|
||||||
username: String = name,
|
modifier: Modifier = Modifier
|
||||||
modifier: Modifier = Modifier,
|
|
||||||
) {
|
) {
|
||||||
val uriHandler = LocalUriHandler.current
|
val uriHandler = LocalUriHandler.current
|
||||||
|
|
||||||
Column(
|
Column(modifier = modifier.fillMaxWidth()) {
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
Row(
|
||||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier =
|
modifier = Modifier
|
||||||
modifier.clickable(
|
.fillMaxWidth()
|
||||||
onClick = {
|
.clickable(
|
||||||
uriHandler.openUri("https://github.com/$username")
|
onClick = { uriHandler.openUri("https://github.com/${contributor.username}") }
|
||||||
},
|
)
|
||||||
indication = ripple(bounded = false, radius = 90.dp),
|
.padding(horizontal = 24.dp, vertical = 16.dp)
|
||||||
interactionSource = remember(::MutableInteractionSource)
|
) {
|
||||||
)
|
SubcomposeAsyncImage(
|
||||||
.widthIn(min = 100.dp)
|
model = contributor.avatarUrl,
|
||||||
) {
|
contentDescription = contributor.username,
|
||||||
SubcomposeAsyncImage(
|
contentScale = ContentScale.Crop,
|
||||||
model = "https://github.com/$username.png",
|
loading = {
|
||||||
contentDescription = username,
|
Surface(
|
||||||
|
color = MaterialTheme.colorScheme.surfaceVariant,
|
||||||
|
modifier = Modifier
|
||||||
|
.size(56.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.shimmer()
|
||||||
|
) {}
|
||||||
|
},
|
||||||
error = {
|
error = {
|
||||||
Surface(
|
Surface(
|
||||||
content = {},
|
color = MaterialTheme.colorScheme.surfaceVariant,
|
||||||
tonalElevation = 2.dp,
|
modifier = Modifier
|
||||||
modifier = Modifier.fillMaxSize().shimmer(),
|
.size(56.dp)
|
||||||
)
|
.clip(CircleShape)
|
||||||
|
) {}
|
||||||
},
|
},
|
||||||
modifier = Modifier.size(80.dp).clip(CircleShape),
|
modifier = Modifier
|
||||||
)
|
.size(56.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
)
|
||||||
|
|
||||||
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
Spacer(modifier = Modifier.width(20.dp))
|
||||||
Text(text = name, style = MaterialTheme.typography.titleMedium.copy(fontSize = 18.sp))
|
|
||||||
|
|
||||||
val roleParts = roles.split(Regex("\\s*-\\s*"), limit = 2)
|
Column(
|
||||||
if (roleParts.size == 2) {
|
modifier = Modifier.weight(1f)
|
||||||
// Render left and right parts on two separate lines, removing the dash
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = roleParts[0],
|
text = contributor.username,
|
||||||
style =
|
style = MaterialTheme.typography.titleMedium,
|
||||||
MaterialTheme.typography.titleSmall.copy(
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
color =
|
maxLines = 1,
|
||||||
MaterialTheme.colorScheme.onSurface.copy(
|
overflow = TextOverflow.Ellipsis
|
||||||
alpha = 0.6f
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
text = roleParts[1],
|
|
||||||
style =
|
|
||||||
MaterialTheme.typography.bodySmall.copy(
|
|
||||||
color =
|
|
||||||
MaterialTheme.colorScheme.onSurface.copy(
|
|
||||||
alpha = 0.6f
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
Text(
|
|
||||||
text = roles,
|
|
||||||
style =
|
|
||||||
MaterialTheme.typography.titleSmall.copy(
|
|
||||||
color =
|
|
||||||
MaterialTheme.colorScheme.onSurface.copy(
|
|
||||||
alpha = 0.6f
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
|
|
||||||
|
contributor.role?.let { role ->
|
||||||
|
Text(
|
||||||
|
text = role,
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isLast) {
|
||||||
|
HorizontalDivider(
|
||||||
|
color = MaterialTheme.colorScheme.outline.copy(alpha = 0.1f),
|
||||||
|
thickness = 1.dp,
|
||||||
|
modifier = Modifier.padding(start = 100.dp, end = 24.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ import com.aliucord.manager.ui.util.DiscordVersion
|
||||||
import com.aliucord.manager.ui.util.toUnsafeImmutable
|
import com.aliucord.manager.ui.util.toUnsafeImmutable
|
||||||
import com.aliucord.manager.util.*
|
import com.aliucord.manager.util.*
|
||||||
import com.github.diamondminer88.zip.ZipReader
|
import com.github.diamondminer88.zip.ZipReader
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import kotlinx.coroutines.sync.Mutex
|
import kotlinx.coroutines.sync.Mutex
|
||||||
import kotlinx.coroutines.sync.withLock
|
import kotlinx.coroutines.sync.withLock
|
||||||
|
|
@ -51,7 +51,7 @@ class HomeModel(
|
||||||
private val refreshingLock = Mutex()
|
private val refreshingLock = Mutex()
|
||||||
private var remoteDataJson: BuildInfo? = null
|
private var remoteDataJson: BuildInfo? = null
|
||||||
private var trackerIndexJson: RNATrackerIndex? = null
|
private var trackerIndexJson: RNATrackerIndex? = null
|
||||||
private var latestShiggyXposedVersion: SemVer? = null
|
private var latestGoonXposedVersion: SemVer? = null
|
||||||
private var latestAliuhookVersion: SemVer? = null
|
private var latestAliuhookVersion: SemVer? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
@ -122,7 +122,7 @@ class HomeModel(
|
||||||
val metadata = try {
|
val metadata = try {
|
||||||
val applicationInfo = application.packageManager.getApplicationInfo(packageName, 0)
|
val applicationInfo = application.packageManager.getApplicationInfo(packageName, 0)
|
||||||
val metadataFile = ZipReader(applicationInfo.publicSourceDir)
|
val metadataFile = ZipReader(applicationInfo.publicSourceDir)
|
||||||
.use { it.openEntry("shiggy.json")?.read() }
|
.use { it.openEntry("goon.json")?.read() }
|
||||||
|
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
@OptIn(ExperimentalSerializationApi::class)
|
||||||
metadataFile?.let { json.decodeFromStream<InstallMetadata>(it.inputStream()) }
|
metadataFile?.let { json.decodeFromStream<InstallMetadata>(it.inputStream()) }
|
||||||
|
|
@ -146,27 +146,60 @@ class HomeModel(
|
||||||
try {
|
try {
|
||||||
val packageManager = application.packageManager
|
val packageManager = application.packageManager
|
||||||
val aliucordInstallations = packages.mapNotNull { pkg ->
|
val aliucordInstallations = packages.mapNotNull { pkg ->
|
||||||
// `longVersionCode` is unnecessary since Discord doesn't use `versionCodeMajor`
|
try {
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
val versionCode = pkg.versionCode
|
val versionCode = pkg.versionCode
|
||||||
val versionName = pkg.versionName ?: return@mapNotNull null
|
val versionName = pkg.versionName ?: return@mapNotNull null
|
||||||
val applicationInfo = pkg.applicationInfo ?: return@mapNotNull null
|
val applicationInfo = pkg.applicationInfo ?: return@mapNotNull null
|
||||||
|
|
||||||
InstallData(
|
val name = try {
|
||||||
name = packageManager.getApplicationLabel(applicationInfo).toString(),
|
packageManager.getApplicationLabel(applicationInfo).toString()
|
||||||
packageName = pkg.packageName,
|
} catch (e: Exception) {
|
||||||
isUpToDate = isInstallationUpToDate(pkg),
|
Log.w(BuildConfig.TAG, "Failed to get label for ${pkg.packageName}", e)
|
||||||
icon = packageManager
|
null
|
||||||
.getApplicationIcon(applicationInfo)
|
} ?: return@mapNotNull null
|
||||||
.toBitmap()
|
|
||||||
.asImageBitmap()
|
val icon = try {
|
||||||
.let(::BitmapPainter),
|
packageManager.getApplicationIcon(applicationInfo)
|
||||||
version = DiscordVersion.Existing(
|
.toBitmap()
|
||||||
type = DiscordVersion.parseVersionType(versionCode),
|
.asImageBitmap()
|
||||||
name = versionName.split("-")[0].trim(),
|
.let(::BitmapPainter)
|
||||||
code = versionCode,
|
} catch (e: Exception) {
|
||||||
),
|
Log.w(BuildConfig.TAG, "Failed to get icon for ${pkg.packageName}", e)
|
||||||
)
|
null
|
||||||
|
} ?: return@mapNotNull null
|
||||||
|
|
||||||
|
// Defensive: check for any other possible nulls or bad data
|
||||||
|
if (pkg.packageName.isNullOrEmpty()) {
|
||||||
|
Log.w(BuildConfig.TAG, "Package name is null or empty for a package")
|
||||||
|
return@mapNotNull null
|
||||||
|
}
|
||||||
|
|
||||||
|
InstallData(
|
||||||
|
name = name,
|
||||||
|
packageName = pkg.packageName,
|
||||||
|
isUpToDate = try {
|
||||||
|
isInstallationUpToDate(pkg)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(BuildConfig.TAG, "Failed to check up-to-date for ${pkg.packageName}", e)
|
||||||
|
false
|
||||||
|
},
|
||||||
|
icon = icon,
|
||||||
|
version = try {
|
||||||
|
DiscordVersion.Existing(
|
||||||
|
type = DiscordVersion.parseVersionType(versionCode),
|
||||||
|
name = versionName.split("-")[0].trim(),
|
||||||
|
code = versionCode,
|
||||||
|
)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(BuildConfig.TAG, "Failed to parse version for ${pkg.packageName}", e)
|
||||||
|
null
|
||||||
|
} ?: return@mapNotNull null,
|
||||||
|
)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.w(BuildConfig.TAG, "Failed to process package ${pkg.packageName}", e)
|
||||||
|
null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mainThread {
|
mainThread {
|
||||||
|
|
@ -203,7 +236,7 @@ class HomeModel(
|
||||||
|
|
||||||
private suspend fun fetchRemoteData() {
|
private suspend fun fetchRemoteData() {
|
||||||
listOf(
|
listOf(
|
||||||
// // These aren't needed by Shiggy
|
// // These aren't needed by Goon
|
||||||
// screenModelScope.launch(Dispatchers.IO) {
|
// screenModelScope.launch(Dispatchers.IO) {
|
||||||
// github.getBuildData().fold(
|
// github.getBuildData().fold(
|
||||||
// success = { remoteDataJson = it },
|
// success = { remoteDataJson = it },
|
||||||
|
|
@ -224,14 +257,18 @@ class HomeModel(
|
||||||
},
|
},
|
||||||
screenModelScope.launch(Dispatchers.IO) {
|
screenModelScope.launch(Dispatchers.IO) {
|
||||||
wtGithub.getLatestXposedRelease().fold(
|
wtGithub.getLatestXposedRelease().fold(
|
||||||
success = { latestShiggyXposedVersion = SemVer.parse(it.name) },
|
success = {
|
||||||
fail = { Log.w(BuildConfig.TAG, "Failed to fetch latest ShiggyXposed version", it) },
|
val versionName = it.name
|
||||||
|
val truncatedVersion = versionName.split(".").take(3).joinToString(".")
|
||||||
|
latestGoonXposedVersion = SemVer.parse(truncatedVersion)
|
||||||
|
},
|
||||||
|
fail = { Log.w(BuildConfig.TAG, "Failed to fetch latest GoonXposed version", it) },
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
||||||
).joinAll()
|
).joinAll()
|
||||||
|
|
||||||
if (trackerIndexJson == null /* remoteDataJson == null || latestAliuhookVersion == null */ || latestShiggyXposedVersion == null) {
|
if (trackerIndexJson == null /* remoteDataJson == null || latestAliuhookVersion == null */ || latestGoonXposedVersion == null) {
|
||||||
mainThread { application.showToast(R.string.home_network_fail) }
|
mainThread { application.showToast(R.string.home_network_fail) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -270,7 +307,7 @@ class HomeModel(
|
||||||
return application.packageManager
|
return application.packageManager
|
||||||
.getInstalledPackages(PackageManager.GET_META_DATA)
|
.getInstalledPackages(PackageManager.GET_META_DATA)
|
||||||
.filter {
|
.filter {
|
||||||
// Shiggy doesn't have "legacy installer" whatsoever
|
// Goon doesn't have "legacy installer" whatsoever
|
||||||
return@filter it.applicationInfo?.metaData?.containsKey("isShiggy") == true
|
return@filter it.applicationInfo?.metaData?.containsKey("isShiggy") == true
|
||||||
|
|
||||||
// // Packages installed via the legacy Installer do not have the metadata marker
|
// // Packages installed via the legacy Installer do not have the metadata marker
|
||||||
|
|
@ -281,11 +318,11 @@ class HomeModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the current Shiggy installation is up-to-date.
|
* Checks whether the current Goon installation is up-to-date.
|
||||||
*
|
*
|
||||||
* Currently mirrors the behavior of Bunny Manager by directly comparing against
|
* Currently mirrors the behavior of Bunny Manager by directly comparing against
|
||||||
* the latest available Discord and ShiggyXposed release. This is a temporary approach and will remain
|
* the latest available Discord and GoonXposed release. This is a temporary approach and will remain
|
||||||
* in place until Shiggy adds support for version pinning.
|
* in place until Goon adds support for version pinning.
|
||||||
*/
|
*/
|
||||||
private fun isInstallationUpToDate(pkg: PackageInfo): Boolean? {
|
private fun isInstallationUpToDate(pkg: PackageInfo): Boolean? {
|
||||||
val trackerData = trackerIndexJson ?: return null
|
val trackerData = trackerIndexJson ?: return null
|
||||||
|
|
@ -297,7 +334,7 @@ class HomeModel(
|
||||||
// Try to parse install metadata. If none present, install was made via legacy installer.
|
// Try to parse install metadata. If none present, install was made via legacy installer.
|
||||||
val apkPath = pkg.applicationInfo?.publicSourceDir ?: return false
|
val apkPath = pkg.applicationInfo?.publicSourceDir ?: return false
|
||||||
val installMetadata = try {
|
val installMetadata = try {
|
||||||
val metadataFile = ZipReader(apkPath).use { it.openEntry("shiggy.json")?.read() }
|
val metadataFile = ZipReader(apkPath).use { it.openEntry("goon.json")?.read() }
|
||||||
?: return false
|
?: return false
|
||||||
|
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
@OptIn(ExperimentalSerializationApi::class)
|
||||||
|
|
@ -314,6 +351,6 @@ class HomeModel(
|
||||||
VersionPreference.Custom -> return true
|
VersionPreference.Custom -> return true
|
||||||
}
|
}
|
||||||
|
|
||||||
return latestByPref == versionCode && installMetadata.shiggyXposedVersion == latestShiggyXposedVersion
|
return latestByPref == versionCode && installMetadata.goonXposedVersion == latestGoonXposedVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,11 +30,10 @@ import com.aliucord.manager.ui.components.LoadFailure
|
||||||
import com.aliucord.manager.ui.components.ProjectHeader
|
import com.aliucord.manager.ui.components.ProjectHeader
|
||||||
import com.aliucord.manager.ui.screens.home.components.*
|
import com.aliucord.manager.ui.screens.home.components.*
|
||||||
import com.aliucord.manager.ui.screens.patchopts.PatchOptionsScreen
|
import com.aliucord.manager.ui.screens.patchopts.PatchOptionsScreen
|
||||||
import com.aliucord.manager.ui.screens.plugins.PluginsScreen
|
|
||||||
import com.aliucord.manager.ui.util.paddings.PaddingValuesSides
|
import com.aliucord.manager.ui.util.paddings.PaddingValuesSides
|
||||||
import com.aliucord.manager.ui.util.paddings.exclude
|
import com.aliucord.manager.ui.util.paddings.exclude
|
||||||
import com.aliucord.manager.util.*
|
import com.aliucord.manager.util.*
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.parcelize.IgnoredOnParcel
|
import kotlinx.parcelize.IgnoredOnParcel
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
|
|
||||||
|
|
@ -78,7 +77,6 @@ class HomeScreen : Screen, Parcelable {
|
||||||
},
|
},
|
||||||
onOpenApp = model::openApp,
|
onOpenApp = model::openApp,
|
||||||
onOpenAppInfo = model::openAppInfo,
|
onOpenAppInfo = model::openAppInfo,
|
||||||
onOpenPlugins = { navigator.push(PluginsScreen()) }, // TODO: install-specific plugins
|
|
||||||
onUninstall = model::uninstallApp,
|
onUninstall = model::uninstallApp,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -129,7 +127,6 @@ fun HomeScreenLoadedContent(
|
||||||
onUpdate: (packageName: String) -> Unit,
|
onUpdate: (packageName: String) -> Unit,
|
||||||
onOpenApp: (packageName: String) -> Unit,
|
onOpenApp: (packageName: String) -> Unit,
|
||||||
onOpenAppInfo: (packageName: String) -> Unit,
|
onOpenAppInfo: (packageName: String) -> Unit,
|
||||||
onOpenPlugins: (packageName: String) -> Unit,
|
|
||||||
onUninstall: (packageName: String) -> Unit,
|
onUninstall: (packageName: String) -> Unit,
|
||||||
) {
|
) {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
|
|
@ -163,7 +160,6 @@ fun HomeScreenLoadedContent(
|
||||||
onUpdate = { onUpdate(item.packageName) },
|
onUpdate = { onUpdate(item.packageName) },
|
||||||
onOpenApp = { onOpenApp(item.packageName) },
|
onOpenApp = { onOpenApp(item.packageName) },
|
||||||
onOpenInfo = { onOpenAppInfo(item.packageName) },
|
onOpenInfo = { onOpenAppInfo(item.packageName) },
|
||||||
onOpenPlugins = { onOpenPlugins(item.packageName) },
|
|
||||||
onUninstall = { onUninstall(item.packageName) },
|
onUninstall = { onUninstall(item.packageName) },
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import cafe.adriel.voyager.navigator.LocalNavigator
|
||||||
import com.aliucord.manager.ui.screens.about.AboutScreen
|
import com.aliucord.manager.ui.screens.about.AboutScreen
|
||||||
import com.aliucord.manager.ui.screens.logs.LogsListScreen
|
import com.aliucord.manager.ui.screens.logs.LogsListScreen
|
||||||
import com.aliucord.manager.ui.screens.settings.SettingsScreen
|
import com.aliucord.manager.ui.screens.settings.SettingsScreen
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun HomeAppBar() {
|
fun HomeAppBar() {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.aliucord.manager.ui.util.thenIf
|
import com.aliucord.manager.ui.util.thenIf
|
||||||
import com.valentinilk.shimmer.*
|
import com.valentinilk.shimmer.*
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
private val shimmerTheme = defaultShimmerTheme.copy(
|
private val shimmerTheme = defaultShimmerTheme.copy(
|
||||||
shimmerWidth = 150.dp,
|
shimmerWidth = 150.dp,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import androidx.compose.ui.unit.dp
|
||||||
import com.aliucord.manager.ui.components.SegmentedButton
|
import com.aliucord.manager.ui.components.SegmentedButton
|
||||||
import com.aliucord.manager.ui.components.VersionDisplay
|
import com.aliucord.manager.ui.components.VersionDisplay
|
||||||
import com.aliucord.manager.ui.screens.home.InstallData
|
import com.aliucord.manager.ui.screens.home.InstallData
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun InstalledItemCard(
|
fun InstalledItemCard(
|
||||||
|
|
@ -26,7 +26,6 @@ fun InstalledItemCard(
|
||||||
onUpdate: () -> Unit,
|
onUpdate: () -> Unit,
|
||||||
onOpenApp: () -> Unit,
|
onOpenApp: () -> Unit,
|
||||||
onOpenInfo: () -> Unit,
|
onOpenInfo: () -> Unit,
|
||||||
onOpenPlugins: () -> Unit,
|
|
||||||
onUninstall: () -> Unit,
|
onUninstall: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
|
|
@ -89,13 +88,6 @@ fun InstalledItemCard(
|
||||||
horizontalArrangement = Arrangement.spacedBy(2.dp),
|
horizontalArrangement = Arrangement.spacedBy(2.dp),
|
||||||
modifier = Modifier.clip(MaterialTheme.shapes.large),
|
modifier = Modifier.clip(MaterialTheme.shapes.large),
|
||||||
) {
|
) {
|
||||||
// // Plugins cannot be managed externally yet in Shiggy
|
|
||||||
// SegmentedButton(
|
|
||||||
// icon = painterResource(R.drawable.ic_extension),
|
|
||||||
// text = stringResource(R.string.plugins_title),
|
|
||||||
// onClick = onOpenPlugins,
|
|
||||||
// )
|
|
||||||
|
|
||||||
// If the up-to-date status cannot be determined, assume it is up-to-date
|
// If the up-to-date status cannot be determined, assume it is up-to-date
|
||||||
if (data.isUpToDate != false)
|
if (data.isUpToDate != false)
|
||||||
SegmentedButton(
|
SegmentedButton(
|
||||||
|
|
@ -126,7 +118,7 @@ fun InstalledItemCard(
|
||||||
)
|
)
|
||||||
SegmentedButton(
|
SegmentedButton(
|
||||||
icon = painterResource(R.drawable.ic_delete_forever),
|
icon = painterResource(R.drawable.ic_delete_forever),
|
||||||
text = stringResource(R.string.action_uninstall), // Assuming R.string.action_uninstall exists or will be added
|
text = stringResource(R.string.action_uninstall),
|
||||||
iconColor = MaterialTheme.colorScheme.error,
|
iconColor = MaterialTheme.colorScheme.error,
|
||||||
textColor = MaterialTheme.colorScheme.error,
|
textColor = MaterialTheme.colorScheme.error,
|
||||||
onClick = onUninstall,
|
onClick = onUninstall,
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ import cafe.adriel.voyager.core.model.ScreenModel
|
||||||
import cafe.adriel.voyager.core.model.screenModelScope
|
import cafe.adriel.voyager.core.model.screenModelScope
|
||||||
import com.aliucord.manager.ui.screens.patchopts.PatchOptions.IconReplacement
|
import com.aliucord.manager.ui.screens.patchopts.PatchOptions.IconReplacement
|
||||||
import com.aliucord.manager.util.*
|
import com.aliucord.manager.util.*
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import dev.zt64.compose.pipette.HsvColor
|
import dev.zt64.compose.pipette.HsvColor
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ import com.aliucord.manager.ui.screens.patchopts.PatchOptionsScreen
|
||||||
import com.aliucord.manager.ui.util.ColorSaver
|
import com.aliucord.manager.ui.util.ColorSaver
|
||||||
import com.aliucord.manager.ui.util.throttledState
|
import com.aliucord.manager.ui.util.throttledState
|
||||||
import com.aliucord.manager.util.back
|
import com.aliucord.manager.util.back
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import dev.zt64.compose.pipette.CircularColorPicker
|
import dev.zt64.compose.pipette.CircularColorPicker
|
||||||
import dev.zt64.compose.pipette.HsvColor
|
import dev.zt64.compose.pipette.HsvColor
|
||||||
import kotlinx.parcelize.IgnoredOnParcel
|
import kotlinx.parcelize.IgnoredOnParcel
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import androidx.compose.ui.res.stringResource
|
||||||
import cafe.adriel.voyager.navigator.LocalNavigator
|
import cafe.adriel.voyager.navigator.LocalNavigator
|
||||||
import com.aliucord.manager.ui.components.BackButton
|
import com.aliucord.manager.ui.components.BackButton
|
||||||
import com.aliucord.manager.ui.screens.settings.SettingsScreen
|
import com.aliucord.manager.ui.screens.settings.SettingsScreen
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun IconOptionsAppBar() {
|
fun IconOptionsAppBar() {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.platform.LocalFocusManager
|
import androidx.compose.ui.platform.LocalFocusManager
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import com.aliucord.manager.ui.components.Label
|
||||||
import com.aliucord.manager.ui.screens.log.components.LogAppBar
|
import com.aliucord.manager.ui.screens.log.components.LogAppBar
|
||||||
import com.aliucord.manager.ui.screens.log.components.LogTextArea
|
import com.aliucord.manager.ui.screens.log.components.LogTextArea
|
||||||
import com.aliucord.manager.util.back
|
import com.aliucord.manager.util.back
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.parcelize.IgnoredOnParcel
|
import kotlinx.parcelize.IgnoredOnParcel
|
||||||
import kotlinx.parcelize.Parcelize
|
import kotlinx.parcelize.Parcelize
|
||||||
import org.koin.core.parameter.parametersOf
|
import org.koin.core.parameter.parametersOf
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ import cafe.adriel.voyager.core.model.screenModelScope
|
||||||
import com.aliucord.manager.manager.InstallLogData
|
import com.aliucord.manager.manager.InstallLogData
|
||||||
import com.aliucord.manager.manager.InstallLogManager
|
import com.aliucord.manager.manager.InstallLogManager
|
||||||
import com.aliucord.manager.util.*
|
import com.aliucord.manager.util.*
|
||||||
import dev.shiggy.manager.BuildConfig
|
import dev.goon.manager.BuildConfig
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
class LogScreenModel(
|
class LogScreenModel(
|
||||||
private val installId: String,
|
private val installId: String,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import com.aliucord.manager.ui.components.BackButton
|
import com.aliucord.manager.ui.components.BackButton
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LogAppBar(
|
fun LogAppBar(
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import cafe.adriel.voyager.core.model.ScreenModel
|
||||||
import cafe.adriel.voyager.core.model.screenModelScope
|
import cafe.adriel.voyager.core.model.screenModelScope
|
||||||
import com.aliucord.manager.manager.InstallLogManager
|
import com.aliucord.manager.manager.InstallLogManager
|
||||||
import com.aliucord.manager.util.*
|
import com.aliucord.manager.util.*
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
import kotlinx.collections.immutable.toImmutableList
|
import kotlinx.collections.immutable.toImmutableList
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import com.aliucord.manager.patcher.steps.base.StepState
|
||||||
import com.aliucord.manager.ui.screens.logs.LogEntry
|
import com.aliucord.manager.ui.screens.logs.LogEntry
|
||||||
import com.aliucord.manager.ui.screens.patching.components.StepStateIcon
|
import com.aliucord.manager.ui.screens.patching.components.StepStateIcon
|
||||||
import com.aliucord.manager.ui.screens.patching.components.TimeElapsed
|
import com.aliucord.manager.ui.screens.patching.components.TimeElapsed
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LogEntryCard(
|
fun LogEntryCard(
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import androidx.compose.ui.res.stringResource
|
||||||
import cafe.adriel.voyager.navigator.LocalNavigator
|
import cafe.adriel.voyager.navigator.LocalNavigator
|
||||||
import com.aliucord.manager.ui.components.BackButton
|
import com.aliucord.manager.ui.components.BackButton
|
||||||
import com.aliucord.manager.ui.screens.settings.SettingsScreen
|
import com.aliucord.manager.ui.screens.settings.SettingsScreen
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LogsListAppBar(
|
fun LogsListAppBar(
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import androidx.compose.ui.draw.alpha
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LogsNone(modifier: Modifier = Modifier) {
|
fun LogsNone(modifier: Modifier = Modifier) {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun DeleteLogsDialog(
|
fun DeleteLogsDialog(
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ import com.aliucord.manager.ui.util.spacedByLastAtBottom
|
||||||
import com.aliucord.manager.ui.util.thenIf
|
import com.aliucord.manager.ui.util.thenIf
|
||||||
import com.aliucord.manager.util.back
|
import com.aliucord.manager.util.back
|
||||||
import com.aliucord.manager.util.isIgnoringBatteryOptimizations
|
import com.aliucord.manager.util.isIgnoringBatteryOptimizations
|
||||||
import dev.shiggy.manager.R
|
import dev.goon.manager.R
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
import kotlinx.coroutines.flow.filter
|
import kotlinx.coroutines.flow.filter
|
||||||
import kotlinx.parcelize.IgnoredOnParcel
|
import kotlinx.parcelize.IgnoredOnParcel
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue