-
Notifications
You must be signed in to change notification settings - Fork 213
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
Add memory limit waiver for pid #1315
base: master
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.
Thanks for your PR! It'll be a very nice feature to have :)).
Please view the submitted notes
@@ -40,6 +40,14 @@ def signal(self, pid: int, sig: int): | |||
self._channel.sendSignal_toPid_(MessageAux().append_obj(sig).append_obj(pid), expects_reply=True) | |||
return self._channel.receive_plist() | |||
|
|||
def memlimitoff(self, pid: int) -> list: |
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.
please add a docstring for the returned list and supply the list with a specific type (e.g. list[dict[str, str]]]
).
I know still most of current API don't use these typing, but I'm trying that at least all new code or modified one will have better typings
""" | ||
Test disabling memory limit. | ||
""" | ||
aggregated = get_process_data(dvt, 'SpringBoard') |
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.
Probably meant springboard
for the variable? or did u actually plan to check with SpringBoard
?
res = ProcessControl(dvt).memlimitoff(aggregated['pid']) | ||
# give the os some time to respond | ||
time.sleep(3) | ||
assert res |
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.
depending on what should be returned, maybe add a better verification
iOS provides strict limits regarding memory usage (especially for extensions).
There is a method
- (NSNumber *)requestDisableMemoryLimitsForPid:(int)arg1;
of header fileDTProcessControlServiceAuthorizedMethods.h
which sounded promising to utilizeBy sending a message call to invoke that method, the iOS responds with either 0 (false) or 1 (true) if memory limit disabling request was declined or satisfied respectively
Full command to test:
Expected command output:
OR