Skip to content

Instantly share code, notes, and snippets.

@alessaba
Last active Dec 24, 2015
Embed
What would you like to do?
JailbreakTest.py
# coding: utf-8
import os
def is_device_jailbroken():
try:
os.listdir('/private')
except OSError:
return False
return True
print 'Is my device jailbroken:', is_device_jailbroken()
@cclauss
Copy link

cclauss commented Dec 19, 2015

Would you get the same effect with os.listdir('/private') or do you need to do both chdir() and listdir()?

@controversial
Copy link

controversial commented Dec 19, 2015

Cool script, clever.

@alessaba
Copy link
Author

alessaba commented Dec 20, 2015

@cclauss You're right. Changed that line :-)
@The-Penultimate-Defenestrator Thanks :-)

@Tkizzy
Copy link

Tkizzy commented Dec 21, 2015

Cool! thanks.

@cclauss
Copy link

cclauss commented Dec 21, 2015

It would be easier to consume if it was defined as a function...

import os

def is_device_jailbroken():
    try:
        os.listdir('/private')
    except OSError:
        return False
    return True

print('Is my device jailbroken: '+ str(is_device_jailbroken()))

@alessaba
Copy link
Author

alessaba commented Dec 24, 2015

Yea, if you want...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment