Skip to content

Commit 5fc983c

Browse files
committed
holy shit why you guys 脱了裤子放屁
1 parent 5844866 commit 5fc983c

14 files changed

+52
-346
lines changed

Diff for: .gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,4 @@ debs/*
99
_/*
1010
*/obj/*
1111
**/obj/*
12-
*.zip
13-
layout/DEBIAN/extrainst_
14-
layout/DEBIAN/postrm
12+
*.zip

Diff for: Makefile

+8-47
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,15 @@
1-
TARGET =: clang:14.5:7.0
21
ARCHS = arm64 arm64e
3-
PREFIX = $(THEOS)/toolchain/Xcode11.xctoolchain/usr/bin/
2+
TARGET = iphone:clang:latest:14.0
3+
44
DEBUG = 0
55
GO_EASY_ON_ME = 1
66

7-
THEOS_PACKAGE_DIR_NAME = debs
8-
PACKAGE_VERSION = $(THEOS_PACKAGE_BASE_VERSION)
9-
10-
THEOS_DEVICE_IP = 127.0.0.1 -p 2222
11-
127
include $(THEOS)/makefiles/common.mk
138

14-
TOOL_NAME = postrm killdaemon
15-
16-
postrm_FILES = postrm.mm
17-
postrm_FRAMEWORKS = Foundation
18-
postrm_INSTALL_PATH = /tmp
19-
postrm_CODESIGN_FLAGS = -Sentitlements.xml
20-
21-
killdaemon_FILES = killdaemon.mm
22-
killdaemon_LIBRARIES = z
23-
killdaemon_CODESIGN_FLAGS = -Sentitlements.xml
24-
25-
include $(THEOS_MAKE_PATH)/tool.mk
26-
27-
TWEAK_NAME = afc2dService afc2dSupport
28-
29-
afc2dService_FILES = afc2dService.xm
30-
afc2dService_LIBRARIES = substrate
31-
32-
afc2dSupport_FILES = Tweak.xm
33-
34-
include $(THEOS_MAKE_PATH)/tweak.mk
35-
36-
after-stage::
37-
mv -f $(THEOS_STAGING_DIR)/tmp/postrm ./layout/DEBIAN/postrm
38-
rm -Rf $(THEOS_STAGING_DIR)/tmp
39-
40-
before-package::
41-
sudo chown -R root:wheel $(THEOS_STAGING_DIR)
42-
sudo chmod -R 755 $(THEOS_STAGING_DIR)
43-
sudo chmod 666 $(THEOS_STAGING_DIR)/DEBIAN/control
44-
45-
after-package::
46-
make clean
47-
sudo mv .theos/_ $(THEOS_PACKAGE_NAME)_$(THEOS_PACKAGE_BASE_VERSION)_iphoneos-arm
48-
zip -r .theos/$(THEOS_PACKAGE_NAME)_$(THEOS_PACKAGE_BASE_VERSION)_iphoneos-arm.zip $(THEOS_PACKAGE_NAME)_$(THEOS_PACKAGE_BASE_VERSION)_iphoneos-arm
49-
mv .theos/$(THEOS_PACKAGE_NAME)_$(THEOS_PACKAGE_BASE_VERSION)_iphoneos-arm.zip ./
50-
sudo rm -rf $(THEOS_PACKAGE_NAME)_$(THEOS_PACKAGE_BASE_VERSION)_iphoneos-arm
51-
rm -f ./layout/DEBIAN/postrm
9+
TWEAK_NAME := afc2dService
10+
afc2dService_FILES += afc2dService.xm
11+
afc2dService_CFLAGS += -fobjc-arc
12+
afc2dService_CFLAGS += -DJB_PREFIX=\"/var/jb\"
13+
afc2dService_LIBRARIES += substrate
5214

53-
after-install::
54-
install.exec "killall -9 backboardd"
15+
include $(THEOS_MAKE_PATH)/tweak.mk

Diff for: README.md

+20-21
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
Apple File Conduit "2" (iOS 11+, arm64)
2-
=======================================
1+
# afc2d-arm64
32

4-
**Works on any arm64 device running iOS 11 and higher.**
3+
I really hate these guys who did these piracy things with tons of disclaimers.
4+
I’d like to teach you an old Chinese saying, “你们这就是脱了裤子放屁——多此一举。”.
55

6-
This is a modified version of saurik's original AFC2 code that downloads and installs an arm64 copy of afcd (required on iOS 11 and above) straight from Apple, and then automatically grants it the necessary `platform-application` entitlement required for functionality on KPPLess jailbreaks (like Electra and Meridian).
6+
If someone give this repo a *DMCA takedown*, do as you want. I just want to tease “揶揄” these guys.
77

8-
As a result, **this package does not illegally redistribute copyrighted Apple binaries.**
8+
## WHY...
99

10-
In compliance with saurik's original code being licensed under GPLv3, source code has been released above at the GitHub link.
10+
You just injected a dynamic library into `SpringBoard`...
11+
You just hooked `SpringBoard` and spawned a `killdaemon` process with root privileges...
12+
You just downloaded a legacy `afcd` binary from Apple’s CDN server...
13+
You just used `ldid` and tampered that `afcd` and renamed it to `afc2d`...
14+
You just restarted `lockdownd`...
15+
You just injected `lockdownd` and spawned `afc2d` process instead of the original `afcd`...
1116

12-
## saurik's original explanation of what AFC2 is
17+
Let’s be more straightforward. Please, just bundle the legacy `afcd` binary directly into your package, PLEASE!!!!!!
18+
You just did so many magic(s), but you’re still complaining about redistributing copyrighted Apple binaries??? Oh my dear, your code just **hooked** and **injected** and **fucked** Apple’s processes thousands of times! STOP THAT 掩耳盗铃-like behavior!
1319

14-
AFC stands for "Apple File Conduit" (or at least so says [TheiPhoneWiki](https://www.theiphonewiki.com/wiki/AFC)), and is how computer applications such as iTunes and iPhoto can read and write files from your device over USB.
20+
## If this repo got a *DMCA takedown* by Apple’s request, how can I get the legacy `afcd` binary?
1521

16-
AFC is "jailed" and only allows access to "media" (such as photos, music, and data for apps from the App Store).
22+
To download the original version of legacy `afcd`, use the following command:
1723

18-
This package creates a new service, "AFC2", with full filesystem access.
24+
```bash
25+
$ curl -r 1310657433-1310666346 http://appldnld.apple.com/iOS7/031-3029.20140221.ramz3/com_apple_mobileasset_softwareupdate/92b6344e610f418586f1741231ffab482e6d49fd.zip > 92b6344e610f418586f1741231ffab482e6d49fd
26+
$ perl -MIO::Uncompress::RawInflate -e 'undef $/; my ($in, $out) = (<>, undef); IO::Uncompress::RawInflate::rawinflate(\$in, \$out); print $out;' < 92b6344e610f418586f1741231ffab482e6d49fd > afcd
27+
```
1928

20-
If you use a USB device management tool, it might need AFC2 to fully work.
21-
22-
Historically, getting full (not "jailed") filesystem access was core to the idea "this is a jailbreak". However, due to security concerns, modern "jailbreaks" now avoid installing AFC2 by default.
23-
24-
**Please understand that AFC2 is considered by many to be a security hole: you might not want to provide full USB filesystem access.**
25-
26-
Some AFC2 setups, in particular many that were installed by default with older jailbreaks (such as evasi0n for iOS 6) set a flag that allows this access to not require a "trusted" USB connection :/.
27-
28-
Installing this package will correct that mistake, and is thereby more secure than the "stock" from-jailbreak AFC2 configuration you may be using now.
29-
30-
AFC2 is GPLv3-licensed. See `LICENSE` for more information.
29+
Then rename it to `afc2d`. That’s **identical** to `layout/usr/libexec/afc2d` in this repo.

Diff for: Tweak.xm

-40
This file was deleted.

Diff for: afc2dService.xm

+17-22
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/* AFC2 - the original definition of "jailbreak"
2-
* Copyright (C) 2014 Jay Freeman (saurik)
3-
* Copyright (C) 2018 Cannathea
4-
*/
5-
61
/* GNU General Public License, Version 3 {{{ */
72
/*
83
* Cydia is free software: you can redistribute it and/or modify
@@ -20,24 +15,24 @@
2015
**/
2116
/* }}} */
2217

