Skip to content

Commit

Permalink
Yay!
Browse files Browse the repository at this point in the history
  • Loading branch information
s1204IT committed Jan 4, 2025
1 parent 0b1eed4 commit 50a0ddb
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions app/src/main/java/com/saradabar/easyblu/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

import jp.co.benesse.dcha.dchaservice.IDchaService;

/** @noinspection ResultOfMethodCallIgnored*/
/**
* EasyBLU
* @author Kobold
* @noinspection ResultOfMethodCallIgnored
*/
public class MainActivity extends Activity {

private static final String BLOCK_DEVICE = "/dev/block/platform/bootdevice/";
Expand Down Expand Up @@ -87,8 +90,8 @@ protected void onCreate(Bundle savedInstanceState) {
* @author Kobold
* @since v1.0
*/
private void copyAssets(String file) {
File bin = new File(file.equals(FRP) ? Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) : getCacheDir(), file);
private void copyAssets(@NonNull String file) {
File bin = new File(file.equals(FRP) ? FRP_COPY : APP_PATH + file);
try {
InputStream inputStream = getAssets().open(file);
FileOutputStream fileOutputStream = new FileOutputStream(bin, false);
Expand All @@ -98,7 +101,8 @@ private void copyAssets(String file) {
if (!file.equals(FRP)) bin.setExecutable(true); // chmod +x bin を省略
fileOutputStream.close();
inputStream.close();
} catch (IOException ignored) {
} catch (Exception e) {
error(e);
}
}

Expand Down Expand Up @@ -267,8 +271,10 @@ private void init() {
* @since v3.0
*/
private void setup() { // retry() と同様
exec(APP_PATH + (CT3 ? MTK_SU : SHRINKER));
notify((CT3 ? MTK_SU : SHRINKER) + " を実行しました");
if (!CT3) {
exec(APP_PATH + SHRINKER);
notify(SHRINKER + " を実行しました");
}
if (exec(GETENFORCE).toString().contains(PERMISSIVE)) {
notify("SELinux ポリシーの強制を解除しました。");
notify(CT3 ? EXPDB + " のサイズを計算します。" : FRP + " の修正を試みます。");
Expand Down

0 comments on commit 50a0ddb

Please sign in to comment.