Skip to content

Commit

Permalink
PixelPropsUtils: Set device model to Pixel 3 XL for Google
Browse files Browse the repository at this point in the history
Credits to @kdrag0n. Based on ProtonAOSP/android_frameworks_base@5078079

Signed-off-by: Anushek Prasal <anushekprasal@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
  • Loading branch information
SKULSHADY authored and neobuddy89 committed Mar 12, 2021
1 parent 5eb8ec3 commit 07e1652
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion core/java/com/android/internal/util/crdroid/PixelPropsUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ public class PixelPropsUtils {
private static final boolean DEBUG = false;

private static final Map<String, Object> propsToChange;
private static final Map<String, Object> propsToChangePixel3;

private static final String[] packagesToChange = {
"com.google.android.apps.safetyhub",
"com.google.android.apps.turbo",
"com.google.android.apps.wallpaper",
"com.google.android.apps.maps",
"com.google.android.gms",
"com.google.android.gms"
};

private static final String[] packagesToChangePixel3 = {
"com.google.android.googlequicksearchbox"
};

Expand All @@ -49,6 +53,8 @@ public class PixelPropsUtils {
propsToChange.put("PRODUCT", "redfin");
propsToChange.put("MODEL", "Pixel 5");
propsToChange.put("FINGERPRINT", "google/redfin/redfin:11/RQ2A.210305.007/7124944:user/release-keys");
propsToChangePixel3 = new HashMap<>();
propsToChangePixel3.put("MODEL", "Pixel 3 XL");
}

public static void setProps(String packageName) {
Expand All @@ -65,6 +71,16 @@ public static void setProps(String packageName) {
setPropValue(key, value);
}
}
if (Arrays.asList(packagesToChangePixel3).contains(packageName)) {
if (DEBUG) {
Log.d(TAG, "Defining props for: " + packageName);
}
for (Map.Entry<String, Object> prop : propsToChangePixel3.entrySet()) {
String key = prop.getKey();
Object value = prop.getValue();
setPropValue(key, value);
}
}
// Set proper indexing fingerprint
if (packageName.equals("com.google.android.settings.intelligence")) {
setPropValue("FINGERPRINT", Build.DATE);
Expand Down

0 comments on commit 07e1652

Please sign in to comment.