Platinum Member

Rank: 4

Credits
4180
Device
Redmi 3
Online time
90 Hours
Send PM

MIUI 8

[Tools, Tips & Tutorials] [MIUI DEVICE TEAM] A script to disable dm-verity and forced encryption

  [ Promote]
108621 340 |
15:09, Jul-16-2016 | From PC
|
|
Go to reply no.
This post was edited by Anik1199 at 13:08, Jul-16-2016

Hi Everyone,

We all know about dm-verity and forced encryption? If we don't lets know about it. I will try to explain what dm-verity and forced encyption is. Also i will explain what they do on our device. As well as i will provide a flashable zip to disable both dm-verity and forced encryption.

What is dm-verity?

Android 4.4 and later supports verified boot through the optional device-mapper-verity (dm-verity) kernel feature, which provides transparent integrity checking of block devices. dm-verity helps prevent persistent rootkits that can hold onto root privileges and compromise devices. This experimental feature helps Android users be sure when booting a device it is in the same state as when it was last used.

Clever malware with root privileges can hide from detection programs and otherwise mask themselves. The rooting software can do this because it is often more privileged than the detectors, enabling the software to "lie" to the detection programs.

The dm-verity feature lets you look at a block device, the underlying storage layer of the file system, and determine if it matches its expected configuration. It does this using a cryptographic hash tree. For every block (typically 4k), there is a SHA256 hash.
Since the hash values are stored in a tree of pages, only the top-level "root" hash must be trusted to verify the rest of the tree. The ability to modify any of the blocks would be equivalent to breaking the cryptographic hash.

If dm-verity enabled on your device then simply you can't modify your system partition. If you do then you will face bootloop. On ramdisk's fstab.qcom there is a "verify" check along with system partition. So  if you remove verify from ramdisk then you can bypass dm-verity. Here LazyFlasher script does the job. Its removes the "verify" check from ramdisk while you flash the script.

What is forced encryption?

Forced-encryption on Android is implemented through the kernel, which triggers the encryption process on your complete /data partition, on the first boot.

The idea of forced-encryption hooked up a lot of users, seeing this as a one-more-added step towards security. But when it came to the custom users, like you and me, who like to customize their device (A LOT!), it is not so much useful. In contrary, it creates a barricade, preventing any kind of modifications.

In order to successfully disable forced-encryption and decrypt your phone, you will first need a modified boot.img, that has dm-verity check disabled. By flashing this boot.img (kernel), you will ensure that your storage doesn’t get encrypted all-the-way, during the first boot. Also, it is a pretty high chance that you have your storage encrypted now, so flashing the modified boot alone won’t decrypt your device (Think logically, it just disables FE on first boot, either after you bought the device, or did a factory reset).
In order to decrypt, you will need to format the entire userdata partition on your phone, so that the encryption wears-off instantly.

Here also LazyFlasher script comes handy. It simply disables forced encryption. But still you can encrypt you device manually.

How to flash the script?

Flash the script via TWRP or any recovery just like other zip.

Download the script?

lazyflasher-no-verity-opt-encrypt.zip (420.95 KB, Downloads: 32601)
Favorite145 Share

Rated by 57 people   Experience Prestige Reason  

m00nlinari + 2 Thanks!
Jyjyc + 2 Thanks!
KoKyE21 + 4 Thanks!
archi.05 + 1 Fantastic!
sausanti123 + 1 <font style="vertical-align: inh
Justframe12 + 1 Great!
Kostyanoss409 + 1 Awesome!
samuelb01 + 1 Awesome!
Max.Lamano@yaho + 1 Спасибо!
iuryeloy2015 + 1 Thanks!
48656c6c6f + 2 Awesome!
bd07111984 + 1 Great!
HarryAwanda + 1 Great!
denemo + 5 Awesome!
xiaumibitor + 1 Great!
McCurly + 1 Thanks!
halenair + 1 Thanks!
mzaid007 + 1 Fantastic!
EgorViss + 1 Thanks!
tuliocll + 1 Thanks!
skmaiti2050 + 1 Fantastic!
maximkaart + 1 Спасибо!
toribiodelgado + 1 Thanks!
Kishor21 + 1 Great!
third.meijin + 1 Great!
Yurik3069 + 1 Great!
EnigmAnurag + 2 Awesome!

