Blocking AI Features
blocking ai features in google messages is very hard because unlike other google apps that use some url/domain endpoint that can be blocked in hosts or something like that google messages gemini is just an rcs chat so if you block that you lose all rcs.
solution - All Ai features in google messages require a google account to be logged in (RCS does not have this requirement) so i modified services.jar to hide all Accounts from google messages. so you can still log in to google and any other app will see the logged in account except for google messages which never sees any accounts. simple the only tradeoff of doing this is you cant do device pairing using your google account but qr code still works
The Fix
The smali file is located at /smali/com/android/server/accounts/AccountManagerService.smali
the code changes were the same for both the qin and tiq but i dont know about other devices so you can use ai to figure it out. be careful when recompiling services.jar to make sure it is recompiled properly
Original Smali
.method private resolveAccountVisibility(Landroid/accounts/Account;Ljava/lang/String;Lcom/android/server/accounts/AccountManagerService$UserAccounts;)Ljava/lang/Integer;
.locals 7
.param p1, "account" # Landroid/accounts/Account;
.param p2, "packageName" # Ljava/lang/String;
.param p3, "accounts" # Lcom/android/server/accounts/AccountManagerService$UserAccounts;
.line 670
const-string/jumbo v0, "packageName cannot be null"
invoke-static {p2, v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
New Smali
.method private resolveAccountVisibility(Landroid/accounts/Account;Ljava/lang/String;Lcom/android/server/accounts/AccountManagerService$UserAccounts;)Ljava/lang/Integer;
.locals 7
.param p1, "account" # Landroid/accounts/Account;
.param p2, "packageName" # Ljava/lang/String;
.param p3, "accounts" # Lcom/android/server/accounts/AccountManagerService$UserAccounts;
const-string v0, "com.google.android.apps.messaging" # <-- ADD
invoke-virtual {v0, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z # <-- ADD
move-result v0 # <-- ADD
if-eqz v0, :kosher_orig # <-- ADD
const/4 v0, 0x3 # <-- ADD
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; # <-- ADD
move-result-object v0 # <-- ADD
return-object v0 # <-- ADD
:kosher_orig # <-- ADD
.line 670
const-string/jumbo v0, "packageName cannot be null"
invoke-static {p2, v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
QIN F21 PRO
QIN using root
adb push services-patched-qin.jar /sdcard
adb shell su -c mount -o rw,remount /
adb shell su -c mv /sdcard/services-patched-qin.jar /system/framework/services.jar
adb shell su -c chmod 644 /system/framework/services.jar
adb shell su -c chown root:root /system/framework/services.jar
adb shell su -c chcon u:object_r:system_file:s0 /system/framework/services.jar
adb reboot
QIn using twrp
adb shell twrp mount system
adb shell mount -o rw,remount /system_root
adb shell push services-patched-qin.jar /system/framework/services.jar
adb reboot
TIQ M5
(includes last app fix mentioned here Guide: ROM Modifications For TIQ M5 - #3 by dfrydman)
Tiq using root
adb push services-patched-tiq.jar /sdcard
adb shell su -c mount -o rw,remount /
adb shell su -c mv /sdcard/services-patched-tiq.jar /system/framework/services.jar
adb shell su -c chmod 644 /system/framework/services.jar
adb shell su -c chown root:root /system/framework/services.jar
adb shell su -c chcon u:object_r:system_file:s0 /system/framework/services.jar
adb reboot
QIn using twrp
adb shell twrp mount system
adb shell mount -o rw,remount /system_root
adb shell push services-patched-tiq.jar /system/framework/services.jar
adb reboot