Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CoreFoundation.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def CFTypeTo(value):
bufsize = CFStringGetMaximumSizeForEncoding(l, kCFStringEncodingUTF8) + 1
buf = create_string_buffer(bufsize)
CFStringGetCString(value, buf, bufsize, kCFStringEncodingUTF8)
retval = buf.value
retval = buf.value.decode("utf8")
elif typeid == CFDataGetTypeID():
retval = string_at(CFDataGetBytePtr(value), CFDataGetLength(value))

Expand Down
7 changes: 5 additions & 2 deletions afcroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@

class AFCRoot(AFC):
def __init__(self, amdevice):
s = amdevice.start_service(u'com.apple.afc2')
try:
s = amdevice.start_service(u'com.apple.afc2')
except RuntimeError:
s = amdevice.start_service(u'com.apple.afc')
if s is None:
raise RuntimeError(u'Unable to launch:', u'com.apple.afc2')
raise RuntimeError(u'Unable to launch:', u'com.apple.afc / com.apple.afc2')
AFC.__init__(self, s)