Experience +138  Prestige +17  View Rating Log

Life is beautiful

Senior Member

Rank: 2

Credits
32
Device
Others
Online time
1 Hours
Send PM
03:58, Sep-10-2017 | From PC
|
Just a reminder that this is an outdated version, and while it appears to still be working fine for you guys, you can find the latest official version of no-verity-opt-encrypt at https://build.nethunter.com/android-tools/no-verity-opt-encrypt/ (currently 5.1, the OP has version 1.5 in the attachment!)
For most devices it's the exact same, but the newer version adds support for many different devices and architectures outside standard Android image format.

Rated by 4 people   Experience Reason  

m00nlinari + 1 Thanks!
Toonzever + 2 Great!
未末o + 1 Awesome!
McCurly + 1 Agreed!

Experience +5  View Rating Log

Kali Linux NetHunter, LazyFlasher/no-verity-opt-encrypt, & TWRP developer

Senior Member

Rank: 2

Credits
179
Device
Redmi 3
Online time
39 Hours
Send PM

Mi BandRedmi Note 3Redmi 3MIUI 300 WeeksMIUI Forum AppI Love Mi BunnyGamer Mi BunnyMIUI Medals CollectorDie-hard MIUI Fan

04:42, Jul-18-2016 | From PC
|
Hi thanks for the share.

My Redmi3 Pro has its bootloader unlocked and I running latest Dev ROM (6.7.14) with the native root option activated(phone passes rootchecker test).

I am having trouble installing Adaway hosts so I need to install SuperSU to give the appropriate rights to Adaway.

I managed to flash TWRP via Flashify and boot into it but when I installed SuperSU 2.71 via TWRP my phone got stuck in a bootloop (just showing the Mi logo and restarting when you press the power button).

I managed to bring it back to life via Miflash and Fastboot.

So after all this my question is:

Is DM-Verity responsible for this?

Platinum Member

Rank: 4

Credits
3243
Device
Mi 3
Online time
69 Hours
Send PM

Mi  BunnyMi HomeMi Bluetooth SpeakerYeelight Bedside LampFantastic!MIUI 8Awesome!MIUI 2016I Love MIUIMIUI 7Mi 3Mi TVRedmi 1S1500K Forum MembersMIUI Fan from MalaysiaMIUI 300 WeeksMIUI 6th AnniversaryMIUI Fan from IndiaPokemon Master MedalMIUI Fan From VietnamHilal Ramadan Fan Of MIUI IndiaMIUI Fan From Brazil1400K Forum MembersUEFA EURO MedalGamer Mi BunnyMIUI Beta TeamScroll Of WisdomYouth PledgeDebate MasterMi Lover MedalMIUI FollowerTechnology GuruDie-hard MIUI FanMi Story TellerRingtone Star MIUI FB Follower

15:40, Jul-16-2016 | From PC
|
great knowledge...thanks for the share..

Super moderator

Rank: 8Rank: 8

Credits
133398
Device
Mi 8
Online time
7586 Hours
Send PM

