Skip to content

Commit 78c1db9

Browse files
n00b69Victoria-Freeman
authored andcommitted
2 new strings, add devcfg flasher into quickboot qs (untested), fixed
devcfg, added htc desire 12+ for graphiks, added victoria freeman to credits
1 parent 8e7712e commit 78c1db9

File tree

7 files changed

+111
-69
lines changed

7 files changed

+111
-69
lines changed

app/src/main/java/id/kuato/woahelper/main/MainActivity.java

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ protected void onCreate(Bundle savedInstanceState) {
228228
x.tvPanel.setVisibility(View.VISIBLE);
229229
}
230230
case "cepheus" -> {
231-
guidelink = "https://github.com/ivnvrvnn/Port-Windows-XiaoMI-9";
231+
guidelink = "https://github.com/fbernkastel228/Port-Windows-XiaoMI-9";
232232
grouplink = "http://t.me/woacepheus";
233233
x.DeviceImage.setImageResource(R.drawable.cepheus);
234234
x.tvPanel.setVisibility(View.VISIBLE);
@@ -497,6 +497,11 @@ protected void onCreate(Bundle savedInstanceState) {
497497
grouplink = "https://t.me/woahelperchat";
498498
x.DeviceImage.setImageResource(R.drawable.nx729j);
499499
}
500+
case "brepdugl" -> {
501+
guidelink = "https://github.com/Project-Silicium/Mu-Silicium";
502+
grouplink = "https://discord.gg/Dx2QgMx7Sv";
503+
x.DeviceImage.setImageResource(R.drawable.unknown);
504+
}
500505
default -> {
501506
guidelink = "https://renegade-project.tech/";
502507
grouplink = "https://t.me/joinchat/MNjTmBqHIokjweeN0SpoyA";
@@ -1425,29 +1430,12 @@ public void dump() {
14251430
public void checkdbkpmodel() {
14261431
dbkpmodel = ShellUtils.fastCmd("getprop ro.product.device");
14271432
switch (dbkpmodel) {
1428-
case "guacamole", "guacamolet", "OnePlus7Pro", "OnePlus7Pro4G", "OnePlus7ProTMO" ->
1429-
dbkpmodel = "ONEPLUS 7 PRO";
1433+
case "guacamole", "guacamolet", "OnePlus7Pro", "OnePlus7Pro4G", "OnePlus7ProTMO" -> dbkpmodel = "ONEPLUS 7 PRO";
14301434
case "hotdog", "OnePlus7TPro", "OnePlus7TPro4G" -> dbkpmodel = "ONEPLUS 7T PRO";
1431-
case "cepheus" -> {
1432-
dbkpmodel = "XIAOMI MI 9";
1433-
k.devcfg1.setVisibility(View.GONE);
1434-
k.devcfg2.setVisibility(View.GONE);
1435-
}
1436-
case "nabu" -> {
1437-
dbkpmodel = "XIAOMI PAD 5";
1438-
k.devcfg1.setVisibility(View.GONE);
1439-
k.devcfg2.setVisibility(View.GONE);
1440-
}
1441-
case "pipa" -> {
1442-
dbkpmodel = "XIAOMI PAD 6";
1443-
k.devcfg1.setVisibility(View.GONE);
1444-
k.devcfg2.setVisibility(View.GONE);
1445-
}
1446-
default -> {
1447-
dbkpmodel = "UNSUPPORTED";
1448-
k.devcfg1.setVisibility(View.GONE);
1449-
k.devcfg2.setVisibility(View.GONE);
1450-
}
1435+
case "cepheus" -> dbkpmodel = "XIAOMI MI 9";
1436+
case "nabu" -> dbkpmodel = "XIAOMI PAD 5";
1437+
// case "pipa" -> dbkpmodel = "XIAOMI PAD 6";
1438+
default -> dbkpmodel = "UNSUPPORTED";
14511439
}
14521440
}
14531441
public void checkuefi() {

app/src/main/java/id/kuato/woahelper/main/mount_tile.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ private void update() {
4949

5050
private void mount() {
5151
ShellUtils.fastCmd("mkdir " + winpath + " || true");
52-
ShellUtils.fastCmd("su -mm -c /data/data/id.kuato.woahelper/files/mount.ntfs " + win + " " + winpath);
52+
ShellUtils.fastCmd("cd " + getFilesDir());
53+
ShellUtils.fastCmd("su -mm -c ./mount.ntfs " + win + " " + winpath);
5354
}
5455

5556
public void unmount() {

app/src/main/java/id/kuato/woahelper/main/quickboot_tile.java

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.os.Build;
44
import android.service.quicksettings.Tile;
55
import android.service.quicksettings.TileService;
6+
import android.widget.Toast;
67

78
import com.topjohnwu.superuser.ShellUtils;
89

@@ -29,16 +30,27 @@ public class quickboot_tile extends TileService {
2930
public void onStartListening() {
3031
super.onStartListening();
3132
final Tile tile = getQsTile();
32-
checkdevice();
3333
checkuefi();
34+
device = ShellUtils.fastCmd("getprop ro.product.device");
3435
findwin = ShellUtils.fastCmd("find /dev/block | grep -i -E \"win|mindows|windows\" | head -1");
35-
if (finduefi.isEmpty() || (isSecure() && !pref.getSecure(this))||findwin.isEmpty()) tile.setState(0);
36+
if (finduefi.isEmpty() || (isSecure() && !pref.getSecure(this)) || findwin.isEmpty()) tile.setState(0);
3637
else tile.setState(1);
38+
if (pref.getDevcfg1(this)) {
39+
if (!MainActivity.isNetworkConnected(this)) {
40+
String finddevcfg = ShellUtils.fastCmd("find " + getFilesDir() + " -maxdepth 1 -name OOS11_devcfg_*");
41+
if (finddevcfg.isEmpty()) {
42+
tile.setState(0);
43+
// These titles don't actually even seem to work and are obsolete I guess, is there even a way to change the titles?
44+
tile.setSubtitle(getString(R.string.qsinternet));
45+
}
46+
} else {
47+
tile.setState(1);
48+
}
49+
}
3750
if (Build.VERSION_CODES.Q <= Build.VERSION.SDK_INT) {
3851
tile.setSubtitle("");
3952
}
4053
tile.updateTile();
41-
4254
}
4355

4456
// Called when the user taps on your tile in an active or inactive state.
@@ -71,32 +83,68 @@ public void onClick() {
7183
final String currentDateAndTime = sdf.format(new Date());
7284
pref.setDATE(this, currentDateAndTime);
7385
}
86+
// This whole feature feels very laggy to me in the QS tile, needs overhauling.
87+
if (pref.getDevcfg1(this)) {
88+
if (!MainActivity.isNetworkConnected(this)) {
89+
String finddevcfg = ShellUtils.fastCmd("find " + getFilesDir() + " -maxdepth 1 -name OOS11_devcfg_*");
90+
if (finddevcfg.isEmpty()) {
91+
Toast.makeText(this, (getString(R.string.internet)), Toast.LENGTH_LONG).show();
92+
tile.setState(0);
93+
tile.setSubtitle(getString(R.string.qsinternet));
94+
return;
95+
} else {
96+
tile.setState(1);
97+
}
98+
}
99+
String devcfgDevice = "";
100+
if ("guacamole".equals(device) || "OnePlus7Pro".equals(device) || "OnePlus7Pro4G".equals(device)) devcfgDevice = "guacamole";
101+
else if ("hotdog".equals(device) || "OnePlus7TPro".equals(device) || "OnePlus7TPro4G".equals(device)) devcfgDevice = "hotdog";
102+
String findoriginaldevcfg = ShellUtils.fastCmd("find " + getFilesDir() + " -maxdepth 1 -name original-devcfg.img");
103+
if (findoriginaldevcfg.isEmpty()) {
104+
ShellUtils.fastCmd("dd bs=8M if=/dev/block/by-name/devcfg$(getprop ro.boot.slot_suffix) of=/sdcard/original-devcfg.img");
105+
ShellUtils.fastCmd("cp /sdcard/original-devcfg.img " + getFilesDir() + "/original-devcfg.img");
106+
}
107+
String finddevcfg = ShellUtils.fastCmd("find " + getFilesDir() + " -maxdepth 1 -name OOS11_devcfg_*");
108+
if (finddevcfg.isEmpty()) {
109+
ShellUtils.fastCmd(String.format("echo \"$(su -mm -c find /data/adb -name busybox) wget https://github.com/n00b69/woa-op7/releases/download/Files/OOS11_devcfg_%s.img -O /sdcard/OOS11_devcfg_%s.img\" | su -mm -c sh", devcfgDevice, devcfgDevice));
110+
ShellUtils.fastCmd(String.format("echo \"$(su -mm -c find /data/adb -name busybox) wget https://github.com/n00b69/woa-op7/releases/download/Files/OOS12_devcfg_%s.img -O /sdcard/OOS12_devcfg_%s.img\" | su -mm -c sh", devcfgDevice, devcfgDevice));
111+
ShellUtils.fastCmd(String.format("cp /sdcard/OOS11_devcfg_%s.img %s", devcfgDevice, getFilesDir()));
112+
ShellUtils.fastCmd(String.format("cp /sdcard/OOS12_devcfg_%s.img %s", devcfgDevice, getFilesDir()));
113+
ShellUtils.fastCmd(String.format("dd bs=8M if=%s/OOS11_devcfg_%s.img of=/dev/block/by-name/devcfg$(getprop ro.boot.slot_suffix)", getFilesDir(), devcfgDevice));
114+
} else {
115+
ShellUtils.fastCmd(String.format("dd bs=8M if=%s/OOS11_devcfg_%s.img of=/dev/block/by-name/devcfg$(getprop ro.boot.slot_suffix)", getFilesDir(), devcfgDevice));
116+
}
117+
}
118+
if (pref.getDevcfg2(this) && pref.getDevcfg1(this)) {
119+
ShellUtils.fastCmd("mkdir " + winpath + "/sta || true ");
120+
ShellUtils.fastCmd("cp '" + getFilesDir() + "/Flash Devcfg.lnk' " + winpath + "/Users/Public/Desktop");
121+
ShellUtils.fastCmd("cp " + getFilesDir() + "/sdd.exe " + winpath + "/sta/sdd.exe");
122+
ShellUtils.fastCmd("cp " + getFilesDir() + "/devcfg-boot-sdd.conf " + winpath + "/sta/sdd.conf");
123+
ShellUtils.fastCmd("cp " + getFilesDir() + "/original-devcfg.img " + winpath + "/original-devcfg.img");
124+
}
125+
// Toast.makeText(this, "This should appear if it reaches the (disabled) flash uefi section", Toast.LENGTH_LONG).show();
74126
flash();
75127
ShellUtils.fastCmd("su -c svc power reboot");
76128
} else {
77129
tile.setState(2);
78130
if (Build.VERSION_CODES.Q <= Build.VERSION.SDK_INT) {
79-
tile.setSubtitle("Press again");
131+
tile.setSubtitle(getString(R.string.qspressagain));
80132
}
81133
tile.updateTile();
82134
}
83135
}
84136

85137
private void mount() {
86138
ShellUtils.fastCmd("mkdir " + winpath + " || true");
87-
ShellUtils.fastCmd("su -mm -c /data/data/id.kuato.woahelper/files/mount.ntfs " + win + " " + winpath);
139+
ShellUtils.fastCmd("cd " + getFilesDir());
140+
ShellUtils.fastCmd("su -mm -c ./mount.ntfs " + win + " " + winpath);
88141
}
89142

90143
public void flash() {
91144
ShellUtils.fastCmd("dd if=" + finduefi + " of=/dev/block/bootdevice/by-name/boot$(getprop ro.boot.slot_suffix) bs=16m");
92145
}
93146

94-
public void checkdevice() {
95-
device = ShellUtils.fastCmd("getprop ro.product.device");
96-
}
97-
98147
public void checkuefi() {
99-
checkdevice();
100148
finduefi = ShellUtils.fastCmd(getString(R.string.uefiChk));
101149
findwin = ShellUtils.fastCmd("find /dev/block | grep -i -E \"win|mindows|windows\" | head -1");
102150
win = ShellUtils.fastCmd("realpath " + findwin);

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
android:layout_height="wrap_content"
267267
android:layout_marginRight="30dp"
268268
android:text="@string/backup_boot_title"
269-
android:textSize="@dimen/_11sdp"
269+
android:textSize="@dimen/_12sdp"
270270
android:textStyle="bold" />
271271

272272
<TextView
@@ -276,7 +276,7 @@
276276
android:gravity="left"
277277
android:text="@string/backup_boot_subtitle"
278278
android:paddingRight="@dimen/_15sdp"
279-
android:textSize="@dimen/_9sdp"
279+
android:textSize="@dimen/_10sdp"
280280
android:textStyle="italic" />
281281
</LinearLayout>
282282
</LinearLayout>
@@ -326,7 +326,7 @@
326326
android:layout_width="wrap_content"
327327
android:layout_height="wrap_content"
328328
android:text="@string/mnt_title"
329-
android:textSize="@dimen/_11sdp"
329+
android:textSize="@dimen/_12sdp"
330330
android:textStyle="bold" />
331331

332332
<TextView
@@ -336,7 +336,7 @@
336336
android:gravity="left"
337337
android:text="@string/mnt_subtitle"
338338
android:paddingRight="@dimen/_15sdp"
339-
android:textSize="@dimen/_9sdp"
339+
android:textSize="@dimen/_10sdp"
340340
android:textStyle="italic" />
341341
</LinearLayout>
342342
</LinearLayout>
@@ -387,7 +387,7 @@
387387
android:layout_height="wrap_content"
388388
android:layout_marginRight="30dp"
389389
android:text="@string/toolbox_title"
390-
android:textSize="@dimen/_11sdp"
390+
android:textSize="@dimen/_12sdp"
391391
android:textStyle="bold" />
392392

393393
<TextView
@@ -397,7 +397,7 @@
397397
android:gravity="left"
398398
android:text="@string/toolbox_subtitle"
399399
android:paddingRight="@dimen/_15sdp"
400-
android:textSize="@dimen/_9sdp"
400+
android:textSize="@dimen/_10sdp"
401401
android:textStyle="italic" />
402402
</LinearLayout>
403403
</LinearLayout>
@@ -449,7 +449,7 @@
449449
android:layout_height="wrap_content"
450450
android:layout_marginRight="30dp"
451451
android:text="@string/quickboot_question"
452-
android:textSize="@dimen/_11sdp"
452+
android:textSize="@dimen/_12sdp"
453453
android:textStyle="bold" />
454454

455455
<TextView
@@ -458,7 +458,7 @@
458458
android:layout_height="wrap_content"
459459
android:gravity="left"
460460
android:paddingRight="@dimen/_15sdp"
461-
android:textSize="@dimen/_9sdp"
461+
android:textSize="@dimen/_10sdp"
462462
android:textStyle="italic" />
463463
</LinearLayout>
464464
</LinearLayout>
@@ -471,9 +471,12 @@
471471

472472
<TextView
473473
android:id="@+id/tvAppCreator"
474-
android:layout_width="wrap_content"
474+
android:layout_width="match_parent"
475475
android:layout_height="wrap_content"
476476
android:layout_gravity="bottom|end"
477+
android:gravity="end"
478+
android:maxLines="1"
479+
android:textSize="@dimen/_9sdp"
477480
android:layout_margin="4dp"
478481
android:text="@string/creator" />
479482

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
android:layout_width="wrap_content"
9595
android:layout_height="wrap_content"
9696
android:text="@string/usbhost_title"
97-
android:textSize="@dimen/_11sdp"
97+
android:textSize="@dimen/_12sdp"
9898
android:textStyle="bold" />
9999

100100
<TextView
@@ -104,7 +104,7 @@
104104
android:gravity="left"
105105
android:paddingRight="@dimen/_15sdp"
106106
android:text="@string/usbhost_subtitle"
107-
android:textSize="@dimen/_9sdp"
107+
android:textSize="@dimen/_10sdp"
108108
android:textStyle="italic" />
109109
</LinearLayout>
110110
</LinearLayout>
@@ -154,7 +154,7 @@
154154
android:layout_width="wrap_content"
155155
android:layout_height="wrap_content"
156156
android:text="@string/rotation_title"
157-
android:textSize="@dimen/_11sdp"
157+
android:textSize="@dimen/_12sdp"
158158
android:textStyle="bold" />
159159

160160
<TextView
@@ -164,7 +164,7 @@
164164
android:gravity="left"
165165
android:paddingRight="@dimen/_15sdp"
166166
android:text="@string/rotation_subtitle"
167-
android:textSize="@dimen/_9sdp"
167+
android:textSize="@dimen/_10sdp"
168168
android:textStyle="italic" />
169169
</LinearLayout>
170170
</LinearLayout>
@@ -214,7 +214,7 @@
214214
android:layout_width="wrap_content"
215215
android:layout_height="wrap_content"
216216
android:text="@string/tablet_title"
217-
android:textSize="@dimen/_11sdp"
217+
android:textSize="@dimen/_12sdp"
218218
android:textStyle="bold" />
219219

220220
<TextView
@@ -224,7 +224,7 @@
224224
android:gravity="left"
225225
android:paddingRight="@dimen/_15sdp"
226226
android:text="@string/tablet_subtitle"
227-
android:textSize="@dimen/_9sdp"
227+
android:textSize="@dimen/_10sdp"
228228
android:textStyle="italic" />
229229
</LinearLayout>
230230
</LinearLayout>
@@ -275,7 +275,7 @@
275275
android:layout_height="wrap_content"
276276
android:layout_marginRight="30dp"
277277
android:text="@string/setup_title"
278-
android:textSize="@dimen/_11sdp"
278+
android:textSize="@dimen/_12sdp"
279279
android:textStyle="bold" />
280280

281281
<TextView
@@ -285,7 +285,7 @@
285285
android:gravity="left"
286286
android:paddingRight="@dimen/_15sdp"
287287
android:text="@string/setup_subtitle"
288-
android:textSize="@dimen/_9sdp"
288+
android:textSize="@dimen/_10sdp"
289289
android:textStyle="italic" />
290290
</LinearLayout>
291291
</LinearLayout>
@@ -336,7 +336,7 @@
336336
android:layout_height="wrap_content"
337337
android:layout_marginRight="30dp"
338338
android:text="@string/defender_title"
339-
android:textSize="@dimen/_11sdp"
339+
android:textSize="@dimen/_12sdp"
340340
android:textStyle="bold" />
341341

342342
<TextView
@@ -346,7 +346,7 @@
346346
android:gravity="left"
347347
android:paddingRight="@dimen/_15sdp"
348348
android:text="@string/defender_subtitle"
349-
android:textSize="@dimen/_9sdp"
349+
android:textSize="@dimen/_10sdp"
350350
android:textStyle="italic" />
351351
</LinearLayout>
352352

0 commit comments

Comments
 (0)