Skip to content
This repository was archived by the owner on Jun 29, 2026. It is now read-only.

Commit fb26704

Browse files
committed
add force updating
1 parent 979334e commit fb26704

3 files changed

Lines changed: 39 additions & 9 deletions

File tree

app/src/main/java/com/nin0dev/vendroid/RecoveryActivity.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,8 @@ import android.content.Intent
55
import android.graphics.Color
66
import android.os.Bundle
77
import android.view.WindowManager
8-
import android.webkit.CookieManager
9-
import android.webkit.CookieSyncManager
10-
import android.webkit.WebView
11-
import android.widget.Button
12-
import androidx.activity.enableEdgeToEdge
138
import androidx.appcompat.app.AppCompatActivity
14-
import androidx.core.view.ViewCompat
15-
import androidx.core.view.WindowInsetsCompat
169
import com.google.android.material.card.MaterialCardView
17-
import com.google.android.material.snackbar.Snackbar
1810

1911
class RecoveryActivity : AppCompatActivity() {
2012
override fun onCreate(savedInstanceState: Bundle?) {
@@ -39,6 +31,14 @@ class RecoveryActivity : AppCompatActivity() {
3931
finish()
4032
startActivity(Intent(this, MainActivity::class.java))
4133
}
34+
findViewById<MaterialCardView>(R.id.force_update).setOnClickListener {
35+
val sPrefs = getSharedPreferences("settings", Context.MODE_PRIVATE)
36+
val e = sPrefs.edit()
37+
e.putInt("lastMajorUpdateThatUserHasUpdatedVencord", 0)
38+
e.apply()
39+
finish()
40+
startActivity(Intent(this, MainActivity::class.java))
41+
}
4242

4343
}
4444
override fun onNewIntent(intent: Intent) {

app/src/main/res/layout/activity_recovery.xml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4-
xmlns:tools="http://schemas.android.com/tools"
54
android:id="@+id/main_layout"
65
android:layout_width="match_parent"
76
android:layout_height="match_parent"
@@ -78,6 +77,35 @@
7877
</LinearLayout>
7978
</com.google.android.material.card.MaterialCardView>
8079

80+
<com.google.android.material.card.MaterialCardView
81+
android:id="@+id/force_update"
82+
android:layout_width="match_parent"
83+
android:layout_height="wrap_content"
84+
android:layout_marginTop="10dp"
85+
android:clickable="true">
86+
87+
<LinearLayout
88+
android:layout_width="match_parent"
89+
android:layout_height="match_parent"
90+
android:orientation="vertical"
91+
android:padding="16dp">
92+
93+
<TextView
94+
android:layout_width="wrap_content"
95+
android:layout_height="wrap_content"
96+
android:text="@string/force_update"
97+
android:textAppearance="?attr/textAppearanceTitleMedium" />
98+
99+
<TextView
100+
android:layout_width="wrap_content"
101+
android:layout_height="wrap_content"
102+
android:layout_marginTop="8dp"
103+
android:text="@string/force_update_desc"
104+
android:textAppearance="?attr/textAppearanceBodyMedium"
105+
android:textColor="?android:attr/textColorSecondary" />
106+
</LinearLayout>
107+
</com.google.android.material.card.MaterialCardView>
108+
81109

82110
</LinearLayout>
83111

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@
3838
<string name="app_icons_desc">Change your VendroidEnhanced app icon! Occasionally, seasonal icons may appear.</string>
3939
<string name="quickcss">QuickCSS</string>
4040
<string name="save_exit"><![CDATA[Save & exit]]></string>
41+
<string name="force_update">Force update Vencord</string>
42+
<string name="force_update_desc">Start VendroidEnhanced, but force a Vencord update. Useful if you are crashing or similar and cannot access the Updater tab.</string>
4143
</resources>

0 commit comments

Comments
 (0)