Mi HomeMi BandMi VRMagic CubeMi HeadphonesMi Power Bank 10000MAH Mi KeyMi  BunnyNinebot MiniMi T-ShirtMi Power BankMi Power StripXiaomi 7th AnniversaryMIUI 6Awesome!I Love MIUIFantastic!MIUI 8MIUI 2015MIUI Devices ContestFlashholicMIUI 2016MIUI 7Xiaomi Mi 4Redmi 1SMi 3Mi 4i4 Million Forum MembersRedmi Note 3Redmi 2I Love 2016Fan Of MIUI IndiaRooster Year of 2017Rocket to Future3 Million Forum App InstallsMIUI 20172100K Forum Members1900K Forum MembersHilal Ramadan MIUI 6th AnniversaryMIUI Forum AppMIUI 300 WeeksMIUI World Tour1 Million Forum App InstallsMerry Christmas700K Forum MembersMIUI 5th Anniversary800K Forum Members1 Million Forum Members1500K Forum MembersXiaomi 5th Anniversary500K Forum MembersThanksgiving DayMid-Autumn FestivalHappy Valentine's DayHappy New YearMIUI 100 Million UsersMIUI Fan from IndiaMIUI Fan From BrazilSuper Friday5 Million Forum App InstallsHappy Holi MedalMIUI Happy Medal5 Million Forum PostsSuper Wednesday10 Million Forum PostsSuper SaturdaySuper SundayMIUI 9MIUI 7th AnniversaryMIUI Lucky FridaySuper Tuesday3500K Forum MembersSuper ThursdayRingolicious MedalWomen's Day Medal3 Million Forum Members1300K Forum MembersMiPopI Love Mi BunnyAlpaca Mi Bunny Gamer Mi BunnyMIUI Device TeamMIUI KingXiaomi 8th AnniversaryRingtone ExpertMost Popular Forum UserMIUI Android 4.4 KitKatTechnology GuruMIUI 8th AnniversaryGold Super ModeratorDiamond Super Moderator13 Million Forum MembersHappy 2019MIUI Halloween 2018Discuss HereMIUI Weekly Devices QuizDual CameraMIUI 10SurpriseMost Active MIUIer2017 Annual AwardsSuper ModeratorPioneer of MIUI English Forum Mi Lover MedalMi TalentStar Of TechnologyMaster Of TechnologyMr. DependableMIUI FollowerMIUI Medals CollectorMi Bunny Game Master OTA FeedbackDie-hard MIUI FanUpdates LoverMIUI Twitter FollowerMIUI FB FollowerAndroid ElfScroll Of WisdomForum Contest LoverDebate MasterAndroid GuruMIUI Device ExpertHumor Master

15:16, Jul-16-2016 | From PC
|
Nice, Informative.

Rated by 1 person   Experience Prestige Reason  

Anik1199 + 10 + 3 Thanks!

Experience +10  Prestige +3  View Rating Log

Super moderator

JUST DO IT!

Rank: 8Rank: 8

Credits
244280
Device
Mi 9
Online time
4763 Hours
Send PM

