Skip to content

Instantly share code, notes, and snippets.

@chayanforyou
Last active June 30, 2026 03:33
Show Gist options
  • Select an option

  • Save chayanforyou/b70480f5e1ab79f0cba19c1d053eaf14 to your computer and use it in GitHub Desktop.

Select an option

Save chayanforyou/b70480f5e1ab79f0cba19c1d053eaf14 to your computer and use it in GitHub Desktop.
Spoof Emulator as a Physical Device (Magisk/KernelSU)

Step 1: Connect and Enter ADB Shell

Connect your phone to your PC with USB Debugging enabled. Open your computer's terminal (Command Prompt, PowerShell, or Mac/Linux Terminal) and type:

adb shell

Step 2: Request Root Access

Once inside the device shell, elevate your privileges to root:

su

(Look at your phone screen and tap Grant when your root manager asks for superuser permissions).

Step 3: Inject the Script

Copy the entire block of code below and paste it into your terminal, then press Enter. Be sure to edit the TARGET_ variables first if you want to spoof a device other than the Pixel 7 Pro.

echo '#!/system/bin/sh
# SET YOUR TARGET DEVICE INFO HERE:
TARGET_MANUFACTURER="Google"
TARGET_BRAND="google"
TARGET_MODEL="Pixel 7 Pro"
TARGET_DEVICE="cheetah"
TARGET_PRODUCT="cheetah"
TARGET_HARDWARE="cheetah"

# 1. MANUFACTURER
for prop in ro.product.manufacturer ro.product.system.manufacturer ro.product.vendor.manufacturer ro.product.product.manufacturer ro.product.odm.manufacturer; do
    resetprop $prop "$TARGET_MANUFACTURER"
done

# 2. BRAND
for prop in ro.product.brand ro.product.system.brand ro.product.vendor.brand ro.product.product.brand ro.product.odm.brand ro.boot.brand; do
    resetprop $prop "$TARGET_BRAND"
done

# 3. MODEL
for prop in ro.product.model ro.product.system.model ro.product.vendor.model ro.product.product.model ro.product.odm.model ro.product.name; do
    resetprop $prop "$TARGET_MODEL"
done

# 4. DEVICE
for prop in ro.product.device ro.product.system.device ro.product.vendor.device ro.product.product.device ro.product.odm.device; do
    resetprop $prop "$TARGET_DEVICE"
done

# 5. PRODUCT
for prop in ro.build.product ro.product.board; do
    resetprop $prop "$TARGET_PRODUCT"
done

# 6. HARDWARE
for prop in ro.hardware ro.boot.hardware; do
    resetprop $prop "$TARGET_HARDWARE"
done' > /data/adb/service.d/hardware_spoof.sh

Step 4: Make the Script Executable

Give the system permission to run the script you just created during the boot process:

chmod 755 /data/adb/service.d/hardware_spoof.sh

Step 5: Reboot

Restart your phone so the changes can take effect:

reboot

Step 6: Verify (Optional)

Once the phone boots back up, you can open adb shell again and check if it worked:

getprop ro.product.model
getprop ro.hardware

If it returns your new target device info, the script is running perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment