Blogger Jateng

ADB And Fastboot Command Compilation By OmBob

SCRCPY 

This tools really good for mirrorin your phone
  • scrcpy -w -S
    Open mirror without wakeup the screen
  • scrcpy -m 1024
    To limit both width and height to some maximum value

Pull Images from phone

  • dd if=/dev/block/by-name/boot_a of=/sdcard/boot_a.img
  • dd if=/dev/block/by-name/boot_b of=/sdcard/boot_b.img
  • dd if=/dev/block/by-name/vbmeta_a of=/sdcard/vbmeta_a.img

Show Lsposed Menu on Android 10 Samsung

So you allready install lsposed modul it work. And you also already install modul but still lsposed menu doesn't show? This is the solution
  • Open terminal 
  • Gave root acces
  • run this command 
  • su -c am start-activity -a android.intent.action.MAIN -p com.android.shell -n com.android.shell/.BugreportWarningActivity -c org.lsposed.manager.LAUNCH_MANAGER
  • It will automaticle shown lsposed menu

LSposed Partially Activated

This is solution if you LSposed got error message LSposed partially activated: SEPolicy is not loaded properly



Solution 1 :

Lsposed is broken
  • Disabling the lsposed module from magisk
  • Rebooting
  • Enabling the lsposed module
  • Reboot

Solution 2 :

Conflict with some module
  • After turning off all modules 
  • turning on only LSPosed
  • reboot
  • Enable one by one module, check where the modul conlict

Dangerous Props (Rootbeer)

It is reported on some phone, either stock or custom ROM (Mi A1 LineageFE, etc). Show Dangerous Prop. This is the solution (you must have root acces)



  • adb root
  • adb remount
  • adb shell
  • mount -o rw,remount /
  • nano /system/build.prop
  • ro.secure=0 # should be 1
  • ro.debuggable=1 # should be 0
  • ro.build.type=userdebug" # should be "user"
additionally in order to pass the "test keys" check, one can replace the "test-keys" with "release-keys" on build.prop

Enable cam2api (Gcam)

You can run this command from adb or custom recovery (need root acces)
  • adb shell
  • su
  • setprop persist.camera.HAL3.enabled 1
  • setprop persist.vendor.camera.HAL3.enabled 1
  • setprop persist.camera.stats.test 5
  • setprop persist.vendor.camera.stats.test 5
  • setprop persist.camera.eis.enable 1

Disable cam2api (Gcam)

Sometime you need this, if you failed to do face verification on some apps like Grab Driver
  • adb shell
  • su
  • setprop persist.camera.HAL3.enabled 0
  • setprop persist.vendor.camera.HAL3.enabled 0

Speedup Windows

Run all command as administrator
To avoid "Functions.ps1 cannot be loaded because
running scripts is disabled on this system" run this command first  :
PowerShell -ExecutionPolicy Bypass

Disable driver signature cmd (windows 7/ 10/ 11) 

  • Full power off > go to BIOS> disable secure boot > save reboot
  • start > run > type cmd 
  • Right click > Run as administrator
  • bcdedit /set testsigning on
  • restart computer

Whitelist On Magisk Alpha 

This will make magisk alpha automatic block all root acces. Make sure to install shamiko module before.
  • adb shell
  • su
  • mkdir /data/adb/shamiko/whitelist



Magisk specific checks Root Detection

Sometime of occures when your doing repack and magisk forgot to clean up.

adb shell -> su -> rm -rf /data/magisk



Lock Bootloader From Fastboot

Make sure to there is NO modification on system, and you have flash the original boot.img!

  • fastboot oem lock ⏩ Xiaomi 
  • fastboot flashing lock ⏩  Trans/ Realme

Android_product_out Nt Set

If you find this error message when flashing stock recovery from fastboot, it means the installer bug with latest platform tools (example pixel 6 oriole). Solution is to use old version of platform tools (r33.0.3)

Make Android Partition Writetable

For example you want to replace services.jar from custom recovery
  • adb shell 
  • mount -o remount,rw /system_root
  • adb push .\services.jar /system_root/system/framework/
For other partition
  • mount -o remount,rw /
  • mount -o remount,rw /odm
  • mount -o remount,rw /product
  • mount -o remount,rw /system_ext
  • mount -o remount,rw /vendor

Install APK From Android Using Shell

Sometime it doesn't hook Into Lsposed, sop you have manually install using termux of terminal from MT manager. Enable test infrastructure to bypass most issues that would be encountered by app enumeration without changes.
  • copy apk to /data/local/tmp
  • rename to file into x.apk e.g
  • pm install -r -t --force-queryable x.apk
-r : Replace existing application.
-t  Allow test packages.

Downgrade APK Without Uninstall APK

pm install -d -i com.android.vending x.apk

Realme | Pull Image From Stock Recovery

