mashed-potatoes / potatonv-crossplatform Goto Github PK
View Code? Open in Web Editor NEWit is not OK iirc
License: GNU Affero General Public License v3.0
it is not OK iirc
License: GNU Affero General Public License v3.0
Usrlock - CLI utility for unlocking Huawei devices on Kirin SoCs. Copyright (C) 2019 Penn Mackintosh (penn5) Copyright (C) 2020 Andrey Smirnoff (mashed-potatoes) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Hi!
I put hisi620 from non-crossplatform into bootloaders directory of crossplatform, modified main.py.
I get
? Select bootloader: hisi620
? What key should be set? 1111111111111111
error Bootloader is invalid or not found!
Anyone can help?
Support for more devices can be provided easily by making imageflasher.py not depend on anything related to UI and writing simple instructions to do something like https://github.com/mashed-potatoes/PotatoNV/issues/109#issuecomment-1022324090 manually.
After a number of problems while trying to install the dependencies which I finally resolved by installing these manually one by one with pip install
I ran:
python3 -m usrlock
and got this:
$ python3 -m usrlock
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/ari/github/PotatoNV-crossplatform/usrlock/__main__.py", line 12, in <module>
from . import main
File "/home/ari/github/PotatoNV-crossplatform/usrlock/main.py", line 8, in <module>
from PyInquirer import prompt
File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/PyInquirer/__init__.py", line 6, in <module>
from prompt_toolkit.token import Token
File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
from .interface import CommandLineInterface
File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/interface.py", line 19, in <module>
from .application import Application, AbortAction
File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/application.py", line 8, in <module>
from .key_binding.bindings.basic import load_basic_bindings
File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/key_binding/bindings/basic.py", line 9, in <module>
from prompt_toolkit.renderer import HeightIsUnknownError
File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/renderer.py", line 11, in <module>
from prompt_toolkit.styles import Style
File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/styles/__init__.py", line 8, in <module>
from .from_dict import *
File "/home/ari/github/PotatoNV-crossplatform/lib/python3.10/site-packages/prompt_toolkit/styles/from_dict.py", line 9, in <module>
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
I get an compilation error when pip install -r requirements.txt
for packages lxml and PyInquirer.
Building wheels for collected packages: lxml, PyInquirer
Building wheel for lxml (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-n0onje8w/lxml_512678ab2ca948a19e12b92606be3638/setup.py'"'"'; __file__='"'"'/tmp/pip-install-n0onje8w/lxml_512678ab2ca948a19e12b92606be3638/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-958aqi_6
cwd: /tmp/pip-install-n0onje8w/lxml_512678ab2ca948a19e12b92606be3638/
Complete output (194 lines):
...
[This part was stripped by me]
...
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-n0onje8w/lxml_512678ab2ca948a19e12b92606be3638/setup.py'"'"'; __file__='"'"'/tmp/pip-install-n0onje8w/lxml_512678ab2ca948a19e12b92606be3638/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-_h0vl5fh/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/user/.local/include/python3.10/lxml Check the logs for full command output.
Here is the result:
root@michal:/opt/PotatoNV-crossplatform-master# python3 -m usrlock
? Select bootloader: hisi960
? What key should be set? 1111111111111111
error Bootloader is invalid or not found!
root@michal:/opt/PotatoNV-crossplatform-master#
and here is the part of the code which generates the error:
args.manifest = "./bootloaders/%s/manifest.json".format(args.bootloader)
if not path.isfile(args.manifest):
ui.error("Bootloader is invalid or not found!", critical=True)
return args
It look the parameter args.manifest is empty but why?
i have successfully unlock the bootloader of VTR L09 with EMUI 5
and then i flashed twrp and then updated to EMUI 8 and the bootloader was locked again
i used your code again to unlock it and then flashed twrp and then EMUI 9
and after that i when i try to flash the recovery i cant to boot to it
even i flash the recovery that i extracted from the EMUI official .APP image
may be there is a mistake some where?
i have an idea that the fastboot that you code flashes is old
so i go to the folder: hisi960 and changed the fastboot.img with the new one i get from the EMUI 9
after booting to bootloader the same problem occurs?
xloader.img is the bootloader? what if i change it with the new one i extracted from the EMUI9 stock rom?
any idea? i hope that you can help. i'm stuck
i can flash EMUI 9 system .img but after it boots it tells me to connect to wifi to unlock
it stucks in: "just a moment"
i think i need to make a factory reset but there is no recovery
when i try to go to recovery i get:
error no: 11 (recovery image)
error no: 2 (load failed)
i can flash the leaos lineageos but it's very buggy: no sim card detected. cant unlock with fingerprint. and laggy.
i hope that you can help.
Not gonna lie, a tiny bit of help on how to use it would have been helpful.
I somehow managed to figure it out thanks to some other issue that mentioned the usage and (at least according to the usrlock cli output) managed to unlock the phone.
But some basic info would be greatly appreciated, what to install, what to do.
Might try doing one myself, but I'm afraid I might skip some important steps/information.
I am happy to license this code under agpl3. It is now legal as long as you put a valid copyright notice stating the original author
hello
i want to use the test point method to unlock my huawei p10 boot-loader under manjaro Linux
i've installed the requirements:
python -m venv ./
source ./bin/activate
pip install -r requirements.txt
python -m usrlock
after the last line i get this error:
Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/home/pc/Downloads/Huawei P10 VTR-L09/huawei unlock/PotatoNV-crossplatform-master/usrlock/__main__.py", line 14, in <module> main.main() File "/home/pc/Downloads/Huawei P10 VTR-L09/huawei unlock/PotatoNV-crossplatform-master/usrlock/main.py", line 84, in main args = setup() ^^^^^^^ File "/home/pc/Downloads/Huawei P10 VTR-L09/huawei unlock/PotatoNV-crossplatform-master/usrlock/main.py", line 35, in setup args.bootloader = prompt({ ^^^^^^^^ File "/home/pc/Downloads/Huawei P10 VTR-L09/huawei unlock/PotatoNV-crossplatform-master/venv/lib/python3.11/site-packages/InquirerPy/resolver.py", line 213, in prompt result[question_name] = question_mapping[question_type]( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pc/Downloads/Huawei P10 VTR-L09/huawei unlock/PotatoNV-crossplatform-master/venv/lib/python3.11/site-packages/InquirerPy/prompts/list.py", line 196, in __init__ self.content_control = InquirerPyListControl( ^^^^^^^^^^^^^^^^^^^^^^ File "/home/pc/Downloads/Huawei P10 VTR-L09/huawei unlock/PotatoNV-crossplatform-master/venv/lib/python3.11/site-packages/InquirerPy/prompts/list.py", line 63, in __init__ super().__init__( File "/home/pc/Downloads/Huawei P10 VTR-L09/huawei unlock/PotatoNV-crossplatform-master/venv/lib/python3.11/site-packages/InquirerPy/base/control.py", line 73, in __init__ self._safety_check() File "/home/pc/Downloads/Huawei P10 VTR-L09/huawei unlock/PotatoNV-crossplatform-master/venv/lib/python3.11/site-packages/InquirerPy/base/control.py", line 156, in _safety_check raise InvalidArgument("argument choices cannot be empty") InquirerPy.exceptions.InvalidArgument: argument choices cannot be empty
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.