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

Compare commits

...

5 Commits

Author SHA1 Message Date
areteruhiro
c1998dccf5 コードのリバース 2025-02-03 22:40:33 +09:00
areteruhiro
7de0a8f540 コードのリバース 2025-02-03 22:39:47 +09:00
areteruhiro
e7dbb61369 コードのリバース 2025-02-03 22:16:25 +09:00
areteruhiro
3b4a85ae13 バグの修正 2025-02-03 21:12:58 +09:00
areteruhiro
7381050469 バグの修正 2025-02-03 21:11:22 +09:00
2 changed files with 29 additions and 27 deletions

View File

@ -10,7 +10,7 @@ android {
minSdk 28
targetSdk 35
versionCode 116160
versionName "1.16.17a"
versionName "1.16.17c"
multiDexEnabled false
proguardFiles += 'proguard-rules.pro'
buildConfigField 'String', 'HOOK_TARGET_VERSION', '"141910383"'

View File

@ -71,28 +71,6 @@ public class RingTone implements IHook {
}
}
String resourceNameA = "dial_tone";
if (!ringtoneDir.exists()) {
ringtoneDir.mkdirs(); // ディレクトリが存在しない場合は作成
}
File destFileA = new File(ringtoneDir, resourceNameA + ".wav");
int resourceIdA = moduleContext.getResources().getIdentifier(resourceName, "raw", "io.github.hiro.lime");
// リソースをストリームとして読み込みファイルに書き込む
if (!destFileA.exists()) {
try (InputStream in = moduleContext.getResources().openRawResource(resourceIdA);
OutputStream out = new FileOutputStream(destFileA)) {
byte[] buffer = new byte[1024];
int length;
while ((length = in.read(buffer)) > 0) {
out.write(buffer, 0, length);
}
} catch (IOException e) {
e.printStackTrace();
}
}
if (paramValue.contains("type:NOTIFIED_RECEIVED_CALL,")) {
if (context != null) {
// MediaPlayerが初期化されているか確認
@ -116,6 +94,8 @@ public class RingTone implements IHook {
}
}
}
}
});
Class<?> targetClass = loadPackageParam.classLoader.loadClass("com.linecorp.andromeda.audio.AudioManager");
@ -164,8 +144,33 @@ public class RingTone implements IHook {
mediaPlayer = null; // MediaPlayerのインスタンスをnullに設定
}
Context moduleContext = AndroidAppHelper.currentApplication().createPackageContext(
"io.github.hiro.lime", Context.CONTEXT_IGNORE_SECURITY);
Uri ringtoneUri = Uri.fromFile(destFileA); // コピーしたファイルのURIを取得
String resourceNameA = "dial_tone";
int resourceId = moduleContext.getResources().getIdentifier(resourceNameA, "raw", "io.github.hiro.lime");
File ringtoneDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "LimeBackup");
if (!ringtoneDir.exists()) {
ringtoneDir.mkdirs(); // ディレクトリが存在しない場合は作成
}
File destFile = new File(ringtoneDir, resourceNameA + ".wav");
// リソースをストリームとして読み込みファイルに書き込む
if (!destFile.exists()) {
try (InputStream in = moduleContext.getResources().openRawResource(resourceId);
OutputStream out = new FileOutputStream(destFile)) {
byte[] buffer = new byte[1024];
int length;
while ((length = in.read(buffer)) > 0) {
out.write(buffer, 0, length);
}
} catch (IOException e) {
e.printStackTrace();
}
}
Uri ringtoneUri = Uri.fromFile(destFile); // コピーしたファイルのURIを取得
mediaPlayer = MediaPlayer.create(appContext, ringtoneUri);
mediaPlayer.setLooping(true); // 繰り返し再生を設定
@ -209,8 +214,5 @@ public class RingTone implements IHook {
}
}
});
}
});
}
}