Boot into stock recovery, then plug your device into computer, Type follow commands :

  • adb root
  • adb pull /dev/block/by-name/boot boot.img

For Dynamic Partition

adb pull /dev/block/by-name/boot_a boot1.img

It will save your boot image to current folder. SAME FOLLOWS FOR PULLING OTHER IMG FILES
JUST REPLACE boot.img to vbmeta.img or others

Nikel Remove & Restore Google System Framework

start with type adb shell

  • Search for package
    pm dump com.google.android.gsf | grep path
  • Remove Package
    pm uninstall -k --user 0 com.google.android.gsf
  • Reinstall package
    pm install -r --user 0 /system/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk

Install / get back uninstalled Apps (APKs) with ADB

get the path for that app

  • 1st method
    adb shell pm uninstall -k --user 0 com.android.updater
    adb shell cmd package install-existing com.android.updater
  • 2nd method
    adb shell
    pm dump com.android.updater | grep path
    pm install -r --user 0 /system/app/Updater/Updater.apk

Decrypt Manually

If multidisabler doesn't work try this method. 
  • Copy /vendor/etc/fstab.**** over to another folder. 
  • Edit it to remove the line containing the word "encryption"
  • Boot into twrp
  • Use twrp file manager to replace the fstab file with the edited one.
  • Format data (not just wipe)
  • Reboot to recovery 
  • Reboot to system 
  • Setup the phone completely 
  • Reboot to twrp
  • Backup boot data and super

Fix Magisk lag

Download magisklagfix.sh

use terminal emulator (android) or use terminal in pc (windows/linux)

  • su
  • mkdir -p /data/adb/service.d && cp /sdcard/magisklagfix.sh /data/adb/service.d/ && chmod +x /data/adb/service.d/magisklagfix.sh

tail message in Android

# adb shell cat /proc/kmsg

Force Permission On Android Go (Root)

Some phone using android go doesn't permission, features e.g  Galaxy a03 core, Redmi A1, A2. We can fix this using adb command. Complete manifest you can check here

Must have root access, you can also use termux : 
  • adb shell
  • su
command :  pm grant permission.(packagename aplikasi).SYSTEM_ALERT_WINDOW

  • Enable Floating Window
    pm grant com.grabtaxi.driver2 android.permission.SYSTEM_ALERT_WINDOW
  • Allow All the Time
    pm grant co.talenta android.permission.ACCESS_BACKGROUND_LOCATION

Fix DM Verity Corruption

fastboot oem cdms fix


Uninstall magisk modules without TWRP

You can use this command if you hav enable usb debugging before. Run the command from the bootloop status

adb wait-for-device shell magisk --remove-modules

Oppo Engginer Mode Code

*#899#

Disable Android Automatic Update

In some case even if you allready disable update, it still pop up update message. You can disable the notification from settings > Google Play Services > Notification Style > Scroll to the bottom > Other > System Update



  • Vivo
    adb shell pm disable-user --user 0 com.bbk.updater
  • Google pixel
    adb shell pm disable-user --user 0 com.android.dynsystem
  • Samsung
    adb shell pm disable-user --user 0 com.sec.android.soagent
  • Oppo & Realme
    adb shell pm disable-user --user 0 com.oppo.ota
  • pixelExperience
    adb shell pm uninstall -k –user 0 org.pixelexperience.ota

Remove Infinix Bloatware

  • adb shell pm uninstall -k --user 0 com.transsion.phonemaster
  • adb shell pm uninstall -k --user 0 com.transsion.plat.appupdate
  • adb shell pm uninstall -k --user 0 com.transsion.wifiplaytogether
  • adb shell pm uninstall -k --user 0 com.transsion.systemupdate

Realme & Oppo Disable Update & Secure Pay/ Check

  • adb shell pm uninstall -k --user 0 com.coloros.securepay
  • adb shell pm uninstall -k --user 0 com.oppo.otaui
  • adb shell pm disable-user --user 0 com.realme.securitycheck
  • adb shell pm disable-user --user 0 com.realme.securitycheck

If you want to reinstall the OTA service, just do :
adb shell cmd package install-existing com.oppo.ota cmd package install-existing com.oppo.otaui

Realme/ Oppo Remove Bloatware

  • adb shell pm uninstall -k --user 0 com.oppo.ota
  • adb shell pm uninstall -k --user 0 com.jakarta.baca.lite
  • adb shell pm uninstall -k --user 0 com.heytap.quickgame
  • adb shell pm uninstall -k --user 0 com.heytap.browser
  • adb shell pm uninstall -k --user 0 com.heytap.market
  • adb shell pm uninstall -k --user 0 com.heytap.mall

