mirror of
https://github.com/areteruhiro/LIME-beta-hiro.git
synced 2025-02-05 21:11:39 +09:00
Compare commits
5 Commits
8e0d69bdfe
...
c1998dccf5
Author | SHA1 | Date | |
---|---|---|---|
|
c1998dccf5 | ||
|
7de0a8f540 | ||
|
e7dbb61369 | ||
|
3b4a85ae13 | ||
|
7381050469 |
@ -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"'
|
||||
|
@ -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 {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user