Skip to content

Commit

Permalink
v1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
s1204IT committed Dec 24, 2024
1 parent a5d7419 commit 391b22f
Show file tree
Hide file tree
Showing 21 changed files with 218 additions and 154 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4

- name: Set environments
run: |
Expand Down
26 changes: 19 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ plugins {

android {
namespace 'me.s1204.benesse.dcha.test'
compileSdk 34
compileSdk 35

defaultConfig {
minSdk 22
targetSdk 34
versionCode 7
versionName "1.3.1"
targetSdk 35
versionCode 8
versionName "1.3.2"
proguardFiles += 'proguard-rules.pro'
}

Expand All @@ -30,19 +30,31 @@ android {
}

buildTypes {
debug {
minifyEnabled false
configureEach {
signingConfig signingConfigs.android
}
release {
minifyEnabled true
shrinkResources true
signingConfig signingConfigs.android
if (file('release.jks').exists()) {
signingConfig signingConfigs.release
}
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}

buildFeatures {
buildConfig false
compose false
}

lintOptions {
ignore 'HardcodedText', 'InefficientWeight', 'Autofill', 'TextFields'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
Expand Down
Binary file modified app/libs/DchaService.jar
Binary file not shown.
180 changes: 107 additions & 73 deletions app/src/main/java/me/s1204/benesse/dcha/test/Tester.java

Large diffs are not rendered by default.

104 changes: 53 additions & 51 deletions app/src/main/java/me/s1204/benesse/dcha/test/UtilTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ public void onServiceDisconnected(ComponentName componentName) {
findViewById(R.id.btn_clearDefaultPreferredApp).setOnClickListener(view -> {
setContentView(R.layout.layout_cleardefaultpreferredapp);

// clearDefaultPreferredApp(pkgId)
// clearDefaultPreferredApp(packageName)
findViewById(R.id.exec).setOnClickListener(view1 -> {
EditText pkgBox = findViewById(R.id.clearDefaultPreferredApp_package);
String pkgId = pkgBox.getText().toString();
if (pkgId.isEmpty()) {
EditText packageNameBox = findViewById(R.id.clearDefaultPreferredApp_packageName);
String packageName = packageNameBox.getText().toString();
if (packageName.isEmpty()) {
Toast.makeText(getApplicationContext(), "パッケージIDを入力してください", Toast.LENGTH_SHORT).show();
return;
}
try {
mUtilService.clearDefaultPreferredApp(pkgId);
mUtilService.clearDefaultPreferredApp(packageName);
} catch (RemoteException ignored) {
}
});
Expand All @@ -74,22 +74,28 @@ public void onServiceDisconnected(ComponentName componentName) {
findViewById(R.id.btn_copyDirectory).setOnClickListener(view -> {
setContentView(R.layout.layout_copydirectory);

// copyDirectory(from, to)
// copyDirectory(srcDirPath, dstDirPath, makeTopDir)
findViewById(R.id.exec).setOnClickListener(view13 -> {
EditText fromBox = findViewById(R.id.copyDirectory_from);
EditText toBox = findViewById(R.id.copyDirectory_to);
EditText topBox = findViewById(R.id.copyDirectory_makeTopDir);
String fromPath = fromBox.getText().toString();
String toPath = toBox.getText().toString();
String makeTop = topBox.getText().toString();
if (makeTop.isEmpty()) {
makeTop = "false";
} else if (!makeTop.equals("true") && !makeTop.equals("false")) {
EditText srcDirPathBox = findViewById(R.id.copyDirectory_srcDirPath);
EditText dstDirPathBox = findViewById(R.id.copyDirectory_dstDirPath);
EditText makeTopDirBox = findViewById(R.id.copyDirectory_makeTopDir);
String srcDirPath = srcDirPathBox.getText().toString();
String dstDirPath = dstDirPathBox.getText().toString();
String makeTopDir = makeTopDirBox.getText().toString();
if (makeTopDir.isEmpty()) {
makeTopDir = "false";
/*
* true :フォルダ自体をコピー
* srcDir の最終ディレクトリ名で新しいフォルダを作成し、中身をコピー
* false:フォルダの中身のみコピー
* srcDir の中身をコピー
*/
} else if (!makeTopDir.equals("true") && !makeTopDir.equals("false")) {
Toast.makeText(getApplicationContext(), "真理値を正しく入力してください", Toast.LENGTH_LONG).show();
return;
}
try {
String result = String.valueOf(mUtilService.copyDirectory(fromPath, toPath, Boolean.parseBoolean(makeTop)));
String result = String.valueOf(mUtilService.copyDirectory(srcDirPath, dstDirPath, Boolean.parseBoolean(makeTopDir)));
Toast.makeText(getApplicationContext(), "実行結果:" + result, Toast.LENGTH_LONG).show();
} catch (RemoteException ignored) {
}
Expand All @@ -103,18 +109,18 @@ public void onServiceDisconnected(ComponentName componentName) {
findViewById(R.id.btn_copyFile).setOnClickListener(view -> {
setContentView(R.layout.layout_copyfile);

// copyFile(from, to)
// copyFile(srcFilePath, dstFilePath)
findViewById(R.id.exec).setOnClickListener(view15 -> {
EditText fromBox = findViewById(R.id.copyFile_from);
EditText toBox = findViewById(R.id.copyFile_to);
String fromPath = fromBox.getText().toString();
String toPath = toBox.getText().toString();
if (fromPath.endsWith("/") || toPath.endsWith("/")) {
EditText srcFilePathBox = findViewById(R.id.copyFile_srcFilePath);
EditText dstFilePathBox = findViewById(R.id.copyFile_dstFilePath);
String srcFilePath = srcFilePathBox.getText().toString();
String dstFilePath = dstFilePathBox.getText().toString();
if (srcFilePath.endsWith("/") || dstFilePath.endsWith("/")) {
Toast.makeText(getApplicationContext(), "ファイルを指定してください", Toast.LENGTH_SHORT).show();
return;
}
try {
String result = String.valueOf(mUtilService.copyFile(fromPath, toPath));
String result = String.valueOf(mUtilService.copyFile(srcFilePath, dstFilePath));
Toast.makeText(getApplicationContext(), "実行結果:" + result, Toast.LENGTH_LONG).show();
} catch (RemoteException ignored) {
}
Expand All @@ -131,12 +137,12 @@ public void onServiceDisconnected(ComponentName componentName) {
findViewById(R.id.btn_deleteFile).setOnClickListener(view -> {
setContentView(R.layout.layout_deletefile);

// deleteFile(file)
// deleteFile(path)
findViewById(R.id.exec).setOnClickListener(view17 -> {
EditText fileBox = findViewById(R.id.deleteFile_file);
String filePath = fileBox.getText().toString();
EditText pathBox = findViewById(R.id.deleteFile_path);
String path = pathBox.getText().toString();
try {
String result = String.valueOf(mUtilService.deleteFile(filePath));
String result = String.valueOf(mUtilService.deleteFile(path));
Toast.makeText(getApplicationContext(), "実行結果:" + result, Toast.LENGTH_LONG).show();
} catch (RemoteException ignored) {
}
Expand All @@ -150,12 +156,12 @@ public void onServiceDisconnected(ComponentName componentName) {
findViewById(R.id.btn_existsFile).setOnClickListener(view -> {
setContentView(R.layout.layout_existsfile);

// existsFile(file)
// existsFile(path)
findViewById(R.id.exec).setOnClickListener(view19 -> {
EditText fileBox = findViewById(R.id.existsFile_file);
String filePath = fileBox.getText().toString();
EditText pathBox = findViewById(R.id.existsFile_path);
String path = pathBox.getText().toString();
try {
String result = String.valueOf(mUtilService.existsFile(filePath));
String result = String.valueOf(mUtilService.existsFile(path));
Toast.makeText(getApplicationContext(), "実行結果:" + result, Toast.LENGTH_LONG).show();
} catch (RemoteException ignored) {
}
Expand All @@ -169,16 +175,12 @@ public void onServiceDisconnected(ComponentName componentName) {
findViewById(R.id.btn_getCanonicalExternalPath).setOnClickListener(view -> {
setContentView(R.layout.layout_getcanonicalexternalpath);

// getCanonicalExternalPath(path)
// getCanonicalExternalPath(linkPath)
findViewById(R.id.exec).setOnClickListener(view111 -> {
EditText fileBox = findViewById(R.id.getCanonicalExternalPath_path);
String filePath = fileBox.getText().toString();
if (filePath.isEmpty()) {
Toast.makeText(getApplicationContext(), "ファイルを指定してください", Toast.LENGTH_SHORT).show();
return;
}
EditText linkPathBox = findViewById(R.id.getCanonicalExternalPath_linkPath);
String linkPath = linkPathBox.getText().toString();
try {
String result = String.valueOf(mUtilService.getCanonicalExternalPath(filePath));
String result = String.valueOf(mUtilService.getCanonicalExternalPath(linkPath));
Toast.makeText(getApplicationContext(), "実行結果:" + result, Toast.LENGTH_LONG).show();
} catch (RemoteException ignored) {
}
Expand Down Expand Up @@ -264,18 +266,18 @@ public void onServiceDisconnected(ComponentName componentName) {
findViewById(R.id.btn_makeDir).setOnClickListener(view -> {
setContentView(R.layout.layout_makedir);

// makeDir(from, to)
// makeDir(path, dirname)
findViewById(R.id.exec).setOnClickListener(view118 -> {
EditText toBox = findViewById(R.id.makeDir_path);
EditText nameBox = findViewById(R.id.makeDir_name);
String toPath = toBox.getText().toString();
String name = nameBox.getText().toString();
if (name.startsWith("/") || name.endsWith("/")) {
EditText pathBox = findViewById(R.id.makeDir_path);
EditText dirnameBox = findViewById(R.id.makeDir_dirname);
String path = pathBox.getText().toString();
String dirname = dirnameBox.getText().toString();
if (dirname.startsWith("/") || dirname.endsWith("/")) {
Toast.makeText(getApplicationContext(), "正しい名前を指定してください", Toast.LENGTH_SHORT).show();
return;
}
try {
String result = String.valueOf(mUtilService.makeDir(toPath, name));
String result = String.valueOf(mUtilService.makeDir(path, dirname));
Toast.makeText(getApplicationContext(), "実行結果:" + result, Toast.LENGTH_LONG).show();
} catch (RemoteException ignored) {
}
Expand All @@ -298,16 +300,16 @@ public void onServiceDisconnected(ComponentName componentName) {
findViewById(R.id.btn_setDefaultPreferredHomeApp).setOnClickListener(view -> {
setContentView(R.layout.layout_setdefaultpreferredhomeapp);

// setDefaultPreferredHomeApp(pkgId)
// setDefaultPreferredHomeApp(packageName)
findViewById(R.id.exec).setOnClickListener(view120 -> {
EditText pkgBox = findViewById(R.id.setDefaultPreferredHomeApp_package);
String pkgId = pkgBox.getText().toString();
if (pkgId.isEmpty()) {
EditText packageNameBox = findViewById(R.id.setDefaultPreferredHomeApp_packageName);
String packageName = packageNameBox.getText().toString();
if (packageName.isEmpty()) {
Toast.makeText(getApplicationContext(), "パッケージIDを指定してください", Toast.LENGTH_LONG).show();
return;
}
try {
mUtilService.setDefaultPreferredHomeApp(pkgId);
mUtilService.setDefaultPreferredHomeApp(packageName);
} catch (RemoteException ignored) {
}
});
Expand Down
16 changes: 16 additions & 0 deletions app/src/main/res/layout/layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,22 @@
android:textSize="14sp" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="1dp">

<Button
android:id="@+id/btn_getCanonicalExternalPath"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:text="getCanonicalExternalPath"
android:textAllCaps="false"
android:textSize="14sp" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:textSize="26sp" />

<EditText
android:id="@+id/clearDefaultPreferredApp_package"
android:id="@+id/clearDefaultPreferredApp_packageName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/layout_copydirectory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
android:textSize="26sp" />

<EditText
android:id="@+id/copyDirectory_from"
android:id="@+id/copyDirectory_srcDirPath"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:hint="ディレクトリのコピー元フルパス" />

<EditText
android:id="@+id/copyDirectory_to"
android:id="@+id/copyDirectory_dstDirPath"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/layout_copyfile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
android:textSize="26sp" />

<EditText
android:id="@+id/copyFile_from"
android:id="@+id/copyFile_srcFilePath"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:hint="ファイルのコピー元パス" />

<EditText
android:id="@+id/copyFile_to"
android:id="@+id/copyFile_dstFilePath"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/layout_copyupdateimage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
android:textSize="26sp" />

<EditText
android:id="@+id/copyUpdateImage_from"
android:id="@+id/copyUpdateImage_srcFilePath"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:hint="ファイルのコピー元フルパス" />

<EditText
android:id="@+id/copyUpdateImage_to"
android:id="@+id/copyUpdateImage_dstFilePath"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/layout_deletefile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:textSize="26sp" />

<EditText
android:id="@+id/deleteFile_file"
android:id="@+id/deleteFile_path"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/layout_existsfile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:textSize="26sp" />

<EditText
android:id="@+id/existsFile_file"
android:id="@+id/existsFile_path"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:textSize="26sp" />

<EditText
android:id="@+id/getCanonicalExternalPath_path"
android:id="@+id/getCanonicalExternalPath_linkPath"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/layout_installapp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
android:hint="APKファイルのフルパス" />

<EditText
android:id="@+id/installApp_flag"
android:id="@+id/installApp_flags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:inputType="number"
android:hint="フラグ (未入力の場合は&quot;2&quot;)" />
android:hint="ダウングレードフラグ (未入力の場合は&quot;2&quot;)" />

<Button
android:id="@+id/exec"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/layout_makedir.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
android:hint="作成するディレクトリのパス" />

<EditText
android:id="@+id/makeDir_name"
android:id="@+id/makeDir_dirname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand Down
Loading

0 comments on commit 391b22f

Please sign in to comment.