WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit a89e441

Browse files
committed
v3.5.0
1 parent bac31e7 commit a89e441

File tree

8 files changed

+77
-70
lines changed

8 files changed

+77
-70
lines changed

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
minSdk = 24
1212
//noinspection ExpiredTargetSdkVersion
1313
targetSdk = 22
14-
versionCode = 11
15-
versionName = "3.4.0"
14+
versionCode = 12
15+
versionName = "3.5.0"
1616
proguardFiles += 'proguard-rules.pro'
1717
multiDexEnabled = false
1818
}
@@ -50,5 +50,5 @@ android {
5050
dependencies {
5151
implementation 'me.s1204:DchaService:1.0.0'
5252
compileOnly 'me.s1204:BenesseExtension:1.0.0'
53-
implementation 'com.google.android.material:material:1.12.0'
53+
implementation 'com.google.android.material:material:1.13.0'
5454
}

app/src/main/assets/shrinker

-1.8 KB
Binary file not shown.

app/src/main/java/com/saradabar/easyblu/MainActivity.java

Lines changed: 53 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ public class MainActivity extends Activity {
6666

6767
private static final String LAUNCHER3 = "com.android.launcher3";
6868
private static final String APP_PACKAGE = "com.saradabar.easyblu";
69+
private static final String SETTINGS = "com.android.settings";
6970

7071
private static final String DCHA_PACKAGE = "jp.co.benesse.dcha.dchaservice"; // DchaService を使用
7172
private static final String DCHA_SERVICE = DCHA_PACKAGE + ".DchaService"; // copyUpdateImage を使ってシステム権限でファイルを操作
7273
private static final int DIGICHALIZE_STATUS_UNDIGICHALIZE = 0;
73-
private static final int DIGICHALIZE_STATUS_DIGICHARIZING_DL_COMPLETE = 2;
7474
private static final int DIGICHALIZE_STATUS_DIGICHALIZED = 3; // 開発者向けオプションのロック(BenesseExtension.checkPassword)の阻止
7575
private static final String DCHA_SYSTEM_COPY = "/cache/.."; // 内部の if 文で弾かれるのを防ぐ
7676
private IDchaService mDchaService = null;
@@ -98,11 +98,6 @@ public void onServiceDisconnected(ComponentName componentName) {
9898
protected void onCreate(Bundle savedInstanceState) {
9999
super.onCreate(savedInstanceState);
100100
setContentView(R.layout.activity_main);
101-
echo("""
102-
****************************
103-
Welcome to Easy BLU ! :)
104-
Easy BLU へようこそ!
105-
****************************""");
106101
echo("fingerprint:" + Build.FINGERPRINT);
107102
init();
108103
}
@@ -112,6 +107,7 @@ protected void onDestroy() {
112107
super.onDestroy();
113108
try {
114109
setEnvWithDcha(true);
110+
setSetupStatus(DIGICHALIZE_STATUS_UNDIGICHALIZE);
115111
} catch (Exception e) {
116112
error(e);
117113
}
@@ -176,7 +172,12 @@ private StringBuilder exec(String cmd) throws RuntimeException {
176172
process.waitFor();
177173

178174
String data;
179-
while ((data = bufferedReader.readLine()) != null) stringBuilder.append(data).append(System.lineSeparator());
175+
while ((data = bufferedReader.readLine()) != null) {
176+
data.trim();
177+
if (data.startsWith("Temp") || data.startsWith("Home") || data.startsWith("----") || data.startsWith("http")) continue;
178+
stringBuilder.append(data);
179+
if (!data.isEmpty()) stringBuilder.append(System.lineSeparator());
180+
}
180181
bufferedReader.close();
181182
bufferedWriter.close();
182183
process.destroy();
@@ -238,6 +239,7 @@ private void warning(String str) {
238239
*/
239240
private void error(Exception e) {
240241
echo("- エラー:" + System.lineSeparator() + e);
242+
setSetupStatus(DIGICHALIZE_STATUS_UNDIGICHALIZE);
241243
TextView textView = findViewById(R.id.text_status);
242244
textView.setText("始めからやり直しますか?");
243245
Button mainButton = findViewById(R.id.button_main);
@@ -260,6 +262,7 @@ private void error(Exception e) {
260262
*/
261263
private void stop(String str) {
262264
echo("- エラー:" + System.lineSeparator() + str);
265+
setSetupStatus(DIGICHALIZE_STATUS_UNDIGICHALIZE);
263266
TextView textView = findViewById(R.id.text_status);
264267
textView.setText("アプリを終了してください。");
265268
Button mainButton = findViewById(R.id.button_main);
@@ -282,40 +285,51 @@ private void stop(String str) {
282285
* @since v1.0
283286
*/
284287
private void init() {
288+
TextView textView = findViewById(R.id.text_status);
289+
Button mainButton = findViewById(R.id.button_main);
290+
Button subButton = findViewById(R.id.button_sub);
291+
285292
if (!CT3 && !CTX && !CTZ) {
286293
stop("対象端末ではありません");
287294
} else if (!bindService(BIND_DCHA, mConn, Context.BIND_AUTO_CREATE)) {
288295
stop("DchaService に接続できませんでした");
296+
} else if (BenesseExtension.getDchaState() == DIGICHALIZE_STATUS_DIGICHALIZED) {
297+
mainButton.setOnClickListener(v -> {
298+
mainButton.setEnabled(false);
299+
mainButton.setText(" ");
300+
subButton.setEnabled(false);
301+
subButton.setText(" ");
302+
notify("エクスプロイトを実行しています");
303+
copyAssets(CT3 ? MTK_SU : SHRINKER);
304+
callFunc(this::setup);
305+
});
306+
subButton.setOnClickListener(v -> {
307+
setEnvWithDcha(true);
308+
setSetupStatus(DIGICHALIZE_STATUS_UNDIGICHALIZE);
309+
finish();
310+
});
289311
} else {
290-
TextView textView = findViewById(R.id.text_status);
291312
textView.setText("""
292313
ブートローダーアンロックに必要なシステム改ざん処理を実行しますか?
293-
この処理を実行したことによる損害等について開発者は一切の責任を取りません
314+
この処理を実行したことによる損害等について開発者は一切の責任を取りません
294315
295316
続行するには [実行] を押下してください""");
296-
Button mainButton = findViewById(R.id.button_main);
297-
Button subButton = findViewById(R.id.button_sub);
298-
mainButton.setEnabled(true);
299317
mainButton.setText("実行");
300318
mainButton.setOnClickListener(v -> {
301319
setEnvWithDcha(false);
320+
setSetupStatus(DIGICHALIZE_STATUS_DIGICHALIZED);
302321
mainButton.setEnabled(false);
303322
mainButton.setText(" ");
304323
subButton.setEnabled(false);
305324
subButton.setText(" ");
306-
textView.setText("""
307-
デバイスには処理が終了するまで絶対に触れないでください。
308-
309-
デバイスが再起動した場合は、再度実行してください。""");
310-
notify("エクスプロイトをコピーしています。");
325+
textView.setText("デバイスには処理が終了するまで絶対に触れないでください");
326+
notify("エクスプロイトを実行しています");
311327
copyAssets(CT3 ? MTK_SU : SHRINKER);
312328
callFunc(this::setup);
313329
});
314-
subButton.setEnabled(true);
315330
subButton.setText("設定アプリを開く");
316331
subButton.setOnClickListener(v -> {
317332
setEnvWithDcha(true);
318-
setDchaStateCompleted();
319333
startActivity(new Intent(Settings.ACTION_SETTINGS));
320334
finish();
321335
});
@@ -355,9 +369,9 @@ private void setup() { // retry() と同様
355369
*/
356370
private void copyFile(String src, String dst) {
357371
try {
358-
MainActivity.this.notify(src + " を " + dst + " にコピーしています");
372+
MainActivity.this.notify(src + " を " + dst + " にコピーしています");
359373
if (mDchaService.copyUpdateImage(src, DCHA_SYSTEM_COPY + dst)) {
360-
MainActivity.this.notify(src + " を削除しています");
374+
MainActivity.this.notify(src + " を削除しています");
361375
new File(src).delete();
362376
}
363377
} catch (Exception e) {
@@ -404,24 +418,8 @@ private void setSetupStatus(int status) {
404418
}
405419
}
406420

407-
/**
408-
* BenesseExtension の保護状況に基づき DchaState を変更
409-
* @author Syuugo
410-
* @since v3.2
411-
*/
412-
private void setDchaStateCompleted() {
413-
try {
414-
if (COUNT_DCHA_COMPLETED_FILE.exists()) {
415-
setSetupStatus(DIGICHALIZE_STATUS_DIGICHALIZED);
416-
}
417-
} catch (Exception e) {
418-
error(e);
419-
}
420-
}
421-
422421
private void setEnvWithDcha(boolean completed) {
423422
hideNavigationBar(!completed);
424-
setSetupStatus(completed ? DIGICHALIZE_STATUS_UNDIGICHALIZE : DIGICHALIZE_STATUS_DIGICHARIZING_DL_COMPLETE);
425423
clearDefaultPreferredApp(completed ? APP_PACKAGE : LAUNCHER3);
426424
setDefaultPreferredHomeApp(completed ? LAUNCHER3 : APP_PACKAGE);
427425
}
@@ -430,8 +428,8 @@ private void updateTouchpanelFw() {
430428
notify("タッチパネルのファームウェアを更新しています");
431429
copyAssets(NVT_TP_FW);
432430
try {
433-
notify("結果:" + BenesseExtension.putString(BC_NVT_TP_FW_UPDATE, NVT_TP_FW_UPDATE));
434-
notify("バージョン:" + BenesseExtension.getString(BC_NVT_TP_FW_VERSION));
431+
BenesseExtension.putString(BC_NVT_TP_FW_UPDATE, NVT_TP_FW_UPDATE);
432+
warning("しばらく画面の操作は受け付けません");
435433
} catch (Exception e) {
436434
error(e);
437435
}
@@ -446,10 +444,10 @@ private void updateTouchpanelFw() {
446444
* @since v1.0
447445
*/
448446
private void overwriteFrp() {
449-
notify(FRP + " の修正を試みます");
447+
notify(FRP + " の修正を試みます");
450448
copyAssets(FRP);
451449
try {
452-
notify(FRP + " を書き換えます");
450+
notify(FRP + " を書き換えます");
453451
copyFile(FRP_COPY, FRP_BLOCK); // 修正済み FRP を適用
454452
} catch (Exception e) {
455453
error(e);
@@ -482,7 +480,7 @@ private void parted(String cmd) {
482480
@NonNull
483481
private String getBlockDeviceSize() {
484482
copyAssets(PARTED);
485-
notify("BOOTDEVICE の詳細を出力します");
483+
notify("BOOTDEVICE の詳細を出力します");
486484
return exec(PARTED_CMD + "print").toString();
487485
}
488486

@@ -495,14 +493,14 @@ private String getBlockDeviceSize() {
495493
* @since v2.0
496494
*/
497495
private void checkFixed() {
498-
notify("BenesseExtension による保護を回避します");
496+
notify("BenesseExtension による保護を回避します");
499497
exec("touch /factory/ignore_dcha_completed");
500498
notify(EXPDB + " のサイズを計算します。");
501499
if (getBlockDeviceSize().contains("124MB 134MB")) { // 純正 expdb のセクタ範囲
502-
notify(EXPDB + " は修正されていません");
500+
notify(EXPDB + " は修正されていません");
503501
} else {
504-
notify(EXPDB + " は既に修正済みです");
505-
notify("既存の " + FRP + " を削除します");
502+
notify(EXPDB + " は既に修正済みです");
503+
notify("既存の " + FRP + " を削除します");
506504
parted("rm 24");
507505
}
508506
callFunc(this::fixExpdb);
@@ -516,13 +514,13 @@ private void checkFixed() {
516514
* @since v2.0
517515
*/
518516
private void fixExpdb() {
519-
notify(EXPDB + " を削除します");
517+
notify(EXPDB + " を削除します");
520518
parted("rm 13");
521-
notify(EXPDB + " を 9MB で再生成します");
519+
notify(EXPDB + " を 9MB で再生成します");
522520
parted("mkpart " + EXPDB + " 124MB 133MB");
523-
notify(EXPDB + " のラベルを設定します");
521+
notify(EXPDB + " のラベルを設定します");
524522
parted("name 13 " + EXPDB);
525-
notify(EXPDB + " のフラグを修正します");
523+
notify(EXPDB + " のフラグを修正します");
526524
parted("toggle 13 msftdata");
527525
callFunc(this::createFrp);
528526
}
@@ -535,13 +533,13 @@ private void fixExpdb() {
535533
* @since v2.0
536534
*/
537535
private void createFrp() {
538-
notify(FRP + " を 1MB で生成します");
536+
notify(FRP + " を 1MB で生成します");
539537
parted("mkpart " + FRP + " 133MB 134MB");
540-
notify(FRP + " のラベルを設定します");
538+
notify(FRP + " のラベルを設定します");
541539
parted("name 24 " + FRP);
542-
notify(FRP + " のフラグを修正します");
540+
notify(FRP + " のフラグを修正します");
543541
parted("toggle 24 msftdata");
544-
notify(PART24 + " を上書き修正します");
542+
notify(PART24 + " を上書き修正します");
545543
copyAssets(FRP);
546544
exec("dd if=" + FRP_COPY + " of=" + PART24); // 必ずフルパス
547545
callFunc(this::openSettings);
@@ -556,13 +554,12 @@ private void openSettings() {
556554
setEnvWithDcha(true);
557555
notify("すべての修正が完了しました!");
558556
TextView textView = findViewById(R.id.text_status);
559-
textView.setText("設定 または 開発者向けオプション を開きますか?");
557+
textView.setText("[設定] または [開発者向けオプション] を開きますか?");
560558
Button mainButton = findViewById(R.id.button_main);
561559
Button subButton = findViewById(R.id.button_sub);
562560
mainButton.setEnabled(true);
563561
mainButton.setText("開く");
564562
mainButton.setOnClickListener(v -> {
565-
setDchaStateCompleted();
566563
startActivity(new Intent(
567564
Settings.Secure.getInt(getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) == 1
568565
? Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS // 開発者向けオプションが解放されている場合は開く

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
34
android:layout_width="match_parent"
45
android:layout_height="match_parent"
56
android:orientation="vertical">
@@ -15,7 +16,9 @@
1516
android:id="@+id/text_console"
1617
android:layout_width="match_parent"
1718
android:layout_height="wrap_content"
18-
android:padding="16dp" />
19+
android:padding="16dp"
20+
android:text="\n**************************\n Welcome to Easy BLU :)\n Easy BLU へようこそ!\n**************************\n"
21+
android:textSize="24sp" />
1922
</ScrollView>
2023

2124
<LinearLayout
@@ -32,9 +35,14 @@
3235
android:id="@+id/text_status"
3336
android:layout_width="match_parent"
3437
android:layout_height="wrap_content"
38+
android:fallbackLineSpacing="false"
39+
android:lineHeight="32sp"
40+
android:paddingBottom="8dp"
41+
android:text="下のボタンを押して続行してください"
3542
android:textAppearance="?attr/textAppearanceBodyMedium"
3643
android:textColor="?attr/colorOnSurface"
37-
android:paddingBottom="8dp" />
44+
android:textSize="24sp"
45+
tools:targetApi="28" />
3846

3947
<LinearLayout
4048
android:layout_width="match_parent"
@@ -46,15 +54,21 @@
4654
style="?attr/materialButtonOutlinedStyle"
4755
android:layout_width="0dp"
4856
android:layout_height="wrap_content"
57+
android:layout_marginEnd="8dp"
4958
android:layout_weight="1"
50-
android:layout_marginEnd="8dp" />
59+
android:enabled="true"
60+
android:text="続行"
61+
android:textSize="24sp" />
5162

5263
<com.google.android.material.button.MaterialButton
5364
android:id="@+id/button_sub"
5465
style="?attr/materialButtonStyle"
5566
android:layout_width="0dp"
5667
android:layout_height="wrap_content"
57-
android:layout_weight="1" />
68+
android:layout_weight="1"
69+
android:enabled="true"
70+
android:text="終了"
71+
android:textSize="24sp"/>
5872

5973
</LinearLayout>
6074

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH="\\\"\\\""
118117

119118

120119
# Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@ fi
172171
# For Cygwin or MSYS, switch paths to Windows format before running java
173172
if "$cygwin" || "$msys" ; then
174173
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
175-
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
176174

177175
JAVACMD=$( cygpath --unix "$JAVACMD" )
178176

@@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
212210

213211
set -- \
214212
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215-
-classpath "$CLASSPATH" \
216213
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217214
"$@"
218215

gradlew.bat

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ goto fail
7070
:execute
7171
@rem Setup the command line
7272

73-
set CLASSPATH=
7473

7574

7675
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
76+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7877

7978
:end
8079
@rem End local scope for the variables with windows NT shell

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pluginManagement {
44
mavenCentral()
55
}
66
plugins {
7-
id 'com.android.application' version '8.12.1' apply false
7+
id 'com.android.application' version '8.13.1' apply false
88
}
99
}
1010

0 commit comments

Comments
 (0)