Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/linux login url #41

Open
wants to merge 1 commit into
base: linux
Choose a base branch
from

Conversation

edd34
Copy link

@edd34 edd34 commented Nov 13, 2021

This fixes #40 for linux branch

@edd34 edd34 changed the base branch from master to linux November 13, 2021 08:28
@heysagnik
Copy link

Please release the new build

@edd34
Copy link
Author

edd34 commented Dec 26, 2021

Hi @devgossips you can still run the program with the fix by compiling it yourself. Please perform the following instructions :

  • Clone the project locally : git clone [email protected]:edd34/XiaoMiToolV2.git -> the fix exists within my fork and not yet within the official project.
  • Checkout to the branch that contains the fix : git checkout fix/linux_login_url
  • Compile and run the program using the gradlew executable with sudo ./gradlew build && sudo ./gradlew run and then you should be good to go !

Tell us if you succeed !

@renefritze
Copy link

I end up with this:

./gradlew build

> Configure project :
Project : => no module-info.java found

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x6e875475) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x6e875475

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
1 actionable task: 1 executed

on

java --version
openjdk 18-ea 2022-03-15
OpenJDK Runtime Environment (build 18-ea+15-Ubuntu-4)
OpenJDK 64-Bit Server VM (build 18-ea+15-Ubuntu-4, mixed mode, sharing)

I've tried both openjdk 17 and 16 too, with same results

@gastonmatias
Copy link

I end up with this:

./gradlew build

> Configure project :
Project : => no module-info.java found

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x6e875475) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x6e875475

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
1 actionable task: 1 executed

on

java --version
openjdk 18-ea 2022-03-15
OpenJDK Runtime Environment (build 18-ea+15-Ubuntu-4)
OpenJDK 64-Bit Server VM (build 18-ea+15-Ubuntu-4, mixed mode, sharing)

I've tried both openjdk 17 and 16 too, with same results

Same Here, any suggestion?

@edd34
Copy link
Author

edd34 commented Mar 5, 2022

Have you tried with "sudo" ?

@renefritze
Copy link

Have you tried with "sudo" ?

Kinda. I can reproduce the issue with this Dockerfile where the build runs as root:

FROM ubuntu:21.10
RUN apt update ; apt install -y openjdk-18-jdk git
RUN git clone --branch=fix/linux_login_url https://github.com/edd34/XiaoMiToolV2 /src
RUN cd /src/ && ./gradlew build

@renefritze
Copy link

After realizing that the README mentions java 11, I tried again with an older base image where one can install openjdk-11

FROM debian:stable-slim as builder
RUN apt update ; DEBIAN_FRONTEND=noninteractive apt install -y openjdk-11-jdk git x11-apps xserver-xorg-video-amdgpu \
    gtk2-engines libswt-gtk-4-java libxslt1.1 libxtst6 libxxf86vm1
RUN git clone --branch=fix/linux_login_url https://github.com/edd34/XiaoMiToolV2 /src
RUN cd /src/ && ./gradlew --no-daemon build

WORKDIR /src
CMD [ "./gradlew", "--no-daemon", "run" ]

This actually builds successfully. I can run that with

docker run -it --privileged -v /dev:/dev -v /tmp/.X11-unix:/tmp/.X11-unix  --net=host -e DISPLAY=$DISPLAY  the_image_name

and successfully unlock my device. That's pretty rough since I mount the entire /dev tree. There's a nicer solution for that which still makes the phone usb device available to the container after fastboot/adb switch. For some reason you need to login before selecting your device. If you try to login after the process started the browser component hangs on "loading". The Dockerfile includes the amd driver, which is specific to my setup.

@skylabhalo
Copy link

I just can't this to build on ArchLinux which annoys me so much...

@bunchofdutch
Copy link

Hi @devgossips you can still run the program with the fix by compiling it yourself. Please perform the following instructions :

* Clone the project locally : `git clone [email protected]:edd34/XiaoMiToolV2.git` -> the fix exists within my fork and not yet within the official project.

* Checkout to the branch that contains the fix : `git checkout fix/linux_login_url`

* Compile and run the program using the gradlew executable with  `sudo ./gradlew build && sudo ./gradlew run` and then you should be good to go !

Tell us if you succeed !

Thanks a lot, thanks to this I was able to build fine on MX Linux 21. The fix gets me around the Xiaomi token error of XMT2_Linux_20.7.28.run. However, now I'm stuck on "Failed to unlock your device, Xiaomi server returned error 10000, request parameter error"

@bunchofdutch
Copy link

Correction: tried again with device in fastboot mode (earlier, I had to boot MIU to pick of the code that Xiaomi SMSed me for device verification and I was trying unlock from there). Now I get error 20045: Please use the common user tool on the official website

@unfairDude
Copy link

i guess another dead tool.
i keep gettijg serviceToken error

nazarewk added a commit to nazarewk/XiaoMiToolV2 that referenced this pull request Feb 28, 2023
francescotescari#41 - login URL fix
francescotescari#94 - Use CookieManager from javafx
francescotescari#67 - update JavaFX to show captcha properly

finishes with:
Failed to unlock your device, Xiaomi server returned error 20045:
Error descripiton: Unknown error: 20045
Server description: Please use common user tool on the official website
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

login fail only for linux and max because login url is incorrect for linux branch and mac
8 participants