Mi Band 2Xiaomi 6 LaunchMi Notebook AirMijia Electric ScooterMi Power Bank 10000MAH Unlock MedalMi HeadphonesMijia VR Play 2Yeelight Bedside LampMi Yi CameraMi HomeMi Bluetooth Canon SpeakerMijia Story TellerMijia Mi Bunny RobotMi Selfie StickMi KeyMagic CubeMi VR HeadsetMi BandMi Plastic In-ear PhonesMi TV 70Mi MIXMi Power StripMi  BunnyMi Bluetooth SpeakerMi T-ShirtMijia Qi CycleMijia Smart PTZ CameraMi Power BankMi Bluetooth HeadsetMi WiFi Router MiniNinebot MiniMi Kids WatchMijia Walkie TalkieXiaomi 7th AnniversaryAwesome!I Love MIUIMIUI Devices ContestMIUI 2016MIUI 8AnTuTuMarshmallowFantastic!FlashholicMIUI 7MIUI 2015Redmi Note 2Redmi Note 4XMi MIXMi 3Mi Max Redmi 3Mi 4cMi TVRedmi 1SRedmi Note 4Redmi NoteMi 5s PlusRedmi Note 3Redmi 3SRedmi 4/Prime/4ARedmi 4X4 Million Forum MembersMIUI 6th AnniversaryMIUI Fan From PhilippinesOlympics Medal3500K Forum MembersSingapore BirthdayHilal Ramadan MIUI Fan from IndiaMIUI Fan from MalaysiaPokemon Master MedalFan Of MIUI India300K Forum MembersMIUI Fan From NepalMi Live MedalMIUI Forum App1700K Forum Members1500K Forum MembersMid-Autumn Festival1 Million Forum MembersRingolicious MedalMalaysia AnniversaryMIUI 300 Weeks900K Forum MembersSuper FridayMIUI 20 Million UsersMIUI 7th AnniversaryXiaomi 6th AnniversaryFan of MIUI MyanmarMerry ChristmasAtaturk MourningHappy New YearMIUI PCamera Filter Guru MedalMIUI 9Diwali Xiaomi 5th AnniversaryMIUI Fan From SingaporeMIUI Fan From Myanmar1400K Forum MembersUEFA EURO MedalFan Of MIUI GreeceThanksgiving DayMIUI Fan From Indonesia100k Forum MembersMIUI Fan from Turkey90000 Forum Members3 Million Forum MembersRocket to FutureRooster Year of 20171 Million Forum App InstallsSuper ThursdayMIUI Marathon Medal5 Million Forum App InstallsMIUI Happy Medal2100K Forum MembersI Love 2016MIUI 201710 Million Forum PostsPuzzle MasterSuper MondaySingapore Merlion MedalSuper TuesdayWomen's Day MedalSuper WednesdayMIUI Drawing TalentSurge S1Happy Valentine's DayMIUI Weekly PollFan Of MIUI BangladeshMIUI Font Lover1800K Forum MembersMIUI World Tour1900K Forum MembersFan Of MIUI SpainSuper SaturdayMIUI Lucky FridayFan Of MIUI RussiaHappy Singles' DayHappy DiwaliFan Of MIUI PolandFan Of MIUI ItalySuper SundayHappy Holi MedalGamer Mi BunnyI Love Mi BunnySummer Mi BunnyAlpaca Mi Bunny MiPopMIUI Device TeamOreoMIUI Weekly Devices Quiz8 Million Forum MembersGold Super ModeratorMIUI Follower2017 Annual Awards7 Million Forum MembersDebate MasterMIUI Quick DiscussionStar WarsDiscuss HereYouth PledgeApp StarSurpriseForum Contest LoverMi A1Ringtone Star Xiaomi 8th AnniversaryInbox ZeroNougatMi TalentHumor MasterMIUI Halloween 2017Android GuruMIUI Device ExpertMIUI Medals CollectorApp MasterStar Of TechnologyMIUI SuperstarMost Popular Forum UserUpdates LoverJuly 19 MyanmarMi Story TellerRedmi Note 5/ProWallpaper StarApp TalentMIUI Ice Bucket ChallengeScroll Of WisdomMIUI ExpertMIUI KingMaster Of TechnologySuper ModeratorApp TalentMIUI Android 4.4 KitKatMi Lover MedalMi Bunny Game Master Wallpaper ExpertPioneer of MIUI English Forum 25 Million StrongDie-hard MIUI FanOTA FeedbackIndonesia Independence DayAndroid ElfMIUI FB FollowerTechnology GuruMIUI G+ FollowerTheme TalentMIUI Photography GuruRedmi Quiz MasterMr. DependableMIUI Twitter FollowerMost Active MIUIer

15:42, Jul-16-2016 | From PC
|
Resourceful and good inform for the users. Good work @Anik1199  

Rated by 1 person   Experience Prestige Reason  

Anik1199 + 10 + 3 Thanks!

Experience +10  Prestige +3  View Rating Log

Elite Member

Rank: 6Rank: 6

Credits
13334
Device
Redmi Note 4 Qualcomm
Online time
285 Hours
Send PM