New Oppo

  • adb shell pm uninstall -k --user 0 com.redteamobile.roaming
  • adb shell pm uninstall -k --user 0 com.oplus.ota
  • adb shell pm uninstall -k --user 0 com.heytap.pictorial
  • adb shell pm uninstall -k --user 0 com.heytap.music
  • adb shell pm uninstall -k --user 0 com.coloros.musiclink (failed)
  • adb shell pm uninstall -k --user 0 com.nearme.gamecenter (failed)
  • adb shell pm uninstall -k --user 0 com.oplus.games
  • adb shell pm uninstall -k --user 0

Samsung

  • adb shell pm uninstall -k --user 0 com.samsung.android.securitylogagent
  • adb shell pm uninstall -k --user 0 com.sec.android.soagent
  • adb shell pm uninstall -k --user 0 com.wssyncmldm

Install apk from local but seen as from playstore

From PC you can use
  • adb install -i com.android.vending -r "Link2SD 4.3.1.apk"

Sideload xapk but seen as from playstore

extract apk on folder and this command from
adb install-multiple -i com.android.vending "AppName.apk" "ConfigA.apk" "ConfigB.apk"
  • GoPartner
    adb install-multiple -i com.android.vending .\com.gojek.partner.apk .\config.arm64_v8a.apk .\config.xxhdpi.apk
  • Grab Driver
    adb install-multiple -i com.android.vending .\com.grabtaxi.driver2.apk .\config.arm64_v8a.apk .\config.xxhdpi.apk
  • Shopee Food Driver
    adb install-multiple -i com.android.vending .\com.shopee.foody.driver.id.apk .\config.arm64_v8a.apk .\config.xxhdpi.apk
  • Spark Driver
    adb install-multiple -i com.android.vending .\com.walmart.sparkdriver.apk .\config.arm64_v8a.apk .\config.en.apk .\shopper.apk .\shopper.config.arm64_v8a.apk .\shopper.config.xxhdpi.apk .\config.xxhdpi.apk
From android you must have have root acces and then copy the APK first into data/local/tmp
  • su
  • pm install -i com.android.vending -r "Link2SD 4.3.1.apk"

Install apk from adb

adb install application.apk

Remove Google Bloatware

  • adb shell pm uninstall -k --user 0 com.google.android.apps.photos
  • adb shell pm uninstall -k –user 0 com.google.android.apps.tachyon
  • adb shell pm uninstall -k –user 0 com.google.android.apps.docs
  • adb shell pm uninstall -k –user 0 com.google.android.apps.subscriptions.red
  • adb shell pm uninstall -k –user 0 com.google.android.music
  • adb shell pm uninstall -k –user 0 com.google.android.videos
  • adb shell pm uninstall -k –user 0 com.google.android.feedback
  • adb shell pm uninstall -k –user 0 com.android.browser
  • adb shell pm uninstall -k --user 0 com.google.android.apps.nbu.files
  • adb shell pm uninstall -k --user 0 com.google.android.apps.chromecast.app
  • adb shell pm uninstall -k --user 0 com.google.android.keep

Remove Xiaomi Bloatware

  • adb shell pm pm uninstall -k –user 0 com.mi.android.globalminusscreen
  • adb shell pm pm uninstall -k --user 0 com.mi.globalbrowser
  • adb shell pm pm uninstall -k –user 0 com.miui.analytics
  • adb shell pm pm uninstall -k –user 0 com.miui.cleanmaster
  • adb shell pm pm uninstall -k –user 0 com.miui.compass
  • adb shell pm pm uninstall -k –user 0 com.miui.notes
  • adb shell pm pm uninstall -k –user 0 com.miui.player
  • adb shell pm pm uninstall -k –user 0 com.miui.weather2
  • adb shell pm pm uninstall -k –user 0

Hide apps

  • adb shell pm hide com.example.packagename
  • adb shell pm unhide com.example.packagename

Remove apps

adb uninstall com.android.calculator2 

List Package

  • adb shell
  • su 0
  • pm list packages

Copy File Using ADB

  • From android to external
    adb pull /sdcard/video.mp4 C:\Users\Jonathan\Desktop
  • From external to andropio
  • adb push C:\Users\Jonathan\Desktop\video.mp4 /sdcard/

Disable vbmeta

  • fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img

Download Mode Using ADB

  • Samsung adb reboot download
  • adb to download mode  (xiaomi eg. mi4c)
  • fastboot oem edl

  • adb reboot edl

Flash Modem

fastboot flash modem NON-HLOS.bin

Getting information about phone
fastboot getvar all

fastboot getvar product
fastboot -i 0x17ef oem device-info (lenovo)

adb command to fastboot
adb reboot bootloader

adb command to recovery
adb reboot recovery

unlock bootloader
fastboot oem unlock-go
fastboot -i 0x17ef oem unlock-go (lenovo)

check Bootloader Status
fastboot oem device-info

FLASH SYSTEM.IMG
fastboot flash system system.img

Flash Recovery
fastboot flash recovery images.img

Boot from images
fastboot boot twrp.img

Shutdown from ADB
adb shell reboot -p