[Xiaomi Mi A1 Guides, News, & Discussion] hnkotnis:
Persist Resurrector​

#include<disclaimer.h>
void main()
{
clrscr();
printf("If you are reading this, your warranty is already void.");
printf("/nYou can't blame me for that. It is your own doing");
printf("/nFor using this software, you need to agree following things");
/* */
/*I am not responsible for bricked devices, dead SD cards,*/
/* thermonuclear war, or you getting fired because the alarm app failed. Please*/
/* do some research if you have any concerns about features included in this software*/
/* before using it! YOU are choosing to make these modifications, and if*/
/* you point the finger at me for messing up your device, I will laugh at you.*/
/* */
getch();
}

Hello everyone!

It has been observed that few custom ROMs of Mi A1 change persist partition. This has no observable (yet) effects when using those ROMs. However after flashing stock ROM back, connecting to Wi-Fi becomes impossible. This happens because the ROM changes your Wi-Fi MAC address. The custom ROMs causing this bug do not depend on Vendor MAC, so Wi-Fi works fine with them.

Reconstructing original vendor MAC address is possible, but

ONLY

if you have persist partition which belongs to

YOUR PHONE

. This means you HAVE NOT flashed any of the several persist.img files floating around xda.

If you have flashed someone else's persist image -

You CANNOT use this tool since you have destroyed the last chance to repair original Wi-Fi MAC.

You have lost your original Bluetooth MAC and replaced with someone else's.

You have lost calibration data of various sensors (Unconfirmed, but usually sensor calibration data is stored in /persist)

If you connect to the same Wi-Fi with someone else who is using same persist.img or has same MAC address by coincidance. Same for BT.

Wi-Fi where that MAC is banned won't let you join or if you added MAC filter to your own Wi-Fi it won't recognise your phone anymore.

It is illegal.

This is when this tool comes into picture. A guide is posted in guides section of Mi A1 forum by SevenSlevin. But it involves completely deleting the contents of the file which stores the MAC address. This deletes the faulty MAC addresses causing problems, but does not give you original Vendor MAC address (from Xiaomi) back. I personally didn't like losing the original MAC address which came from factory. I am sure there would be many of you thinking along the similar lines.

So what this tool does is it reconstructs your Wi-Fi MAC addresses using dark hex magic :p (pun intended) and pushes it back to your device, puts it in appropriate position if you want and voila!

FAQ (Recommended to read)

Add a MAC randomizer for people who already have destroyed their persist.

=> This looks like on the borderline of legality and illegality. I can add this feature in the next release if this is legal. (Please reply in this thread)

Is this tool safe?

=> I have tested it on 3 different Mi A1s and I haven't found any problem yet.

Will this work if I have xyz ROM?

=> I always use and prefer stock Oreo ROM when testing. So you have to find the answer yourself.

But it is best to be on stock ROM because it is the ROM which has the problem you are here to get fixed.

I have got a warning with an error code or FAILSAFE kicked in.

=> Send the error code here.

What is FAILSAFE?

=> Failsafe is a series of measures to avoid potential problems or damage done made by me for another personal project. Only a very small part is implemented here and this is made 60% failsafe which means there are *some* loopholes left due to time constraints and unnecessary redundancy, but you won't find them unless you are doing terminal stupidity.

This is the main reason why I am not releasing the source code. It is still in its infancy and it will be long before it will be mature.

Stick to the instructions and FAILSAFE won't kick in.

This software is NOT working at all.

=> Post here along with the steps you followed.

Awesome! YOU FIXED MY PHONE!

=> I am glad to hear read this. :highfive:

Requirements -

Mi A1 (stock ROM recommended)

Root access

ADB Drivers installed

Microsoft DOT NET Framework (Tested on v4+, but v3.5+ should work)

Your firstborn (JK JK)

Downloads -

Attached to the bottom of this post.

Current version - 1.0.0.0

Date - 22/04/2018

Changelog -

Instructions -

Download and extract the zip to any directory. (Avoid Program Files or at the root of Windows Installation Drive, UAC becomes a problem)

Run the Persist Resurrector.exe

Connect the phone via USB cable and unlock screen.

Press the buttons in the sequence as labeled on screen.

Give confirmations to ADB and Root as necessary.

Profit!