Skip to content

Commit

Permalink
update riru and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kingsman44 committed Oct 19, 2022
1 parent 1e703a4 commit 2c9be3e
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 14 deletions.
12 changes: 6 additions & 6 deletions module/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1517,12 +1517,12 @@ db_edit com.google.android.apps.wellbeing.device#com.google.android.apps.wellbei

# Google translate
$sqlite $gms "DELETE FROM FlagOverrides WHERE packageName='com.google.android.apps.translate'"
db_edit $gms com.google.android.apps.translate boolVal 1 "Widgets__enable_quick_actions_widget" "Widgets__enable_saved_history_widget"
db_edit com.google.android.apps.translate boolVal 1 "Widgets__enable_quick_actions_widget" "Widgets__enable_saved_history_widget"

# Google photos
$sqlite $gms "DELETE FROM FlagOverrides WHERE packageName='com.google.android.apps.photos'"
db_edit $gms com.google.android.apps.photos boolVal 1 "45353596" "45363145" "45357512" "45361445" "45357511" "45376295"
db_edit $gms com.google.android.apps.photos boolVal 0 "photos.backup.throttled_state"
db_edit com.google.android.apps.photos boolVal 1 "45353596" "45363145" "45357512" "45361445" "45357511" "45376295"
db_edit com.google.android.apps.photos boolVal 0 "photos.backup.throttled_state"

pref_patch 45353596 1 boolean $PHOTOS_PREF
pref_patch 45363145 1 boolean $PHOTOS_PREF
Expand All @@ -1537,16 +1537,16 @@ db_edit com.google.android.settings.intelligence boolVal 1 "RoutinesPrototype__e

# Google settings Services
$sqlite $gms "DELETE FROM FlagOverrides WHERE packageName='com.google.android.libraries.consentverifier#com.google.android.deskclock'"
db_edit com.google.android.libraries.consentverifier#com.google.android.deskclock boolVal 1 "CollectionBasisVerifierFeatures__enable_all_features"
db_edit "com.google.android.libraries.consentverifier#com.google.android.deskclock" boolVal 1 "CollectionBasisVerifierFeatures__enable_all_features"

# Fix Precise Location
$sqlite $gms "DELETE FROM FlagOverrides WHERE packageName='com.google.android.platform.privacy'"
db_edit $gms com.google.android.platform.privacy boolVal 1 "location_accuracy_enabled" "permissions_hub_enabled" "privacy_dashboard_7_day_toggle"
db_edit com.google.android.platform.privacy boolVal 1 "location_accuracy_enabled" "permissions_hub_enabled" "privacy_dashboard_7_day_toggle"
gms_edit_bool "com.google.android.platform.privacy" "location_accuracy_enabled" "permissions_hub_enabled" "privacy_dashboard_7_day_toggle"

# Live Wallpapers
$sqlite $gms "DELETE FROM FlagOverrides WHERE packageName='com.google.pixel.livewallpaper'"
db_edit $gms com.google.pixel.livewallpaper stringVal "" "DownloadableWallpaper__blocking_module_list"
db_edit com.google.pixel.livewallpaper stringVal "" "DownloadableWallpaper__blocking_module_list"

# Permissions for apps
for j in $MODPATH/system/*/priv-app/*/*.apk; do
Expand Down
3 changes: 3 additions & 0 deletions module/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,11 @@ db_edit() {
for i in $@; do
# echo "Patching $i to $val" >> $logfile
$sqlite $gms "DELETE FROM FlagOverrides WHERE packageName='$name' AND name='$i'"
sleep .001
$sqlite $gms "INSERT INTO FlagOverrides(packageName, user, name, flagType, $type, committed) VALUES('$name', '', '$i', 0, $val, 0)"
sleep .001
$sqlite $gms "UPDATE Flags SET $type='$val' WHERE packageName='$name' AND name='$i'"
sleep .05
# for j in $gacc; do
# $sqlite $gms "INSERT INTO FlagOverrides(packageName, user, name, flagType, $type, committed) VALUES('$name', '$j', '$i', 0, $val, 0)"
# done
Expand Down
2 changes: 1 addition & 1 deletion module/vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ PIXEL_SPOOF=0
TARGET_LOGGING=0

# Tensor
if [ "$(getprop ro.soc.model)" == "Tensor" ] || [ "$(getprop ro.soc.model)" == "GS201" ]; then
if [[ "$(getprop ro.soc.model)" == "Tensor" || "$(getprop ro.soc.model)" == "GS201" ]]; then
TENSOR=1
RIRU_LIB_PATH="$MODPATH/lib/riru_tensor"
ZYGISK_LIB_PATH="$MODPATH/lib/zygisk_tensor"
Expand Down
28 changes: 21 additions & 7 deletions riru/src/main/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@

#include <sys/system_properties.h>

static std::vector<std::string> PkgList = {"com.google", "com.android.chrome", "com.android.vending", "com.breel.wallpapers20","com.snapchat.android"};
static std::vector<std::string> PkgList = {"com.google", "com.android.chrome", "com.android.vending", "com.breel.wallpapers20", "com.snapchat.android", "ndroid.systemui"};
static std::vector<std::string> P5 = {"com.google.android.tts", "com.google.android.gms", "com.google.android.apps.wearables.maestro.companion"};
static std::vector<std::string> P1 = {"com.google.android.apps.photos"};
static std::vector<std::string> keep = {"com.google.android.GoogleCamera", "com.google.ar.core", "com.google.vr.apps.ornament", "com.google.android.youtube", "com.google.android.apps.motionsense.bridge", "com.google.android.systemui", "com.google.android.settings.intelligence", "com.google.android.xx"};
static std::vector<std::string> P6 = {"com.google.pixel.livewallpaper"};
static std::vector<std::string> keep = {"com.google.android.GoogleCamera", "com.google.ar.core", "com.google.vr.apps.ornament", "com.google.android.apps.motionsense.bridge", "com.google.android.xx"};

bool DEBUG = false;
char* OFP = new char [1024];
Expand Down Expand Up @@ -145,7 +146,14 @@ static void preSpecialize(const char *process, JNIEnv *env)
break;
}
}