Mijia VR Play 2Mi  BunnyYeelight Bedside LampMi Power BankMi BandMi Yi CameraMi Selfie StickMi VR HeadsetMi WiFi Router MiniMi HomeMijia Story TellerMi Power Bank 10000MAH Mi Bluetooth Canon SpeakerUnlock MedalMi Band 2Mi Power StripMi HeadphonesXiaomi 7th AnniversaryMIUI Devices ContestMarshmallowMIUI 8Awesome!MIUI 2016MIUI 7I Love MIUIFantastic!Redmi 2Mi 4cRedmi 3Mid-Autumn FestivalOlympics Medal1700K Forum MembersMIUI 6th Anniversary2 Million Forum MembersMIUI SFan Of MIUI Bangladesh1400K Forum MembersHappy Valentine's Day1500K Forum MembersMIUI Fan from IndiaPokemon Master MedalHappy Diwali5 Million Forum PostsFan Of MIUI GreeceUEFA EURO MedalHilal Ramadan MIUI Fan From SingaporeXiaomi 6th Anniversary1300K Forum MembersMIUI Fan from MalaysiaMIUI Fan From MyanmarMIUI Fan From VietnamXiaomi 5th AnniversaryMIUI 300 Weeks500K Forum Members10 Million Forum PostsMIUI 9Surge S1MIUI World TourMIUI Monthly TalkMIUI Fan from TurkeyRooster Year of 20173 Million Forum MembersSuper MondayFan Of MIUI UkraineRocket to Future1900K Forum MembersMIUI Happy Medal90000 Forum MembersHappy Holi MedalMIUI Font LoverMIUI 2017MIUI Lucky Friday1st AnniversaryMerry ChristmasMIUI 5th AnniversaryHappy New YearFan Of MIUI IndiaI Love 2016Fan Of MIUI ItalyMIUI Forum App1 Million Forum App InstallsMIUI 100 Million UsersMIUI Fan From IndonesiaMIUI Weekly PollThanksgiving DayI Love Mi BunnyMiPopGamer Mi BunnySummer Mi BunnyAlpaca Mi Bunny MIUI Device TeamDebate MasterMi Bunny Game Master Mi Story Teller2017 Annual AwardsMIUI Weekly Devices QuizAndroid GuruWallpaper ExpertIndia Independence DayMost Active MIUIerTheme TalentDie-hard MIUI FanPioneer of MIUI English Forum MIUI Medals CollectorScroll Of WisdomUpdates LoverMIUI FollowerStar Of IconsMIUI Android 4.4 KitKatMIUI Ice Bucket ChallengeMi TalentStar WarsStar Of TechnologyApp TalentMIUI KingMIUI ExpertTechnology GuruMr. DependableMIUI Twitter FollowerYouth PledgeMIUI G+ FollowerMIUI FB FollowerRingtone Star Forum Contest LoverAndroid ElfMaster Of TechnologyHumor MasterInbox ZeroMi Lover Medal

15:53, Jul-16-2016 | From PC
|
Very informative thread.!!

Thank you bro..!!

Senior Member

Rank: 2

Credits
132
Device
0
Online time
30 Hours
Send PM

Awesome!I Love MIUIRedmi 35 Million Forum Posts1400K Forum MembersMi Lover Medal

21:08, Jul-16-2016 | Via mobile
|
maybe the next job for us is, update OTA from TWRP :'(

MIUI Honorary Moderator

Rank: 6Rank: 6

Credits
24012
Device
Mi Pad
Online time
845 Hours
Send PM

Yeelight Bedside LampMi BandUnlock MedalMi  BunnyXiaomi 7th AnniversaryMIUI 2016MIUI 8MIUI 7MIUI 6I Love MIUIFantastic!Awesome!Redmi Note 3Mi PadMi 4iThanksgiving DaySuper ThursdayMIUI Fan From SingaporeHappy Valentine's DayMIUI Forum App700K Forum MembersMIUI Monthly TalkMIUI 300 WeeksMIUI Weekly PollFan Of MIUI PolandGamer Mi BunnyAlpaca Mi Bunny Summer Mi BunnyMIUI Device TeamMi Story TellerMi Lover MedalMi Bunny Game Master Die-hard MIUI FanMi TalentMaster Of TechnologyMIUI FollowerAndroid GuruDebate MasterForum Contest LoverAndroid ElfScroll Of WisdomInbox ZeroUpdates LoverYouth Pledge

23:46, Jul-16-2016 | From PC
|
I guess it's device specific?  
If you can't be a good example, you'll serve as a terrible warning!...

Platinum Member

Rank: 4

Credits
4180
Device
Redmi 3
Online time
90 Hours
Send PM