23-
#include <CoreFoundation/CoreFoundation.h>
24-
#include <Foundation/Foundation.h>
25-
26-
%hookf(CFPropertyListRef, CFPropertyListCreateWithData, CFAllocatorRef allocator, CFDataRef data, CFOptionFlags options, CFPropertyListFormat *format, CFErrorRef *error) {
27-
CFPropertyListRef list(%orig(allocator, data, options, format, error));
28-
NSDictionary *dict((NSDictionary *) list);
18+
#import <CoreFoundation/CoreFoundation.h>
19+
#import <Foundation/Foundation.h>
2920

30-
if ([dict isKindOfClass:[NSDictionary class]] && [dict objectForKey:@"com.apple.afc"] != nil) {
31-
NSMutableDictionary *copy([dict mutableCopy]);
32-
CFRelease(list);
33-
list = (CFPropertyListRef) copy;
34-
35-
[copy setObject:@{
21+
%hookf(CFPropertyListRef, CFPropertyListCreateWithData, CFAllocatorRef allocator, CFDataRef data, CFOptionFlags options, CFPropertyListFormat *format, CFErrorRef *error)
22+
{
23+
NSDictionary *origDict = (NSDictionary *)CFBridgingRelease(%orig);
24+
25+
if ([origDict isKindOfClass:[NSDictionary class]] && origDict[@"com.apple.afc"])
26+
{
27+
NSMutableDictionary *mDict = [origDict mutableCopy];
28+
mDict[@"com.apple.afc2"] = @{
3629
@"AllowUnactivatedService": @true,
3730
@"Label": @"com.apple.afc2",
38-
@"ProgramArguments": @[@"/usr/libexec/afc2d", @"-S", @"-L", @"-d", @"/"],
39-
} forKey:@"com.apple.afc2"];
31+
@"ProgramArguments": @[
32+
(access(JB_PREFIX"/usr/libexec/afc2d", X_OK) != -1) ? @JB_PREFIX"/usr/libexec/afc2d" : @"/usr/libexec/afc2d", @"-S", @"-L", @"-d", @"/"],
33+
};
34+
return CFBridgingRetain(mDict);
4035
}
41-
42-
return list;
43-
}
36+
37+
return (CFPropertyListRef)CFBridgingRetain(origDict);
38+
}

Diff for: afc2dSupport.plist

-13
This file was deleted.

Diff for: easy_spawn.h

-9
This file was deleted.

Diff for: entitlements.xml

-10
This file was deleted.

Diff for: killdaemon.mm

-135
This file was deleted.

0 commit comments

Comments
 (0)