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

This comment has been minimized.

Copy link

@cclauss 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

This comment has been minimized.

Copy link

@controversial controversial commented Dec 19, 2015

Cool script, clever.

@alessaba

This comment has been minimized.

Copy link
Owner Author

@alessaba alessaba commented Dec 20, 2015

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

@Tkizzy

This comment has been minimized.

Copy link

@Tkizzy Tkizzy commented Dec 21, 2015

Cool! thanks.

@cclauss

This comment has been minimized.

Copy link

@cclauss 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

This comment has been minimized.

Copy link
Owner Author

@alessaba 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