Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
統合準備
Browse files Browse the repository at this point in the history
  • Loading branch information
s1204IT committed Feb 28, 2024
1 parent 7e3e2cb commit fb3ee3d
Show file tree
Hide file tree
Showing 44 changed files with 373 additions and 1,046 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.apk binary
*.jar binary
*.png binary
*.jks
27 changes: 6 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ on:
- 'gradle/**'
- '*.gradle'
workflow_dispatch:
inputs:
release:
description: 'Release'
type: boolean
required: true
default: false

jobs:
build:
Expand Down Expand Up @@ -42,7 +36,11 @@ jobs:

- name: Build with Gradle
run: |
./gradlew aR --no-daemon
./gradlew :CT3:asD
./gradlew :CTX:asD
cp -f CT3/build/outputs/apk/debug/app-debug.apk app/src/main/assets/CT3.apk
cp -f CTX/build/outputs/apk/debug/app-debug.apk app/src/main/assets/CTX.apk
./gradlew :app:asD
{
echo "repo=$(echo ${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/})"
echo "version=v$(grep versionName app/build.gradle | awk '{print $2}' | tr -d \")"
Expand All @@ -53,17 +51,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ env.repo }}(${{ env.version }}@${{ env.commit }})
path: app/build/outputs/apk/release/app-release.apk

- name: Release
uses: softprops/action-gh-release@v1
if: github.event.inputs.release == 'true'
with:
tag_name: ${{ env.version }}
draft: true
prerelease: false
files: app/build/outputs/apk/release/app-release.apk