MIUI 8

 Author| 00:38, Jul-17-2016 | From PC
|
LuckyMeAgain replied at 2016-7-16 21:46
I guess it's device specific?

As far as i know most of the Xiaomi QCOM devices has it.
Life is beautiful

Super moderator

Enjoy Life!

Rank: 8Rank: 8

Credits
118805
Device
Mi 4
Online time
5459 Hours
Send PM

Magic CubeMi T-ShirtMijia Story TellerMi In-Ear HeadphonesMi KeyUnlock MedalMi BandMi  BunnyMi BoxMi HomeMi Power BankMi WiFi RouterMIUI 8MIUI 2015Awesome!MIUI 2016MarshmallowAnTuTuMIUI Devices ContestI Love MIUIMIUI 6MIUI 7Fantastic!FlashholicMi 4iRedmi 2Xiaomi Mi 4Mi 4cRedmi Note 2Redmi Note 3Redmi 3Redmi 1SMi 3Redmi NoteRedmi4 Million Forum MembersMi TVMi PadRedmi 3SRedmi Note 4MIUI Fan From PhilippinesFan Of MIUI BangladeshFan Of MIUI IndiaMIUI Fan From IndonesiaMIUI Fan From BrazilFan Of MIUI Ex-Yu Mid-Autumn FestivalDiwali MIUI Fan from MalaysiaHappy DiwaliMIUI 50 Million UsersMIUI Fan From SingaporeMIUI 4th AnniversarySingapore BirthdayXiaomi 5th AnniversaryHilal Ramadan MIUI Fan from India500K Forum MembersThanksgiving DayHappy Singles' DayMIUI V5 ReviewFan Of  MIUI Azerbaijan300K Forum MembersAtaturk Mourning1st Anniversary2014 ChristmasMIUI 100 Million Users1400K Forum Members1500K Forum MembersMIUI Weekly PollMIUI Marathon MedalMIUI World Tour1700K Forum MembersMIUI Forum AppMIUI 6th AnniversaryOlympics MedalMIUI Fan From NepalMalaysia Anniversary2100K Forum MembersI Love 2016MIUI 9Super MondayMIUI Happy MedalMIUI 2017Super WednesdayFan Of MIUI RussiaRocket to FutureRooster Year of 20171 Million Forum App InstallsSuper FridayUEFA EURO MedalPokemon Master Medal700K Forum MembersHappy New YearHappy Valentine's Day2 Million Forum MembersWomen's Day MedalMIUI Fan from TurkeyMIUI 5th Anniversary800K Forum Members900K Forum Members1300K Forum Members5 Million Forum PostsXiaomi 6th AnniversaryMerry Christmas1 Million Forum MembersI Love Mi BunnyMiPopSummer Mi BunnyAlpaca Mi Bunny Gamer Mi BunnyMIUI Device TeamMIUI Beta TeamInbox ZeroPOCO F18 Million Forum MembersYouth PledgeXiaomi 8th AnniversaryMIUI KingAndroid ElfHumor MasterDie-hard MIUI FanOTA FeedbackDebate MasterRingtone Star Pioneer of MIUI English Forum Mr. DependableMIUI FollowerScroll Of WisdomMIUI G+ FollowerMi Story TellerMIUI ExpertMost Active MIUIerMi Lover MedalTechnology GuruMi TalentMi Bunny Game Master App TalentBest ArticleSuper ModeratorSenior Beta TesterMIUI Global Forum 2014Star Of IconsMr. Post the MostMIUI Android 4.4 KitKatMIUI Medals CollectorMIUI FB FollowerMIUI Twitter FollowerApp Review Talent2017 Annual AwardsUpdates LoverAndroid GuruMIUI App Review TeamForum Contest LoverMIUI Ice Bucket Challenge

19:35, Jul-17-2016 | From PC
|
@Anik1199 Thanks for guide and sharing knowledge.  

Rated by 1 person   Experience Prestige Reason  

Anik1199 + 10 + 3 Welcome!

Experience +10  Prestige +3  View Rating Log

Credits Management

Quick Reply Top Return to the list