XiaoMiToolV2 icon indicating copy to clipboard operation
XiaoMiToolV2 copied to clipboard

Xiaomi procedure failed: [getServiceToken] Missing serviceToken cookie on mac M1

Open id3vz opened this issue 3 years ago • 14 comments

I faced this error "Xiaomi procedure failed: [getServiceToken] Missing serviceToken cookie" on m1 MacBook pro Anyone knows how to build it on m1 mac so I can use the last commit in the build

id3vz avatar Dec 17 '21 09:12 id3vz

same error where, i dont know if that causa my 168 hours extension again

hcarrega avatar Dec 18 '21 18:12 hcarrega

I'm having the same problem on linux. Did you guys managed to solve the problem?

lucaslira95 avatar Dec 28 '21 02:12 lucaslira95

Maybe something's is missing . Even try flashing magisk via app or install twrp I get the same error

hcarrega avatar Dec 28 '21 07:12 hcarrega

PROBLEM SOLVED!

The problem is that the version available for download on the official website and the release page is too old! The problem has been patched but you have to build it yourself using the following commands:

git clone https://github.com/francescotescari/XiaoMiToolV2 ./gradlew build ./gradlew run

On some computers this may not work (my desktop PC works, but my laptop failed to build), so in that case try a VM and copy over the built files. :+1:

TadaCZE avatar Jan 01 '22 23:01 TadaCZE

PROBLEM SOLVED!

The problem is that the version available for download on the official website and the release page is too old! The problem has been patched but you have to build it yourself using the following commands:

git clone https://github.com/francescotescari/XiaoMiToolV2 ./gradlew build ./gradlew run

On some computers this may not work (my desktop PC works, but my laptop failed to build), so in that case try a VM and copy over the built files. 👍

Build fails in my laptop and desktop, can you share the compiled binary?

lucaslira95 avatar Jan 02 '22 01:01 lucaslira95

For someone use the Mac Intel/M1 you can replicate my way (Make sure your Android JDK is setup first or you can install Android Studio to get All Android Setting)

  1. Clone the master repo git clone https://github.com/francescotescari/XiaoMiToolV2
  2. After clone open Code Editor (I Use VSCode), and open your terminal
  3. In Terminal go to XMT tool project folder where you keep in
  4. After go to XMT directory in your terminal, please fetch Mac Branch by using this command
    • git fetch mac
    • after that copy file and keep in another folder of adb and fastboot
    • after that, in your terminal use this command git fetch master and replace all file inside the ./res/tools/ with adb and fastboot
    • after that sudo ./gradlew build and then sudo ./gradlew run
  5. XMT will be open and do what you need

Note: XMT that works in 2022 is, when you login mi account in XMT it request SMS vefirication, if your XMT not request SMS verification when login, it is not updated

hariantara avatar Jan 05 '22 14:01 hariantara

Please guys ....!!!! Please could you provide us with a binary... No matter what I try ...I keeps on failing

Hasodikis avatar Jan 06 '22 12:01 Hasodikis

