-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Support local Anisette generation #2
Comments
I doubt this can be included in the pypi package, since building pyprovision requires a D compiler which is not really a default install usually. |
I have don't have much experience with lower-lever languages, but I was actually messing with this yesterday and it's pretty simple to build a python wheel that includes libprovision.so. The downside is that it still relies on externally installed libraries; I did briefly try to "repair" the wheel using https://github.com/pypa/auditwheel, but it wasn't able to find all external dependencies. That would still require a separate wheel for each architecture / OS / python version though, and would probably be tricky in terms of licensing, to say the least. That project looks quite interesting though, worth keeping an eye at! |
I've just made https://github.com/JayFoxRox/pyprovision-uc public.
I made this when I wasn't able to make pyprovision / D compiler work on my setup within a couple of hours. It's still unfinished and still needs to be cleaned up. I had a lot of problems with the There's also good chances that there's issues with endianess or 32-bit (because I'm using host There's also a chance that the VM will become unstable over time. I also plan to modify the API a bit in the future - I don't like how it operates on a real filesystem. |
Oh that's really cool! I just tried it out myself and while I did have to fix some things (create the directories, some |
I was able to make dadoum (D written) work in my dockerfile: FROM python:3.11-slim
RUN pip install --upgrade pip
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install dub git gcc -y
RUN git clone https://github.com/Dadoum/pyprovision /tmp/pyprovision
RUN cd /tmp/pyprovision && pip install .
... And I managed (I believe) to write the LocalAnisetteProvider: class LocalAnisetteProvider(BaseAnisetteProvider):
"""Anisette provider. Generates headers without a remote server using pyprovision."""
def __init__(self, libary_path, provisioning_path, device_json_path):
self.adi = ADI(libary_path)
self.adi.provisioning_path = provisioning_path
self.device = Device(device_json_path)
if not self.device.initialized:
# Pretend to be a MacBook Pro
self.device.server_friendly_description = "<MacBookPro13,2> <macOS;13.1;22C65> <com.apple.AuthKit/1 (com.apple.dt.Xcode/3594.4.19)>"
self.device.unique_device_identifier = str(uuid.uuid4()).upper()
self.device.adi_identifier = secrets.token_hex(8).lower()
self.device.local_user_uuid = secrets.token_hex(32).upper()
self.adi.identifier = self.device.adi_identifier
self.dsid = c_ulonglong(-2).value
self.provisioning_session = ProvisioningSession(self.adi, self.device)
self.provisioning_session.provision(self.dsid)
self.otpObj = self.adi.request_otp(self.dsid)
@property
@override
def otp(self) -> str:
return self.otpObj.one_time_password
@property
@override
def machine(self) -> str:
return self.otpObj.machine_identifier
@override
async def close(self) -> None:
"""See `BaseAnisetteProvider.close`_.""" Based of @Dadoum's example... but I get this error:
Any clue? I know that this is not even implemented, but maybe knows what this error indicates. Also, If what I did can help you, I can try and open a PR... |
@hkfuertes you might want to change your password, people subscribed to this got it in their email. |
Thank you! It was a mistake... I didn't thought of email subscription... Edit: Changed!, @biemster thank you for the heads up! |
I think I'm able to answer myself: FindMy.py/findmy/reports/anisette.py Line 71 in d82b1fb
😆 |
Oh yes indeed, sorry for taking so long to respond. But glad you figured it out yourself! The issue here is not necessarily getting local anisette to work, but rather packaging it so that people don't need a local D compiler. Unless your solution works outside of Docker as well? Edit: you could also use anisette-v3-server in a separate docker container if you're deploying FindMy.py in docker anyway; that way you can simply use Also also, if you have a functional API implementation, let me know because I'm also interested ;-) |
Ohhh I'm way behind you guys... hahahaha I just now how to follow steps and connect dots, I dont really understand Anisette or Findmy... hahahahah. The only reason I tried the local anisette is just to try... you see, I tried remote anisete with the anisette server in the same docker-compose, and it worked fine... but only after first login. Once I restart the server, for some reason, I needed to re-login. I was hoping that local anisette would solve this issue... |
Support local anisette header generation using pyprovision.
The text was updated successfully, but these errors were encountered: