Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Passcode module!
-
I made a super simple to use module to lock your scripts by face-id or fingerprint!
You can Find it at https://github.com/ClackHack/passcode ! Let me know what you think! -
@ClackHack, can you help me a bit with your code?
If I run the passcode script, it crashes Pythonista (with a non-helpful ObjC exception for the line where
lock()
is called).If I run the code in the Readme, nothing happens (as
lock
is never called, I think). -
If I run the script, no crash, asks Touch ID
-
@cvp, iPhone/iPad difference?
-
@mikael I've to say that my first run crashed but when I've restarted Pythonista, no more crash
-
-
@mikael That could be, I don't have récent iPhone, thus no experience at all with Face ID
-
-
@mikael As it runs ok on my iPad TouchId, I hope @ClackHack follows this topic and will try the topic you linked if he needs FaceId.
-
@cvp, I would not be surprised if Pythonista is simply not set up for Face ID:
”In any project that uses biometrics, include the NSFaceIDUsageDescription key in your app’s Info.plist file. Without this key, the system won’t allow your app to use Face ID. The value for this key is a string that the system presents to the user the first time your app attempts to use Face ID. The string should clearly explain why your app needs access to this authentication mechanism. The system doesn’t require a comparable usage description for Touch ID.”
-
@cvp, I would not be surprised if Pythonista is simply not set up for Face ID:
Yes, I think that is the problem. I've considered adding a
NSFaceIDUsageDescription
, but I wasn't sure if Apple might have an issue with it because Pythonista doesn't really use FaceID if you don't access it via ObjC (same is true for some other things I've put in the Info.plist though, so I might still just do it in the next update). -
@mikael Hey Mikael, this module should work. It runs without crash on my iphone 11 face-id, and it works with touch-id on my iPad. Have you tried to restart the app? I will look more into this issue.
-
@mikael I find it convenient to use it in the code shortcuts. I named it Scriptlock and the code should read:
import passcode,importlib,sys importlib.reload(passcode) passcode.lock() if not passcode.auth_completed: sys.exit()
-
@ClackHack, which version of iOS and Pythonista are you running on the iPhone?
-
@ClackHack, also, is there some magic in importing
passcode
twice? -
@mikael
I am running on the latest IOS and Pythonista, so pythonista 3.3 and IOS 13.3.1
However it worked on the last Pythonista update, and on past IOS 13 versions. I believe, but cannot say with 100% certainty that it worked on IOS 11 & 12.I used to have issues with it saying that the passcode module was not imported, so I saw online that importlib.reload would fix that. It is completely vestigial I believe, but I like to err on the side of caution!