1
0
mirror of https://github.com/areteruhiro/LIME-beta-hiro.git synced 2025-02-05 21:11:39 +09:00

コードの変更

This commit is contained in:
areteruhiro 2025-02-02 15:06:33 +09:00
parent fa71959486
commit b8c1ecec15

View File

@ -151,7 +151,7 @@ public class RingTone implements IHook {
if (method.getName().equals("processToneEvent")) {
Object arg0 = param.args[0];
if (limeOptions.DialTone.checked) {
Log.d("Xposed", "MuteTone is enabled. Suppressing tone event.");
//Log.d("Xposed", "MuteTone is enabled. Suppressing tone event.");
param.setResult(null);
return;
}
@ -160,14 +160,14 @@ public class RingTone implements IHook {
if (appContext != null) {
// MediaPlayerが初期化されており再生中の場合はスキップ
if (mediaPlayer != null && mediaPlayer.isPlaying()) {
Log.d("Xposed", "MediaPlayer is already playing. Skipping playback.");
//Log.d("Xposed", "MediaPlayer is already playing. Skipping playback.");
return; // 再生中の場合は何もしない
}
Context moduleContext = AndroidAppHelper.currentApplication().createPackageContext(
"io.github.hiro.lime", Context.CONTEXT_IGNORE_SECURITY);
String resourceNameA = "dial_tone";
int resourceId = moduleContext.getResources().getIdentifier(resourceNameA, "raw", "io.github.hiro.lime");
int resourceIdA = moduleContext.getResources().getIdentifier(resourceNameA, "raw", "io.github.hiro.lime");
File ringtoneDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "LimeBackup");
if (!ringtoneDir.exists()) {
@ -177,7 +177,7 @@ public class RingTone implements IHook {
// リソースをストリームとして読み込みファイルに書き込む
if (!destFile.exists()) {
try (InputStream in = moduleContext.getResources().openRawResource(resourceId);
try (InputStream in = moduleContext.getResources().openRawResource(resourceIdA);
OutputStream out = new FileOutputStream(destFile)) {
byte[] buffer = new byte[1024];
int length;