Thank you! this worked! Note: you need to have exactly OpenJDK 11 (https://jdk.java.net/archive/). I used 64 bit version 11.0.2 (build 11.0.2+9) On windows you may also need to add/modify environment variables:

JAVA_HOME -> S:\JDK\11
PATH -> Edit -> New -> S:\JDK\11\bin

Instead of S:\JDK\11 use path to the folder where you unpacked JDK from https://jdk.java.net/archive/

I was able to build it and unlock bootloader (Latest Mi Unlocker though failed to do it...)

PROBLEM SOLVED!

The problem is that the version available for download on the official website and the release page is too old! The problem has been patched but you have to build it yourself using the following commands:

git clone https://github.com/francescotescari/XiaoMiToolV2 ./gradlew build ./gradlew run

On some computers this may not work (my desktop PC works, but my laptop failed to build), so in that case try a VM and copy over the built files. 👍

swayok avatar Jan 25 '22 16:01 swayok

Build on M1 (must use i386 arch!!!):

Download openjdk-11.0.2 (i386) first:

$ cd /Library/Java/JavaVirtualMachines/
$ sudo wget https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_osx-x64_bin.tar.gz
$ sudo tar xf openjdk-11.0.2_osx-x64_bin.tar.gz && sudo rm openjdk-11.0.2_osx-x64_bin.tar.gz

View Java versions:

$ /usr/libexec/java_home -V
    11.0.2 (x86_64) "Oracle Corporation" - "OpenJDK 11.0.2" /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home

Add $JAVA_HOME and choice OpenJDK 11.0.2:

$ nano ~/.zshenv
export JAVA_HOME=$(/usr/libexec/java_home -v11)

$ source ~/.zshenv
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home

Going to i386:

$ env /usr/bin/arch -x86_64 /bin/zsh --login
$ arch
i386
$ cd ~
$ git clone https://github.com/francescotescari/XiaoMiToolV2
$ cd XiaoMiToolV2

Add macOS fastboot and adb:

$ wget -O ./res/tools/adb https://github.com/francescotescari/XiaoMiToolV2/raw/mac/res/tools/adb && chmod +x ./res/tools/adb
$ wget -O ./res/tools/fastboot https://github.com/francescotescari/XiaoMiToolV2/raw/mac/res/tools/fastboot && chmod +x ./res/tools/fastboot

Build with run: $ ./gradlew build && ./gradlew run



Work perfectly on MBP M1 with unlock Xiaomi Redmi 5 Plus bootloader without any cookie error. Enjoy!

n0a avatar Feb 07 '22 22:02 n0a

SOMEONE PLEASE THINK TO THE WINDOWS CHILDREN! WTF SHOULD WE DO TO SOLVE THIS SHEEEIT?

dnarock666 avatar Mar 23 '22 01:03 dnarock666

Build on M1 (must use i386 arch!!!):

Download openjdk-11.0.2 (i386) first:

$ cd /Library/Java/JavaVirtualMachines/
$ sudo wget https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_osx-x64_bin.tar.gz
$ sudo tar xf openjdk-11.0.2_osx-x64_bin.tar.gz && sudo rm openjdk-11.0.2_osx-x64_bin.tar.gz

View Java versions:

$ /usr/libexec/java_home -V
    11.0.2 (x86_64) "Oracle Corporation" - "OpenJDK 11.0.2" /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home

Add $JAVA_HOME and choice OpenJDK 11.0.2:

$ nano ~/.zshenv
export JAVA_HOME=$(/usr/libexec/java_home -v11)

$ source ~/.zshenv
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home

Going to i386:

$ env /usr/bin/arch -x86_64 /bin/zsh --login
$ arch
i386
$ cd ~
$ git clone https://github.com/francescotescari/XiaoMiToolV2
$ cd XiaoMiToolV2

Add macOS fastboot and adb:

$ wget -O ./res/tools/adb https://github.com/francescotescari/XiaoMiToolV2/raw/mac/res/tools/adb && chmod +x ./res/tools/adb
$ wget -O ./res/tools/fastboot https://github.com/francescotescari/XiaoMiToolV2/raw/mac/res/tools/fastboot && chmod +x ./res/tools/fastboot

Build with run: $ ./gradlew build && ./gradlew run



Work perfectly on MBP M1 with unlock Xiaomi Redmi 5 Plus bootloader without any cookie error. Enjoy!

On My MacBook Pro 13 M1 Doesn't work missing service token :(

LightYagami28 avatar Mar 29 '22 21:03 LightYagami28

For any Linux users that stumble with this: before the ./gradlew run, it seems to be necessary to fix the fastboot and adb binaries.

~~The easiest solution for me is to:~~ ~~- Install them with your package manager (sudo apt install adb fastboot or equivalent)~~ ~~- Add symbolic links to the ./res/tools folder (ln -s /usr/bin/adb ./res/tools/ and ln -s /usr/bin/fastboot ./res/tools/)~~

Probably you have skipped the README.md and not realized this:

Make sure to select the repository branch corresponding to your target platform OS (Windows, Mac, Linux), as the resources files are different.

Leaving my workaround to prove that I am dumb and just in case it becomes useful information for somebody. Sorry!

alexbarcelo avatar Apr 29 '22 15:04 alexbarcelo

can anyone share the updated binary my MacBook failing to compile?

singhh9596 avatar Jun 12 '22 13:06 singhh9596

well, you might as well give up, since even the correct version failes since #60

HannesGitH avatar Jul 30 '22 14:07 HannesGitH