1
0
Fork 0

Merge pull request #75 from VendroidEnhanced/dev

This commit is contained in:
nin0dev 2024-08-28 16:11:11 -04:00 committed by GitHub
commit 136ec32116
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 408 additions and 138 deletions

View file

@ -9,10 +9,10 @@ android {
defaultConfig {
applicationId "com.nin0dev.vendroid"
minSdk 21
minSdk 25
targetSdk 34
versionCode 5
versionName "1.2"
versionCode 7
versionName "1.4"
}
buildTypes {
@ -37,6 +37,7 @@ dependencies {
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.activity:activity:1.9.1'
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'com.android.volley:volley:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}

View file

@ -0,0 +1,13 @@
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="recovery"
android:enabled="true"
android:icon="@drawable/reset"
android:shortcutShortLabel="@string/recovery_shortcut_name"
android:shortcutLongLabel="@string/recovery_shortcut_name">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="com.nin0dev.vendroid.debug"
android:targetClass="com.nin0dev.vendroid.RecoveryActivity" />
</shortcut>
</shortcuts>

View file

@ -14,6 +14,11 @@
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:targetApi="34">
<activity
android:name=".RecoveryActivity"
android:exported="true"
android:launchMode="singleTask"
android:theme="@style/AppTheme" />
<activity
android:name=".SettingsActivity"
android:exported="false" />
@ -27,6 +32,10 @@
android:exported="true"
android:launchMode="singleTask"
android:theme="@style/AppTheme">
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -50,4 +59,4 @@
</activity>
</application>
</manifest>
</manifest>

View file

@ -25,7 +25,7 @@ object HttpClient {
val res = activity.resources
res.openRawResource(R.raw.vencord_mobile).use { `is` -> VencordMobileRuntime = readAsText(`is`) }
if (VencordRuntime != null) return
if (sPrefs.getString("vencordLocation", Constants.JS_BUNDLE_URL) == Constants.JS_BUNDLE_URL || BuildConfig.DEBUG) { // user is debugging vencord or app, always redownload
if (sPrefs.getString("vencordLocation", Constants.JS_BUNDLE_URL) != Constants.JS_BUNDLE_URL || BuildConfig.DEBUG) { // user is debugging vencord or app, always redownload
Toast.makeText(activity, "Debugging app or Vencord, bundle will be redownloaded. Avoid using on limited networks", Toast.LENGTH_LONG).show()
vendroidFile.delete()
}

View file

@ -11,6 +11,7 @@ import android.os.Bundle
import android.os.StrictMode
import android.os.StrictMode.ThreadPolicy
import android.view.KeyEvent
import android.view.View.VISIBLE
import android.view.WindowManager
import android.webkit.ValueCallback
import android.webkit.WebView
@ -19,47 +20,60 @@ import com.android.volley.Request
import com.android.volley.toolbox.StringRequest
import com.android.volley.toolbox.Volley
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.gson.Gson
import com.nin0dev.vendroid.HttpClient.fetchVencord
import com.nin0dev.vendroid.Logger.e
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import pl.droidsonroids.gif.GifImageView
import java.io.IOException
@Serializable
data class UpdateData(val version: Int, val changelog: String)
class MainActivity : Activity() {
private var wvInitialized = false
private var wv: WebView? = null
@JvmField
var filePathCallback: ValueCallback<Array<Uri?>?>? = null
@OptIn(ExperimentalSerializationApi::class)
fun checkUpdates(ignoreSetting: Boolean = false)
{
val sPrefs = getSharedPreferences("settings", Context.MODE_PRIVATE)
if(sPrefs.getBoolean("checkVendroidUpdates", false) || ignoreSetting) {
val queue = Volley.newRequestQueue(this)
val url = "https://raw.githubusercontent.com/VendroidEnhanced/UpdateTracker/main/vendroid"
val url = "https://vendroid.nin0.dev/api/updates"
val stringRequest = StringRequest(
Request.Method.GET, url,
{ response ->
if(Integer.parseInt(response.trim()) != BuildConfig.VERSION_CODE)
{
val madb = MaterialAlertDialogBuilder(this)
madb.setTitle(getString(R.string.vendroid_update_available))
madb.setMessage("To make sure that no unexpected bugs happen, it is recommended to update.")
madb.setPositiveButton(getString(R.string.update), DialogInterface.OnClickListener { dialogInterface, i ->
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/VendroidEnhanced/Vendroid/releases/latest/download/app-release.apk"))
startActivity(browserIntent)
})
madb.setNegativeButton(getString(R.string.later), DialogInterface.OnClickListener { _, _ -> })
madb.show()
}
if(ignoreSetting && Integer.parseInt(response.trim()) == BuildConfig.VERSION_CODE) {
showDiscordToast("No updates available", "MESSAGE")
}
},
{ error ->
if (BuildConfig.DEBUG) {
e("Network error during update check", error)
}
Toast.makeText(this, "Failed to check for updates", Toast.LENGTH_SHORT).show()
Request.Method.GET, url,
{ response ->
val gson = Gson()
val updateData = gson.fromJson<UpdateData>(response, UpdateData::class.java)
if(updateData.version != BuildConfig.VERSION_CODE)
{
val madb = MaterialAlertDialogBuilder(this)
madb.setTitle(getString(R.string.vendroid_update_available))
madb.setMessage("Changelog:\n" + updateData.changelog)
madb.setPositiveButton(getString(R.string.update), DialogInterface.OnClickListener { dialogInterface, i ->
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/VendroidEnhanced/Vendroid/releases/latest/download/app-release.apk"))
startActivity(browserIntent)
})
madb.setNegativeButton(getString(R.string.later), DialogInterface.OnClickListener { _, _ -> })
madb.show()
}
if(ignoreSetting && updateData.version == BuildConfig.VERSION_CODE) {
showDiscordToast("No updates available", "MESSAGE")
}
},
{ error ->
if (BuildConfig.DEBUG) {
e("Network error during update check", error)
}
Toast.makeText(this, "Failed to check for updates", Toast.LENGTH_SHORT).show()
}
)
stringRequest.setShouldCache(false);
queue.add(stringRequest)
@ -75,9 +89,13 @@ class MainActivity : Activity() {
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
window.navigationBarColor = Color.TRANSPARENT
val sPrefs = getSharedPreferences("settings", Context.MODE_PRIVATE)
val editor = sPrefs.edit()
// https://developer.chrome.com/docs/devtools/remote-debugging/webviews/
WebView.setWebContentsDebuggingEnabled(BuildConfig.DEBUG)
setContentView(R.layout.activity_main)
if (sPrefs.getString("splash", "viggy") == "viggy") findViewById<GifImageView>(R.id.viggy_gif).visibility = VISIBLE
else if (sPrefs.getString("splash", "viggy") == "shiggy") findViewById<GifImageView>(R.id.shiggy_gif).visibility = VISIBLE
else if (sPrefs.getString("splash", "viggy") == "oneko") findViewById<GifImageView>(R.id.oneko_gif).visibility = VISIBLE
wv = findViewById(R.id.webview)!!
explodeAndroid()
wv!!.setWebViewClient(VWebviewClient())
@ -86,11 +104,18 @@ class MainActivity : Activity() {
s.javaScriptEnabled = true
s.domStorageEnabled = true
s.allowFileAccess = true
wv?.addJavascriptInterface(VencordNative(this, wv!!), "VencordMobileNative")
try {
fetchVencord(this)
} catch (ex: IOException) {
if(!sPrefs.getBoolean("safeMode", false)) {
wv?.addJavascriptInterface(VencordNative(this, wv!!), "VencordMobileNative")
try {
fetchVencord(this)
} catch (ex: IOException) {
}
}
else {
Toast.makeText(this, "Safe mode enabled, Vencord won't be loaded", Toast.LENGTH_SHORT).show()
editor.putBoolean("safeMode", false)
editor.apply()
}
val intent = intent
if (intent.action == Intent.ACTION_VIEW) {
@ -117,36 +142,44 @@ class MainActivity : Activity() {
return super.onKeyDown(keyCode, event)
}
override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent) {
if (requestCode != FILECHOOSER_RESULTCODE || filePathCallback == null) return
if (resultCode != RESULT_OK || intent == null) {
filePathCallback!!.onReceiveValue(null)
} else {
var uris: Array<Uri?>?
try {
val clipData = intent.clipData
if (clipData != null) { // multiple items
uris = arrayOfNulls(clipData.itemCount)
for (i in 0 until clipData.itemCount) {
uris[i] = clipData.getItemAt(i).uri
override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {
super.onActivityResult(requestCode, resultCode, intent)
try {
if(resultCode != RESULT_CANCELED) {
if (requestCode != FILECHOOSER_RESULTCODE || filePathCallback == null) return
if (resultCode != RESULT_OK || intent == null) {
filePathCallback!!.onReceiveValue(null)
} else {
var uris: Array<Uri?>?
try {
val clipData = intent.clipData
if (clipData != null) { // multiple items
uris = arrayOfNulls(clipData.itemCount)
for (i in 0 until clipData.itemCount) {
uris[i] = clipData.getItemAt(i).uri
}
} else { // single item
uris = arrayOf(intent.data)
}
} catch (ex: Exception) {
e("Error during file upload", ex)
uris = null
}
} else { // single item
uris = arrayOf(intent.data)
filePathCallback!!.onReceiveValue(uris)
}
} catch (ex: Exception) {
e("Error during file upload", ex)
uris = null
filePathCallback = null
}
filePathCallback!!.onReceiveValue(uris)
}
filePathCallback = null
catch (ex: Exception) {
// it is well known that the best fix for the crash is to wrap the entire function in a try/catch block
}
}
private fun explodeAndroid() {
StrictMode.setThreadPolicy(
ThreadPolicy.Builder() // trolley
.permitNetwork()
.build()
ThreadPolicy.Builder() // trolley
.permitNetwork()
.build()
)
}

View file

@ -0,0 +1,51 @@
package com.nin0dev.vendroid
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.view.WindowManager
import android.webkit.CookieManager
import android.webkit.CookieSyncManager
import android.webkit.WebView
import android.widget.Button
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.google.android.material.card.MaterialCardView
import com.google.android.material.snackbar.Snackbar
class RecoveryActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window.statusBarColor = Color.TRANSPARENT
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
window.navigationBarColor = Color.TRANSPARENT
setContentView(R.layout.activity_recovery)
findViewById<MaterialCardView>(R.id.start_normally).setOnClickListener {
finish()
startActivity(Intent(this, MainActivity::class.java))
}
findViewById<MaterialCardView>(R.id.safe_mode).setOnClickListener {
val sPrefs = getSharedPreferences("settings", Context.MODE_PRIVATE)
val e = sPrefs.edit()
e.putBoolean("safeMode", true)
e.apply()
finish()
startActivity(Intent(this, MainActivity::class.java))
}
findViewById<MaterialCardView>(R.id.settings).setOnClickListener {
finish()
startActivity(Intent(this, SettingsActivity::class.java))
}
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
}
}

View file

@ -37,6 +37,11 @@ class SettingsActivity : AppCompatActivity() {
"ptb" -> findViewById<MaterialRadioButton>(R.id.ptb).isChecked = true
"canary" -> findViewById<MaterialRadioButton>(R.id.canary).isChecked = true
}
when (sPrefs.getString("splash", "viggy")) {
"viggy" -> findViewById<MaterialRadioButton>(R.id.viggy).isChecked = true
"shiggy" -> findViewById<MaterialRadioButton>(R.id.shiggy).isChecked = true
"oneko" -> findViewById<MaterialRadioButton>(R.id.oneko).isChecked = true
}
if(sPrefs.getString("vencordLocation", "")?.isNotBlank() == true) {
findViewById<CheckBox>(R.id.allow_custom_location).isChecked = true
val devbuildField = findViewById<TextInputEditText>(R.id.custom_location)
@ -71,6 +76,9 @@ class SettingsActivity : AppCompatActivity() {
if (findViewById<RadioButton>(R.id.stable).isChecked) editor.putString("discordBranch", "stable")
if (findViewById<RadioButton>(R.id.ptb).isChecked) editor.putString("discordBranch", "ptb")
if (findViewById<RadioButton>(R.id.canary).isChecked) editor.putString("discordBranch", "canary")
if (findViewById<RadioButton>(R.id.viggy).isChecked) editor.putString("splash", "viggy")
if (findViewById<RadioButton>(R.id.shiggy).isChecked) editor.putString("splash", "shiggy")
if (findViewById<RadioButton>(R.id.oneko).isChecked) editor.putString("splash", "oneko")
if (findViewById<CheckBox>(R.id.allow_custom_location).isChecked && findViewById<EditText>(R.id.custom_location).text.isNotBlank()) editor.putString("vencordLocation", findViewById<EditText>(R.id.custom_location).text.toString())
editor.apply()

View file

@ -8,9 +8,12 @@ import android.webkit.WebResourceRequest
import android.webkit.WebResourceResponse
import android.webkit.WebView
import android.webkit.WebViewClient
import android.widget.Toast
import androidx.annotation.RequiresApi
import com.nin0dev.vendroid.Logger.e
import java.io.File
import java.io.IOException
import java.lang.Exception
import java.net.HttpURLConnection
import java.net.URL
@ -26,8 +29,13 @@ class VWebviewClient : WebViewClient() {
}
override fun onPageStarted(view: WebView, url: String, favicon: Bitmap?) {
view.evaluateJavascript(HttpClient.VencordRuntime!!, null)
view.evaluateJavascript(HttpClient.VencordMobileRuntime!!, null)
try {
HttpClient.VencordRuntime?.let { view.evaluateJavascript(it, null) }
HttpClient.VencordMobileRuntime?.let { view.evaluateJavascript(it, null) }
}
catch (e: Exception) {
Toast.makeText(view.context, "Couldn't load Vencord, try restarting the app.", Toast.LENGTH_LONG).show()
}
}
override fun onPageFinished(view: WebView, url: String) {

View file

@ -27,25 +27,6 @@ class WelcomeActivity : AppCompatActivity() {
setContentView(R.layout.activity_welcome)
val devbuildCheckbox = findViewById<CheckBox>(R.id.allow_custom_location)
devbuildCheckbox.setOnClickListener {
if (devbuildCheckbox.isChecked) {
MaterialAlertDialogBuilder(this)
.setTitle("Warning")
.setMessage("If you set a custom location, you will be loading and injecting Vencord from a different location. This feature is meant for developers ONLY. Never edit this setting if someone else asked you to, or if you don't know what you're doing! If you do set a custom location, you will not be able to ask for support in the Vencord support channel or in this project's issues. Are you sure you want to continue?")
.setNegativeButton(resources.getString(R.string.no)) { _, _ ->
devbuildCheckbox.isChecked = false
}
.setPositiveButton(resources.getString(R.string.yes)) { _, _ ->
findViewById<EditText>(R.id.custom_location).visibility = VISIBLE
}
.show()
}
else {
findViewById<EditText>(R.id.custom_location).visibility = GONE
}
}
findViewById<ExtendedFloatingActionButton>(R.id.save_settings).setOnClickListener {
val sPrefs = getSharedPreferences("settings", Context.MODE_PRIVATE)
val editor = sPrefs.edit()
@ -54,7 +35,6 @@ class WelcomeActivity : AppCompatActivity() {
if (findViewById<RadioButton>(R.id.stable).isChecked) editor.putString("discordBranch", "stable")
if (findViewById<RadioButton>(R.id.ptb).isChecked) editor.putString("discordBranch", "ptb")
if (findViewById<RadioButton>(R.id.canary).isChecked) editor.putString("discordBranch", "canary")
if (findViewById<CheckBox>(R.id.allow_custom_location).isChecked && findViewById<EditText>(R.id.custom_location).text.isNotBlank()) editor.putString("vencordLocation", findViewById<EditText>(R.id.custom_location).text.toString())
editor.apply()
finish()

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M12,5V2L8,6l4,4V7c3.31,0 6,2.69 6,6c0,2.97 -2.17,5.43 -5,5.91v2.02c3.95,-0.49 7,-3.85 7,-7.93C20,8.58 16.42,5 12,5z"/>
<path android:fillColor="@android:color/white" android:pathData="M6,13c0,-1.65 0.67,-3.15 1.76,-4.24L6.34,7.34C4.9,8.79 4,10.79 4,13c0,4.08 3.05,7.44 7,7.93v-2.02C8.17,18.43 6,15.97 6,13z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View file

@ -13,11 +13,31 @@
android:orientation="vertical">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/viggy_gif"
android:layout_width="wrap_content"
android:layout_height="232dp"
android:layout_height="wrap_content"
android:scaleX="1"
android:scaleY="1"
android:src="@drawable/viggy" />
android:src="@drawable/viggy"
android:visibility="gone" />
<pl.droidsonroids.gif.GifImageView
android:id="@+id/shiggy_gif"
android:layout_width="match_parent"
android:layout_height="228dp"
android:scaleX="1"
android:scaleY="1"
android:src="@drawable/shiggy"
android:visibility="gone" />
<pl.droidsonroids.gif.GifImageView
android:id="@+id/oneko_gif"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleX="1"
android:scaleY="1"
android:src="@drawable/oneko"
android:visibility="gone" />
<TextView
android:layout_width="wrap_content"

View file

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="20dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:id="@+id/start_normally"
style="?attr/materialCardViewFilledStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/start_normally"
android:textAppearance="?attr/textAppearanceTitleMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/start_normally_desc"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/safe_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/safe_mode"
android:textAppearance="?attr/textAppearanceTitleMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/safe_mode_desc"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/open_settings"
android:textAppearance="?attr/textAppearanceTitleMedium" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/open_settings_desc"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="0dp"
app:layout_collapseMode="pin"
app:title="@string/recovery_shortcut_name"
app:titleTextColor="@color/text" />
</com.google.android.material.appbar.AppBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -40,6 +40,38 @@
android:enabled="false"
android:text="@string/autocheck_vencord" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/splashscreen"
android:textColor="@color/text"
android:textSize="18sp" />
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent">
<RadioButton
android:id="@+id/viggy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/viggy" />
<RadioButton
android:id="@+id/shiggy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/shiggy" />
<RadioButton
android:id="@+id/oneko"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/oneko" />
</RadioGroup>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -110,22 +142,13 @@
android:layout_height="wrap_content"
android:layout_width="match_parent">
<com.google.android.material.appbar.CollapsingToolbarLayout
style="?attr/collapsingToolbarLayoutLargeStyle"
<com.google.android.material.appbar.MaterialToolbar
android:layout_width="match_parent"
android:layout_height="?attr/collapsingToolbarLayoutLargeSize"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:contentScrim="?attr/colorSurfaceContainer">
<com.google.android.material.appbar.MaterialToolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="0dp"
app:layout_collapseMode="pin"
app:title="Vendroid Settings"
app:titleTextColor="@color/text" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
android:layout_height="?attr/actionBarSize"
android:elevation="0dp"
app:layout_collapseMode="pin"
app:title="Vendroid Settings"
app:titleTextColor="@color/text" />
</com.google.android.material.appbar.AppBarLayout>

View file

@ -71,34 +71,6 @@
android:text="@string/canary" />
</RadioGroup>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/vencord_location"
android:textColor="@color/text"
android:textSize="18sp" />
<CheckBox
android:id="@+id/allow_custom_location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/set_custom_location" />
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:hint="@string/custom_location_url">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/custom_location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
tools:visibility="visible" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
@ -110,22 +82,13 @@
android:layout_height="wrap_content"
android:layout_width="match_parent">
<com.google.android.material.appbar.CollapsingToolbarLayout
style="?attr/collapsingToolbarLayoutLargeStyle"
<com.google.android.material.appbar.MaterialToolbar
android:layout_width="match_parent"
android:layout_height="?attr/collapsingToolbarLayoutLargeSize"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:contentScrim="?attr/colorSurfaceContainer">
<com.google.android.material.appbar.MaterialToolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="0dp"
app:layout_collapseMode="pin"
app:title="Welcome to Vendroid"
app:titleTextColor="@color/text" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
android:layout_height="?attr/actionBarSize"
android:elevation="0dp"
app:layout_collapseMode="pin"
app:title="Welcome to Vendroid"
app:titleTextColor="@color/text" />
</com.google.android.material.appbar.AppBarLayout>

View file

@ -15,7 +15,19 @@
<string name="custom_location_url">Custom location URL</string>
<string name="no">No</string>
<string name="yes">Yes</string>
<string name="vendroid_update_available">Vendroid update available</string>
<string name="vendroid_update_available">VendroidEnhanced update available</string>
<string name="update">Update</string>
<string name="later">Later</string>
<string name="viggy">Viggy, by shoritsu</string>
<string name="shiggy">Shiggy, by naga_U</string>
<string name="oneko">Oneko</string>
<string name="splashscreen">Splash screen</string>
<string name="recovery_shortcut_name">Recovery mode</string>
<string name="cleared_all">Cleared all cookies</string>
<string name="start_normally">Start normally</string>
<string name="start_normally_desc">Don\'t do anything and start the app normally.</string>
<string name="safe_mode">Safe mode</string>
<string name="safe_mode_desc">Use this option to launch the app and load Discord, but without Vencord or any VendroidEnhanced tweak injected.</string>
<string name="open_settings">Open settings</string>
<string name="open_settings_desc">Configure VendroidEnhanced.</string>
</resources>

View file

@ -0,0 +1,13 @@
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="recovery"
android:enabled="true"
android:icon="@drawable/reset"
android:shortcutShortLabel="Recovery mode"
android:shortcutLongLabel="Recovery mode">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="com.nin0dev.vendroid"
android:targetClass="com.nin0dev.vendroid.RecoveryActivity" />
</shortcut>
</shortcuts>