-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fixes #81: Supervision mode #82
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling and removing supervision did work in my tests, but SSH doesn't come back afterwards (#81 (comment)).
With my iOS 15 on palera1n-c, SSH does now come back after the userspace restart but I am still getting an error in
Removing supervision doesn't throw an error, but that's only because it doesn't wait for the device to come back. If I wanted to run another command afterwards, it would fail. |
Curiously, on the other iPhone with iOS 16 (still on palera1n-legacy), it just hangs after removing supervision, even after the process is already done. Afterwards, I need to do "" in the palera1n app to get SSH back. Enabling supervision also hangs after the phone has "rebooted". |
Also, I wouldn't consider this ready to merge unless the device is actually ready to be used again automatically (i.e. unlocked) after enabling or removing supervision. |
I have researched a bit into how to unlock devices automatically, and I would like to finish this, but I am unsure of how much time I should poor into this now. I could try to get it done in 5 hours and if that works out fine we merge and if not, we move on for now. |
Five hours is a lot… |
@@ -285,6 +285,9 @@ export type PlatformApi< | |||
: Platform extends 'ios' | |||
? (proxy: Proxy | null) => Promise<void> | |||
: never; | |||
|
|||
/** Simulates key presses to unlock the screen. This only works if no passcode is set on the device. */ | |||
unlockScreen: () => Promise<void>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screen unlocking seems like something worthy of inclusion in the README feature list.
python('pymobiledevice3', ['processes', 'ps', '--no-color']).then(({ stdout }) => | ||
Object.values(JSON.parse(stdout) as Record<string, Record<string, string>>).some( | ||
(p) => p['ProcessName'] === 'assistivetouchd' | ||
) | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use Frida's device.enumerateProcesses()
since we need Frida here anyway?
Object.getOwnPropertyNames(atServer) | ||
atServer._home() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object.getOwnPropertyNames(atServer) | |
atServer._home() | |
Object.getOwnPropertyNames(atServer); | |
atServer._home(); |
); | ||
// TODO: Enable AssistiveTouch automatically. This can be done via lockdownd, but is not supported by pymobiledevice3, yet. | ||
}); | ||
// Since assistivetouchd always crashes after the simulated home button press, we need to wait for it to restart. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't reproduce that crashing on either of my iPhones. But I guess if you want to keep the waiting, you should also wait after the second home button press. Otherwise, I would two unlockScreen()
calls to fail1 on your device.
Footnotes
-
With a prompt to enable Assistive Touch, which is wrong in that case. ↩
@@ -326,6 +329,29 @@ export type PlatformApi< | |||
*/ | |||
setupEnvironment: () => Promise<void>; | |||
ensureFrida: () => Promise<void>; | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should advertise enabling and disabling supervision without resetting on rooted devices in the feature list as well.
('supervision' extends Capability | ||
? { | ||
/** | ||
* The password of the private key of the supervision certificate, defaults to `appstraction` if | ||
* not set. | ||
*/ | ||
supervisionKeyPassword?: string; | ||
} | ||
: unknown); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't we say we wanted to disable the capability until it is actually needed for anything?
I'm still getting ECONNRESET in the supervision operations during the reboot:
And I'm pretty sure you've already spent a lot more than 5 hours… |
No description provided.