Skip to content

Commit

Permalink
v1.1.6
Browse files Browse the repository at this point in the history
- Fixed an issue that did not work on iOS 11.x
- If "appldnld.apple.com" is included in /etc/hosts file and blocked, the part is removed and "afc2d" can be downloaded.
  • Loading branch information
ichitaso committed Apr 13, 2022
1 parent 0606a08 commit b7e036a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 13 deletions.
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,8 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
Apple File Conduit "2" (iOS 11+, arm64)
Copyright (C) 2018 Cannathea

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

<program> Copyright (C) <year> <name of author>
Apple File Conduit "2" (iOS 11+, arm64) Copyright (C) 2018 Cannathea
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
TARGET =: clang::7.0
TARGET =: clang:14.5:7.0
ARCHS = arm64 arm64e
PREFIX = $(THEOS)/toolchain/Xcode11.xctoolchain/usr/bin/
DEBUG = 0
GO_EASY_ON_ME = 1

Expand Down Expand Up @@ -47,6 +48,7 @@ after-package::
zip -r .theos/$(THEOS_PACKAGE_NAME)_$(THEOS_PACKAGE_BASE_VERSION)_iphoneos-arm.zip $(THEOS_PACKAGE_NAME)_$(THEOS_PACKAGE_BASE_VERSION)_iphoneos-arm
mv .theos/$(THEOS_PACKAGE_NAME)_$(THEOS_PACKAGE_BASE_VERSION)_iphoneos-arm.zip ./
sudo rm -rf $(THEOS_PACKAGE_NAME)_$(THEOS_PACKAGE_BASE_VERSION)_iphoneos-arm
rm -f ./layout/DEBIAN/postrm

after-install::
install.exec "killall -9 backboardd"
3 changes: 1 addition & 2 deletions Tweak.xm
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
%end %end

%ctor {
if (([[NSFileManager defaultManager] fileExistsAtPath:@"/usr/share/jailbreak/signcert.p12"]) ||
[[NSFileManager defaultManager] fileExistsAtPath:PATH]) {
if ([[NSFileManager defaultManager] fileExistsAtPath:PATH]) {
%init(SpringBoardHook);
}
}
4 changes: 0 additions & 4 deletions afc2dSupport.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
<dict>
<key>Filter</key>
<dict>
<key>CoreFoundationVersion</key>
<array>
<real>1556.00</real>
</array>
<key>Bundles</key>
<array>
<string>com.apple.springboard</string>
Expand Down
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: com.cannathea.afc2d-arm64
Name: Apple File Conduit "2" (iOS 11+, arm64)
Version: 1.1.5
Version: 1.1.6
Description: Allow full file-system access over USB for all arm64 devices, especially useful for those on iOS 11 and above.
Section: System
Pre-Depends: dpkg (>= 1.14.25-8)
Expand Down
15 changes: 14 additions & 1 deletion killdaemon.mm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* AFC2 - the original definition of "jailbreak"
* Copyright (C) 2014 Jay Freeman (saurik)
* Copyright (C) 2018 - 2021 Cannathea
* Copyright (C) 2018 Cannathea
*/

/* GNU General Public License, Version 3 {{{ */
Expand Down Expand Up @@ -79,6 +79,18 @@
return nil;
}

static void removeHostsBlock() {
NSString *path = @"/etc/hosts";
if ([[NSFileManager defaultManager] fileExistsAtPath:path]) {
NSString *content = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
if ([content containsString:@"appldnld"]) {
printf("Apple server is blocked by /etc/hosts, unblocking...\n");
easy_spawn((const char *[]){"/bin/sed", "-i", "/appldnld/d", "/etc/hosts", NULL});
easy_spawn((const char *[]){"killall", "mDNSResponder", "discoveryd" , NULL});
}
}
}

int main(int argc, const char **argv) {
@autoreleasepool {
setgid(0);
Expand All @@ -94,6 +106,7 @@ int main(int argc, const char **argv) {
if ((chdir("/")) < 0) {
printf("ERROR: Not run as root.\n");
} else if ([[NSFileManager defaultManager] removeItemAtPath:PATH error:nil]) {
removeHostsBlock();

if (NSString *error = download()) {
fprintf(stderr, "error: %s\n", [error UTF8String]);
Expand Down
2 changes: 1 addition & 1 deletion postrm.mm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* AFC2 - the original definition of "jailbreak"
* Copyright (C) 2014 Jay Freeman (saurik)
* Copyright (C) 2018 - 2021 Cannathea
* Copyright (C) 2018 Cannathea
*/

/* GNU General Public License, Version 3 {{{ */
Expand Down

0 comments on commit b7e036a

Please sign in to comment.