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

Commit

Permalink
DchaService 関連のアクティビティを無効化
Browse files Browse the repository at this point in the history
Signed-off-by: Syuugo <pub@s1204.me>
  • Loading branch information
s1204IT authored Dec 4, 2023
1 parent ec4f18b commit 395e3f0
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.os.RemoteException;

import static android.app.admin.DevicePolicyManager.*;
import static android.content.pm.PackageManager.*;
import static android.os.Build.MODEL;

import jp.co.benesse.dcha.dchaservice.IDchaService;
Expand Down Expand Up @@ -66,14 +67,18 @@ public void onServiceConnected(ComponentName componentName, IBinder iBinder) {

// CTX/Z は内部にコピーしてからインストール
// CTZ は GMS もインストール
} else if (MODEL.equals("TAB-A05-BA1") {
} else if (MODEL.equals("TAB-A05-BA1")) {
// SDカードからローカルにAPKをコピー
mDchaService.copyFile(NOVA7_SD_PATH, NOVA_LOCAL_PATH);
// APKをインストール
mDchaService.installApp(NOVA_LOCAL_PATH, 2);
// コピーしたAPKを削除 : 機能していない
mDchaService.deleteFile(NOVA_LOCAL_PATH);

// DchaService のアクティビティを無効化
getPackageManager().setComponentEnabledSetting(new ComponentName(this, DchaCopyFile.class), COMPONENT_ENABLED_STATE_ENABLED, DONT_KILL_APP);
getPackageManager().setComponentEnabledSetting(new ComponentName(this, DchaInstallApp.class), COMPONENT_ENABLED_STATE_ENABLED, DONT_KILL_APP);
getPackageManager().setComponentEnabledSetting(new ComponentName(this, DevelopmentOptions.class), COMPONENT_ENABLED_STATE_ENABLED, DONT_KILL_APP);
// DchaState を 3 にする
mDchaService.setSetupStatus(3);
// Googleサービスフレームワーク
Expand Down

0 comments on commit 395e3f0

Please sign in to comment.