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

検索バーを削除できるように

チャットリスト内でのalbum、オープンチャットアイコンを削除するように
ringファイルの作成をresponseで作成するように
This commit is contained in:
areteruhiro 2025-02-03 18:26:40 +09:00
parent 5c59200f15
commit cb8acaeedd
8 changed files with 65 additions and 33 deletions

View File

@ -9,8 +9,8 @@ android {
defaultConfig {
minSdk 28
targetSdk 35
versionCode 11616
versionName "1.16.160"
versionCode 116160
versionName "1.16.17"
multiDexEnabled false
proguardFiles += 'proguard-rules.pro'
buildConfigField 'String', 'HOOK_TARGET_VERSION', '"141910383"'
@ -71,4 +71,4 @@ dependencies {
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
}
}

View File

@ -1,6 +1,7 @@
package io.github.hiro.lime;
public class LimeOptions {
public class Option {
public final String name;
public int id;
@ -23,6 +24,13 @@ public class LimeOptions {
public Option removeRecommendation = new Option("remove_recommendation", R.string.switch_remove_recommendation, true);
public Option removePremiumRecommendation = new Option("remove_premium_recommendation", R.string.switch_remove_premium_recommendation, true);
public Option removeServiceLabels = new Option("remove_service_labels", R.string.switch_remove_service_labels, false);
public Option removeSearchBar = new Option("removeSearchBar", R.string.removeSearchBar, true);
public Option removeNaviAlbum = new Option("removeNaviAlbum", R.string.removeNaviAlbum, true);
public Option removeNaviOpenchat = new Option("removeNaviOpenchat", R.string.removeNaviOpenchat, false);
public Option removeReplyMute = new Option("remove_reply_mute", R.string.switch_remove_reply_mute, true);
public Option redirectWebView = new Option("redirect_webview", R.string.switch_redirect_webview, true);
public Option openInBrowser = new Option("open_in_browser", R.string.switch_open_in_browser, false);
@ -71,6 +79,9 @@ public class LimeOptions {
removeAllServices,
removeServiceLabels,
RemoveNotification,
removeNaviOpenchat,
removeNaviAlbum,
removeSearchBar,
removeReplyMute,
redirectWebView,
openInBrowser,

View File

@ -3,6 +3,8 @@ package io.github.hiro.lime;
import android.content.res.XModuleResources;
import android.os.Environment;
import android.view.View;
import androidx.annotation.NonNull;
import de.robv.android.xposed.IXposedHookInitPackageResources;
import de.robv.android.xposed.IXposedHookLoadPackage;
@ -126,8 +128,21 @@ public class Main implements IXposedHookLoadPackage, IXposedHookInitPackageResou
}
});
}
// resparam.res.setReplacement(Constants.PACKAGE_NAME, "drawable", "navi_top_albums", xModuleResources.fwd(R.drawable.empty_drawable));
if (limeOptions.removeSearchBar.checked) {
resparam.res.hookLayout(Constants.PACKAGE_NAME, "layout", "main_tab_search_bar", new XC_LayoutInflated() {
@Override
public void handleLayoutInflated(XC_LayoutInflated.LayoutInflatedParam liparam) throws Throwable {
liparam.view.setVisibility(View.GONE);
}
});
}
if (limeOptions.removeNaviAlbum.checked) {
resparam.res.setReplacement(Constants.PACKAGE_NAME, "drawable", "navi_top_albums", xModuleResources.fwd(R.drawable.empty_drawable));
}
if (limeOptions.removeNaviOpenchat.checked) {
resparam.res.setReplacement(Constants.PACKAGE_NAME, "drawable", "navi_top_openchat", xModuleResources.fwd(R.drawable.empty_drawable));
}
if (limeOptions.RemoveVoiceRecord.checked) {
resparam.res.setReplacement(Constants.PACKAGE_NAME, "drawable", "chat_ui_input_ic_voice_normal", xModuleResources.fwd(R.drawable.empty_drawable));
resparam.res.setReplacement(Constants.PACKAGE_NAME, "drawable", "chat_ui_input_ic_voice_pressed", xModuleResources.fwd(R.drawable.empty_drawable));

View File

@ -71,6 +71,27 @@ public class RingTone implements IHook {
}
}
String resourceNameA = "dial_tone";
if (!ringtoneDir.exists()) {
ringtoneDir.mkdirs(); // ディレクトリが存在しない場合は作成
}
File destFileA = new File(ringtoneDir, resourceNameA + ".wav");
// リソースをストリームとして読み込みファイルに書き込む
if (!destFileA.exists()) {
try (InputStream in = moduleContext.getResources().openRawResource(resourceId);
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が初期化されているか確認
@ -94,8 +115,6 @@ public class RingTone implements IHook {
}
}
}
}
});
Class<?> targetClass = loadPackageParam.classLoader.loadClass("com.linecorp.andromeda.audio.AudioManager");
@ -144,33 +163,8 @@ public class RingTone implements IHook {
mediaPlayer = null; // MediaPlayerのインスタンスをnullに設定
}
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");
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を取得
Uri ringtoneUri = Uri.fromFile(destFileA); // コピーしたファイルのURIを取得
mediaPlayer = MediaPlayer.create(appContext, ringtoneUri);
mediaPlayer.setLooping(true); // 繰り返し再生を設定
@ -214,5 +208,8 @@ public class RingTone implements IHook {
}
}
});
}
});
}
}

View File

@ -152,6 +152,9 @@
<string name="canceled_message">取り消されたメッセージのトークを変更する</string>
<string name="canceled_message_txt">取り消しされたメッセージです</string>
<string name="hide_canceled_message">取り消されたメッセージのお知らせメッセージを非表示にする</string>
<string name="removeSearchBar">検索バーを削除する</string>
<string name="removeNaviOpenchat">チャットリスト内でのオープンチャットアイコンを削除する</string>
<string name="removeNaviAlbum">チャットリスト内でのアルバムアイコンを削除する</string>
</resources>

View File

@ -144,5 +144,8 @@
<string name="canceled_message">更改已取消訊息的通知對話</string>
<string name="canceled_message_txt">這是一條已取消的訊息</string>
<string name="hide_canceled_message">隱藏已取消訊息的訊息</string>
<string name="removeNaviOpenchat">刪除聊天清單中的開啟聊天圖標</string>
<string name="removeNaviAlbum">移除聊天清單中的相簿圖標</string>
<string name="removeSearchBar">刪除搜尋欄</string>
</resources>

View File

@ -3,6 +3,6 @@
<dimen name="main_bnb_button_height">106dp</dimen>
<dimen name="main_bnb_button_width">80dp</dimen>
<dimen name="gnav_icon_offset">21dp</dimen>
<dimen name="dummy">1dp</dimen>
<dimen name="dummy">10dp</dimen>
<dimen name="home_tab_v3_service_icon_size">45dp</dimen>
</resources>

View File

@ -158,4 +158,7 @@
<string name="canceled_message">Change notification talk for canceled messages</string>
<string name="canceled_message_txt">This is a canceled message</string>
<string name="hide_canceled_message">Hide notification talk for canceled messages</string>
<string name="removeSearchBar">Remove the search bar</string>
<string name="removeNaviOpenchat">Remove the open chat icon in the chat list</string>
<string name="removeNaviAlbum">Remove the album icon in the chat list</string>
</resources>