- name: Push APK
if: github.event.inputs.release == 'true'
run: curl -sT app/build/outputs/apk/release/app-release.apk -u ${{ secrets.FTP_USER }}:${{ secrets.FTP_PASSWORD }} ftp://${{ secrets.FTP_HOST }}${{ secrets.FTP_PATH }}
path: app/build/outputs/apk/debug/app-debug.apk
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# IntelliJ
/.idea/
# Gradle Build
/build/
/app/build/
/CT?/build/
# Android Studio Signing APK
/app/debug/
/app/release/
# jadx
/app/libs/*.jar.cache/
/CT?/release/
41 changes: 41 additions & 0 deletions CT3/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
plugins {
id 'com.android.application'
}

android {
namespace 'me.s1204.benesse.touch.support'
compileSdk 34

defaultConfig {
minSdk 24
//noinspection ExpiredTargetSdkVersion
targetSdk 22
versionCode 1
versionName "1.0.0"
proguardFiles += '../app/proguard-rules.pro'
}

signingConfigs {
android {
storeFile file('../app/android.jks')
storePassword 'android'
keyAlias 'android'
keyPassword 'android'
}
}

buildTypes {
debug {
signingConfig signingConfigs.android
minifyEnabled false
}
release {
minifyEnabled true
shrinkResources true
}
}
}

dependencies {
compileOnly files('../app/libs/BenesseExtension.jar')
}
39 changes: 39 additions & 0 deletions CT3/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission
android:name="android.permission.WRITE_SETTINGS"
tools:ignore="ProtectedPermissions" />

<application
android:icon="@drawable/ic_settings_development_alpha"
android:label="開発者向けオプション"
android:theme="@android:style/Theme.NoDisplay">

<activity
android:name=".DevelopmentOptions"
android:clearTaskOnLaunch="true"
android:excludeFromRecents="true"
android:exported="true"
android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".DchaStateChanger"
android:exported="true"
android:launchMode="singleInstance"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
</intent-filter>
</activity>

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package me.s1204.benesse.touch.support;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.BenesseExtension;
import android.os.Bundle;
import android.provider.Settings;

public class DchaStateChanger extends Activity {
private void setDchaState(int value) {
Settings.System.putInt(getContentResolver(), "dcha_state", value);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
finishAndRemoveTask();
if (Settings.System.canWrite(this)) {
if (BenesseExtension.getDchaState() == 3) {
setDchaState(0);
} else {
setDchaState(3);
}
} else {
startActivity(new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS, Uri.parse("package:" + getPackageName())).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package me.s1204.benesse.touch.support;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings;

public class DevelopmentOptions extends Activity {
private boolean getEnabled(String variable) throws Settings.SettingNotFoundException {
return Settings.Global.getInt(getContentResolver(), variable) == 1;
}
private void setDchaState(int value) {
Settings.System.putInt(getContentResolver(), "dcha_state", value);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent;
finishAndRemoveTask();
if (Settings.System.canWrite(this)) {
setDchaState(3);
intent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
try {
if (getEnabled(Settings.Global.ADB_ENABLED) && getEnabled(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED)) {
new Handler(Looper.getMainLooper()).postDelayed(() -> setDchaState(0), 1000);
}
} catch (Settings.SettingNotFoundException ignored) {
}
} else {
intent = new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS, Uri.parse("package:" + getPackageName())).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
startActivity(intent);
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions CTX/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
plugins {
id 'com.android.application'
}

android {
namespace 'me.s1204.benesse.touch.support'
compileSdk 34

defaultConfig {
minSdk 28
//noinspection ExpiredTargetSdkVersion
targetSdk 28
versionCode 1
versionName "1.0.0"
proguardFiles += '../app/proguard-rules.pro'
}

signingConfigs {
android {
storeFile file('../app/android.jks')
storePassword 'android'
keyAlias 'android'
keyPassword 'android'
}
}

buildTypes {
debug {
signingConfig signingConfigs.android
minifyEnabled false
}
release {
minifyEnabled true
shrinkResources true
}
}
}

dependencies {
compileOnly files('../app/libs/BenesseExtension.jar')
implementation files('../app/libs/DchaService.jar')
}
35 changes: 35 additions & 0 deletions CTX/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application
android:icon="@drawable/ic_settings_development_alpha"
android:label="開発者向けオプション"
android:theme="@android:style/Theme.NoDisplay">

<activity
android:name=".DevelopmentOptions"
android:clearTaskOnLaunch="true"
android:excludeFromRecents="true"
android:exported="true"
android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".DchaStateChanger"
android:exported="true"
android:launchMode="singleInstance"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
</intent-filter>
</activity>

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package me.s1204.benesse.touch.support;

import android.app.Activity;
import android.os.BenesseExtension;
import android.os.Bundle;

public class DchaStateChanger extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
finishAndRemoveTask();
if (BenesseExtension.getDchaState() == 3) {
BenesseExtension.setDchaState(0);
} else {
BenesseExtension.setDchaState(3);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package me.s1204.benesse.touch.support;

import android.app.Activity;
import android.content.Intent;
import android.os.BenesseExtension;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings;

public class DevelopmentOptions extends Activity {
private boolean getEnabled(String variable) throws Settings.SettingNotFoundException {
return Settings.Global.getInt(getContentResolver(), variable) == 1;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
BenesseExtension.setDchaState(3);
finishAndRemoveTask();
startActivity(new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS));
try {
if (getEnabled(Settings.Global.ADB_ENABLED) && getEnabled(Settings.Global.DEVELOPMENT_SETTINGS_ENABLED)) {
new Handler(Looper.getMainLooper()).postDelayed(() -> BenesseExtension.setDchaState(0), 1000);
}
} catch (Settings.SettingNotFoundException ignored) {
}
}
}
14 changes: 3 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ android {
//noinspection ExpiredTargetSdkVersion
targetSdk 22
versionCode 10
versionName "3.1.0"
versionName "4.0.0"
proguardFiles += 'proguard-rules.pro'
}

signingConfigs {
Expand All @@ -26,22 +27,13 @@ android {
buildTypes {
debug {
signingConfig signingConfigs.android
minifyEnabled true
shrinkResources true
proguardFiles += 'proguard-rules.pro'
minifyEnabled false
}
release {
signingConfig signingConfigs.android
minifyEnabled true
shrinkResources true
proguardFiles += 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

dependencies {
Expand Down
3 changes: 1 addition & 2 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
-keep class jp.co.benesse.dcha.dchaservice.IDchaService
-keep class jp.co.benesse.touch.setuplogin.**
-keep class jp.co.benesse.dcha.dchaservice.IDchaService
Loading

0 comments on commit fb3ee3d

Please sign in to comment.