for (auto &s : P6)
{
if (package_name.find(s) != std::string::npos)
{
type = 3;
break;
}
}
for (auto &s : keep)
{
if (package_name.find(s) != std::string::npos)
Expand All @@ -157,7 +165,7 @@ static void preSpecialize(const char *process, JNIEnv *env)

if (strcmp(process, "com.google.android.gms:unstable") == 0 || strcmp(process, "com.google.android.gms.unstable") == 0)
{
injectBuild(process, "", "", "google/marlin/marlin:7.1.2/NJH47F/4146041:user/release-keys","","", env);
//injectBuild(process, "", "", "google/marlin/marlin:7.1.2/NJH47F/4146041:user/release-keys","","", env);
type = 0;
}

Expand All @@ -167,7 +175,7 @@ static void preSpecialize(const char *process, JNIEnv *env)

if (type == 1)
{
injectBuild(process, "Pixel 6 Pro", "raven", "google/raven/raven:13/TP1A.220624.021/8877034:user/release-keys","google","Google", env);
injectBuild(process, "Pixel 7 Pro", "cheetah", "google/cheetah/cheetah:13/TD1A.220804.009.A2/8940162:user/release-keys","google","Google", env);
}
else if (type == 2)
{
Expand All @@ -176,8 +184,14 @@ static void preSpecialize(const char *process, JNIEnv *env)
else if (type == 3)
{
injectBuild(process, "Pixel XL", "marlin", "google/marlin/marlin:10/QP1A.191005.007.A3/5972272:user/release-keys","google","Google", env);
} else {
injectBuild(process, OMODEL, ODEVICE, "", OBRAND, OMANU, env);
}
else if (type == 4)
{
injectBuild(process, "Pixel 6 Pro", "raven", "google/raven/raven:13/TP1A.220624.021/8877034:user/release-keys","google","Google", env);
}
else
{
injectBuild(process, OMODEL, ODEVICE, OFP, OBRAND, OMANU, env);
}
}

Expand Down
14 changes: 14 additions & 0 deletions riru/src/main/cpp/tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
#include "nativehelper/scoped_utf_chars.h"
#include "android_filesystem_config.h"

char* OFP = new char [1024];
char* OMODEL = new char [1024];
char* ODEVICE = new char [1024];
char* OMANU = new char [1024];
char* OBRAND = new char [1024];

void injectBuild(const char *package_name, const char *model1, const char *product1, const char *finger1, JNIEnv *env)
{
if (env == nullptr)
Expand Down Expand Up @@ -94,10 +100,18 @@ void injectBuild(const char *package_name, const char *model1, const char *produ
static void preSpecialize(const char *process, JNIEnv *env)
{
std::string package_name = process;
__system_property_get("ro.build.fingerprint", OFP);
__system_property_get("ro.product.model", OMODEL);
__system_property_get("ro.product.device", ODEVICE);
__system_property_get("ro.product.manufacturer", OMANU);
__system_property_get("ro.build.brand", OBRAND);


if (package_name.find("com.google.android.apps.photos") != std::string::npos)
{
injectBuild(process, "Pixel XL", "marlin", "google/marlin/marlin:10/QP1A.191005.007.A3/5972272:user/release-keys", env);
} else {
injectBuild(process, OMODEL, ODEVICE, OFP, env);
}
}

Expand Down

0 comments on commit 2c9be3e

Please sign in to comment.