1
0
mirror of https://github.com/areteruhiro/LIME-beta-hiro.git synced 2025-02-10 23:41:38 +09:00

Compare commits

...

4 Commits

Author SHA1 Message Date
PenguinLucky
33021112df
Merge a4a28becc1 into e33e32a15d 2025-02-02 04:31:48 +09:00
PenguinLucky
a4a28becc1 Bugfix
一定の条件下で以下の2つのバグが発生していた。
- 着信時に呼出音のmp3が再生される
- 呼出音が再生されない

processToneEvent内で着信時なのか発信時なのか判断するように。
setTonePlayerを削除。(デバック済み)
2025-02-02 04:31:43 +09:00
PenguinLucky
5f72897c72 誤字修正 2025-02-02 04:27:11 +09:00
PenguinLucky
643e7ef4a5 Bugfix 2025-02-02 03:27:47 +09:00
2 changed files with 26 additions and 30 deletions

View File

@ -69,10 +69,6 @@ public class RingTone implements IHook {
});
}
if (!limeOptions.MuteCallTone.checked && !limeOptions.CustomDialTone.checked) {
return;
}
Class<?> targetClass = loadPackageParam.classLoader.loadClass("com.linecorp.andromeda.audio.AudioManager");
Method[] methods = targetClass.getDeclaredMethods();
@ -100,46 +96,46 @@ public class RingTone implements IHook {
if (method.getName().equals("processToneEvent")) {
Object arg0 = param.args[0];
if (limeOptions.CustomDialTone.checked) {
//Log.d("Xposed", "MuteDialTone is enabled. Suppressing tone event.");
String type = arg0.toString().contains("RING_BACK") ? "dialtone" : arg0.toString().contains("RING") && !arg0.toString().contains("RING_BACK") ? "calltone" : "";
if ((limeOptions.CustomDialTone.checked && type.equals("dialtone")) || (limeOptions.MuteCallTone.checked && type.equals("calltone"))) {
//Log.d("Xposed", "MuteTone is enabled. Suppressing tone event.");
param.setResult(null);
}
if (arg0.toString().contains("START")) {
if (appContext != null) {
// ringtone が初期化されており再生中の場合はスキップ
if (ringtone != null && ringtone.isPlaying()) {
//Log.d("Xposed", "Ringtone is already playing. Skipping playback.");
return; // 再生中の場合は何もしない
}
if (arg0.toString().contains("START") && ((limeOptions.CustomDialTone.checked && type.equals("dialtone")) || (limeOptions.DeviceCallTone.checked && type.equals("calltone")))) {
if (appContext != null) {
// ringtone が初期化されており再生中の場合はスキップ
if (ringtone != null && ringtone.isPlaying()) {
//Log.d("Xposed", "Ringtone is already playing. Skipping playback.");
return; // 再生中の場合は何もしない
}
Uri ringtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
if (arg0.toString().contains("RING_BACK")) {
Uri customRingtoneUri = Uri.parse("file://" + Environment.getExternalStorageDirectory().getPath() + "/Notifications/LIME_Dialtone.mp3");
Uri ringtoneUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
if (isFileExists(customRingtoneUri)) {
ringtoneUri = customRingtoneUri;
}
}
ringtone = RingtoneManager.getRingtone(appContext, ringtoneUri);
if (ringtone != null) {
//Log.d("Xposed", "Playing ringtone.");
ringtone.play();
isPlaying = true;
} else {
//Log.d("Xposed", "Ringtone is null. Cannot play ringtone.");
return;
}
if (ringtone != null) {
//Log.d("Xposed", "Playing ringtone.");
ringtone.play();
isPlaying = true;
} else {
//Log.d("Xposed", "appContext is null. Cannot play ringtone.");
//Log.d("Xposed", "Ringtone is null. Cannot play ringtone.");
return;
}
} else {
//Log.d("Xposed", "Argument is not 'START'. Actual value: " + arg0);
//Log.d("Xposed", "appContext is null. Cannot play ringtone.");
return;
}
} else {
//Log.d("Xposed", "Argument is not 'START'. Actual value: " + arg0);
}
}
if (limeOptions.MuteCallTone.checked) {
if (method.getName().equals("setTonePlayer")) {
param.setResult(null);
}
}
if (method.getName().equals("ACTIVATED") && param.args != null && param.args.length > 0) {

View File

@ -150,7 +150,7 @@
<string name="canceled_message">取り消されたメッセージのトークを変更する</string>
<string name="canceled_message_txt">取り消しされたメッセージです</string>
<string name="hide_canceled_message">取り消されたメッセージのお知らせメッセージを非表示にする</string>
<string name="DeviceCallTone">本体の信音を鳴らす(LsPach用)</string>
<string name="DeviceCallTone">本体の信音を鳴らす(LsPach用)</string>
</resources>