• arandomperson

    @JonB yeah, changing c_void_p to c_byte still results in a crash with the same fault log, and setting the handler to None also results in a crash with the same fault log.

    posted in Pythonista read more
  • arandomperson

    @JonB oops my mistake, though it still crashes unfortunately.
    Thanks for the reply!

    posted in Pythonista read more
  • arandomperson

    I'm trying to implement Face ID in a script, but following the example Touch ID scripts it just results in a crash, with faulthandler just saying Aborted

    This is what i'm using,

    from objc_util import *
    
    context = ObjCClass('LAContext').alloc().init()
    policy = 1
    reason = "FaceID Testing"
    
    def _handler(_cmd, success, error):
        autherr = ObjCInstance(error).localizedDescription()
        print(autherr)
        if success:
            print('authenicated')
    
    handler = ObjCBlock(_handler,restype = None, argtypes = [c_void_p, c_void_p, c_void_p])
    context.evaluatePolicy_localizedReason_reply_(policy, reason, handler)
    

    Using the "canEvaluatePolicy:error:" function, it returns true, so i'm assuming that Face ID works.
    Also setting policy to 2, defaults to passcode authentication.
    Of course it can as simple as @omz not adding "NSFaceIDUsageDescription" to pythonista's Info.plist

    Thanks for any help!

    posted in Pythonista read more
  • arandomperson

    @mikael faulthandler seems really useful, Thanks!

    posted in Pythonista read more
  • arandomperson

    @JonB Thanks for the help, I did manage to get it working by studying a couple of examples, but your code looks so much nicer.

    posted in Pythonista read more
  • arandomperson

    Currently I was able to test the framework by calling "c.MRMediaRemoteSendComman(2, 0)" but the closest I got to calling "MRMediaRemoteGetNowPlayingInfo" was with this code:

    from objc_util import *
    from ctypes import *
    import ctypes
    
    c = ctyles.CDLL(None)
    MRMediaRemoteGetNowPlayingInfo = c.MRMediaRemoteGetNowPlayingInfo 
    MRMediaRemoteGetNowPlayingInfo .restype = c_void_p
    MRMediaRemoteGetNowPlayingInfo .argtypes = [c_void_p, c_void_p]
    
    queue = c.dispatch_get_current_queue
    
    info = c_void_p()
    MRMediaRemoteGetNowPlayingInfo(queue, byref(info))
    print(objcCInstance(info))
    

    But this just crashes the app, i'm pretty sure the problem is with the queue, but i'm not able to call "dispatch_get_main_queue" because its just says its unable to find the symbol.

    Again, any help would be great!

    posted in Pythonista read more
  • arandomperson

    @mikael, Yes I have looked at the documentation, though the example only works for the stock application. Also the function I eluded to is not a class method, but a function. I’m looking into ctypes, but I dont know how to pass a dispatch queue or a completion block to it, As I’m not too familiar with ctypes.

    posted in Pythonista read more
  • arandomperson

    I'm trying to get information about the current song playing outside of the stock music app. Coming from jailbreak development, I know I can use the c function "MRMediaRemoteGetNowPlayingInfo" in the private framework mediaRemote. But I don't know how I would be able to call that in Pythonista.

    Any help is appreciated!

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!