vendredi 22 juillet 2016

[Guide] Stock Miui (7/8): Official unlock, recovery, root, xposed, DPI & debloat

Please read this thread thoroughly and carefully. Do this at your own risk. The following had worked for two of the same devices. I've made this guide partly for my own notes and because other guides out there seemed incomplete.

Aim of this guide is to have an unlocked bootloader so that you can use Alka recovery to enable root, busybox and Xposed on stock Miui. Alka is a good recovery to use since it's already patched (boot.img) so that it can flash Miui recovery ROMs (OTA?) as well as CM based ROMs. It also has the ability to backup the entire phone (EFS partition). I would strongly suggest backing up all partitions and moving it to your computer or SD card after. You may choose Cofface TWRP if you're never going to try CM based ROMs. Helpful links from other guides will be posted at the end.

Debloating is a big thing that I do to stock ROMs. This essentially prevents the ROM from running the apps, slimming the ROM and hopefully extending daily usage. There are few things that broke though. The only thing I could care about is that I'm not able to change the wallpaper via the Settings (lockscreen + homescreen) anymore. The rest that broke are the features that I don't use such as Cleaner (sponsored by Cheetah), dual apps and etc. Debloat accordingly, be cautious as I won't be necessarily explaining what each item does.

Prep work
Sign up and login to all the neccessary accounts
  • Sign up for unlock: http://ift.tt/1YFJYbG, this will take 3-4 days.
  • Make sure you're also signed into your Mi account on your phone and that you can find your phone at http://i.mi.com/.
Prepare your computer for drivers and software
Enable Windows TESTSIGNING first: http://ift.tt/1uFmTvl

The TESTSIGNING boot configuration option is enabled or disabled through the BCDEdit command. To enable test-signing, use the following BCDEdit command:
Bcdedit.exe -set TESTSIGNING ON

To disable test-signing, use the following BCDEdit command:
Bcdedit.exe -set TESTSIGNING OFF
Restart your computer and then install the following: Prepare your device
  • Enable developer mode by going to Settings > About phone > Tap on MIUI Version repeatedly until you get a toast that Developer Mode is enabled
  • Go back to Settings and then tap on Additional Settings > Developer options
  • Enable Developer options
  • Enable OEM unlock
  • Enable USB debugging
  • Plugin your phone into your computer, it should now install all the drivers
  • Turn TESTSIGNING OFF and restart your computer
Signs of computer recoginizing your phone properly (for ADB, Fastboot and etc)
  • In Device Manager, you should see under Android Phone: Android Composite ADB Interface and Xiaomi Composite MDB Interface
  • You phone should have also asked you to allow debugging from your computer (check always allow)

Using MiFlash tool to flash another Miui ROM (China to Global, skip if you already like your Miui version)
  • Boot into fastboot by holding volume-down + power, you will get the fastboot bunny
  • Download your desired fastboot version: http://ift.tt/1Is9MPX, you can check the changelog and description from here: http://ift.tt/1YVugsV
  • Or you can use Miui 8 Global Beta: http://ift.tt/2aiBdmq
  • Extract the fastboot ROM (.tgz) twice, the first extract you'll be left with .tar file, the second should leave you with a directory of files
  • Place that directory in the root of your drive (or somewhere with a short location)
  • Launch the MiFlash tool, browse to your extracted fastboot ROM and click on refresh. You should now also see your device listed
  • Click on Flash All and click on refresh once more
  • Now flash your device, it should take upwards of 170s
Let your device boot, which should take 5m or longer. Set it up as you normally would and redo all the steps outlined in the "Prepare your device" section (don't need the TESTSIGNING part).

Flashing TWRP (Alka) & Root
Download the following files: You should now be working in an administrator command prompt in this directory: C:\Program Files (x86)\Xiaomi\MiPhone\Google\Android. Take this chance to extract fastboot-edl into this same directory. Also place twrp and alkarecoveryupdate img files into this directory. You should have the Universal Boot Img Patcher and SuperSU copied to your phone.

Follow these, don't reboot in between unless stated:
  • Enter fastboot (volume-down + power)
  • Type fastboot flash recovery twrp.img
  • Swipe to allow modifications
  • Flash universal boot img patcher zip
  • Flash twrp.img by selecting "Select Image" option.
  • Select recovery partition & flash it
  • Now reboot to recovery
  • Flash alkarecoveryupdate.img by selecting "Select Image" option.
  • Reboot to recovery
  • Flash SuperSU
  • Reboot system and let it boot Miui, it may take longer than usual
You should now test root, configure SuperSU & install Busybox.

Flashing Xposed
Download the latest SolarWarez Xposed: http://ift.tt/2a4zgct
Download Material Xposed Installer: http://ift.tt/28SAs4a
Download Xposed uninstaller, just in case: http://ift.tt/1BzIZk8

A few posts suggests that the latest official Xposed v86 works with Miui, but doesn't seem to be the case for me.
  • Install the Xposed Installer of your choice (apk install)
  • Enter recovery (volume-up + power)
  • Flash v86-sdk22-arm64 (LP, sdk23 is for MM)
  • Clear cache and dalvik
  • Reboot the phone, this should take 5m or longer since we wiped the cache
If you notice bootloops or crashing services, use the uninstaller. Worst case, flash it back to stock using MiFlash.

Xposed modules that I use:
  • App Settings
  • MIUI Brightness Fix
  • Mobile Radio Active Fix
  • Power Nap
  • Play Store Fixes
  • Spotify Skip
  • TextLinkify
  • WhatsApp Tuner
  • xMIUI
  • xInsta unfortunately does not work well.

Changing DPI
Using FX Explorer (Root access enabled) or any explorer you feel fit.
  • Go to system/ and edit build.prop
  • Add this line in between persist.hwc.downscale_threshold=1.15 & #ro.hdmi.enable=true
    ro.sf.ldc_density=370
  • Reboot your phone
You should be able to use a DPI changer such as texdrodier_dpi to change it to whatever you like after

ROM Debloating
Using FX Explorer (Root access enabled) or any explorer you feel fit.

Create the backup location:
  • Create a folder in system named _backup
  • Create subfolders named app, data-app, priv, vendor

Debloat app folder as you wish but here's my list:
  • Go to system/app
  • Cut the following into system/_backup/app
    AGPSTestMode
    AmapITS
    AnalyticsCore
    AntHalService
    BasicDreams
    BrowserProviderProxy
    BugReport
    CalendarLocalAccount
    CalendarWidget
    Drive
    Email
    FM
    Galaxy4
    GuardProvider
    HTMLViewer
    HiddTestApp
    HoloSpiralWallpaper
    KSICibaEngine
    KingSoftCleaner
    LatinImeGoogle
    LiveWallpapers
    LiveWallpapersPicker
    LunarInfoProvider
    MiDiscover
    MiLivetalk
    MiWallpaper
    NoiseField
    Notes
    OmaDownload
    OmaDrmEngineApp
    PartnerBookmarksProvider
    PhaseBeam
    PhotoTable
    QtiBackupAgent
    QtiFeedback
    SampleAuthenticatorService
    SapClientApp
    SecureSampleAuthService
    StaProxyService
    StepsProvider
    Stk
    SystemAdSolution
    TouchAssistant
    Videos
    WAPPushManager
    WfdClient
    fastdormancy
    imstests
    jjcontainer
    jjhome
    jjknowledge
    jjstore
  • Go to system/data-app
  • Cut the following into system/_backup/data-app
    Facebook
    klobugreport
  • Go to system/priv
  • Cut the following into system/_backup/priv
    AndroidForWork
    AutoTest
    BackupRestoreConfirmation
    Browser
    Calendar
    CleanMaster
    FM2
    GoogleBackupTransport
    GoogleFeedback
    SpacesManagerService
    SpacesTrustAgent
    Velvet
    cit
  • Go to system/vendor
  • Cut the following into system/_backup/vendor
    CTA
    ChinaMobile
    ChinaTelecom
    ChinaUnicom
    CmccPower
    MPCS
    app


from xda-developers http://ift.tt/2aiB96d
via IFTTT

Aucun commentaire:

Enregistrer un commentaire