Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
KritantaDev authored and KritantaDev committed Apr 28, 2021
0 parents commit cd945fb
Show file tree
Hide file tree
Showing 94 changed files with 6,912 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# DragonBuild/src

This folder contains tools we need to build from source.
14 changes: 14 additions & 0 deletions device/appinfo/DragonMake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: appinfo
icmd: appinfo -e com.apple.mobilenotes
id: me.krit.dragon.appinfo
depends: mobilesubstrate
version: 0.1.0
desc: Command line app info interface
author: krit

appinfo:
type: cli
entfile: ent.xml
files:
- appinfo.mm
78 changes: 78 additions & 0 deletions device/appinfo/appinfo.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// creative commons blah blah
// @krit nov 2020

@import Foundation;
#include <objc/runtime.h>
#include <dlfcn.h>
#include <CoreServices/CoreServices.h>
#include <unistd.h>

@interface LSApplicationProxy : NSObject
@property (nonatomic, retain) NSString *itemName;
@property (nonatomic, retain) NSString *applicationIdentifier;
@property (nonatomic, retain) NSString *bundleExecutable;
@property (nonatomic, retain) NSURL *dataContainerURL;
@property (nonatomic, retain) NSString *canonicalExecutablePath;
@end


NSMutableArray *apps;

NSString *idToExecutable(char *bundle);
NSString *idToPath(char *bundle);
NSString *idToContainer(char *bundle);

void pout(NSString *out)
{
printf([out UTF8String]);
}

int main(int argc, char *argv[])
{
dlopen("/System/Library/Frameworks/CoreServices.framework/CoreServices", 0x4);
Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
//Class LSApplicationProxy_class = objc_getClass("LSApplicationProxy");
SEL selector = NSSelectorFromString(@"defaultWorkspace");
NSObject* workspace = [LSApplicationWorkspace_class performSelector:selector];
SEL selectorALL = NSSelectorFromString(@"allInstalledApplications");

apps = [workspace performSelector:selectorALL];



if (strncmp(argv[1], "-e", 2) == 0)
pout(idToExecutable(argv[2]));
if (strncmp(argv[1], "-p", 2) == 0)
pout(idToPath(argv[2]));
if (strncmp(argv[1], "-c", 2) == 0)
pout(idToContainer(argv[2]));

}


NSString *idToExecutable(char *bundle)
{
for (LSApplicationProxy *app in apps)
{
if ([app.applicationIdentifier isEqualToString:[NSString stringWithUTF8String:bundle]])
return app.bundleExecutable;
}
}

NSString *idToPath(char *bundle)
{
for (LSApplicationProxy *app in apps)
{
if ([app.applicationIdentifier isEqualToString:[NSString stringWithUTF8String:bundle]])
return app.canonicalExecutablePath;
}
}

NSString *idToContainer(char *bundle)
{
for (LSApplicationProxy *app in apps)
{
if ([app.applicationIdentifier isEqualToString:[NSString stringWithUTF8String:bundle]])
return app.dataContainerURL.absoluteString;
}
}
9 changes: 9 additions & 0 deletions device/appinfo/ent.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.private.mobileinstall.allowedSPI</key>
<array>
<string>Lookup</string>
</array>
</dict>
</plist>
Binary file not shown.
16 changes: 16 additions & 0 deletions device/decryptor/DecryptorDragonMake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: decryptor
icmd: true;
id: me.krit.dragon.internal.autodecryptor
depends: mobilesubstrate
version: 0.1.0
desc: Dragon Internal Auto-Decryptor
author: krit

decryptor:
type: tweak
files:
- decrypt.c
stage:
- "mkdir -p .dragon/_/usr/bin/"
- "cp ../inject .dragon/_/usr/bin/inject"
10 changes: 10 additions & 0 deletions device/decryptor/build/.dragon/_/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Architecture: iphoneos-arm
Author: krit
Depends: mobilesubstrate
Description: Dragon Internal Auto-Decryptor
Maintainer: krit
Name: decryptor
Package: me.krit.dragon.internal.autodecryptor
Section: Tweaks
Version: 0.1.0
Installed-Size: 512
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Filter</key>
<dict>
<key>Bundles</key>
<array>
<string>com.microsoft.skype.teams</string>
</array>
</dict>
</dict>
</plist>
Binary file added device/decryptor/build/.dragon/_/usr/bin/inject
Binary file not shown.
Binary file added device/decryptor/build/.dragon/build/.ninja_deps
Binary file not shown.
31 changes: 31 additions & 0 deletions device/decryptor/build/.dragon/build/.ninja_log
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# ninja log v5
0 77 1604368738697405720 .dragon/build/arm64/decrypt.c.o e4ad1f51c32fa947
1 77 1604368738699034297 .dragon/build/arm64e/decrypt.c.o 776a67245f834ec3
0 84 1604368738705960643 .dragon/build/armv7/decrypt.c.o 387fbe78d5945e11
77 230 1604368738850831371 .dragon/build/decryptor.arm64 dc60e05344c184b3
84 230 1604368738849811933 .dragon/build/decryptor.armv7 7ee818a8216fd89f
78 230 1604368738850218747 .dragon/build/decryptor.arm64e 2661b7ca14c75097
230 250 1604368738875640243 .dragon/sign/.dragon/_/Library/MobileSubstrate/DynamicLibraries/decryptor.dylib.unsym 43992a2d52408bdd
250 284 1604368738909493533 .dragon/sign/.dragon/_/Library/MobileSubstrate/DynamicLibraries/decryptor.dylib.unsigned 6d35bc716643ce75
284 298 1604368738923741468 .dragon/_/Library/MobileSubstrate/DynamicLibraries/decryptor.dylib 82bfe1a8bda26540
0 9 0 stage 32fbc80930479ff
1 68 1604368761235683328 .dragon/build/arm64e/decrypt.c.o 776a67245f834ec3
1 69 1604368761235675113 .dragon/build/arm64/decrypt.c.o e4ad1f51c32fa947
1 73 1604368761240726886 .dragon/build/armv7/decrypt.c.o 387fbe78d5945e11
69 207 1604368761373347236 .dragon/build/decryptor.arm64 dc60e05344c184b3
68 207 1604368761373572912 .dragon/build/decryptor.arm64e 2661b7ca14c75097
73 210 1604368761376774558 .dragon/build/decryptor.armv7 7ee818a8216fd89f
210 229 1604368761400095613 .dragon/sign/.dragon/_/Library/MobileSubstrate/DynamicLibraries/decryptor.dylib.unsym 43992a2d52408bdd
229 255 1604368761426620817 .dragon/sign/.dragon/_/Library/MobileSubstrate/DynamicLibraries/decryptor.dylib.unsigned 6d35bc716643ce75
255 269 1604368761440351235 .dragon/_/Library/MobileSubstrate/DynamicLibraries/decryptor.dylib 82bfe1a8bda26540
0 8 0 stage 32fbc80930479ff
0 68 1604369104227063942 .dragon/build/arm64/decrypt.c.o e4ad1f51c32fa947
0 68 1604369104227629380 .dragon/build/arm64e/decrypt.c.o 776a67245f834ec3
0 72 1604369104232190387 .dragon/build/armv7/decrypt.c.o 387fbe78d5945e11
68 227 1604369104383109495 .dragon/build/decryptor.arm64e 2661b7ca14c75097
72 227 1604369104382957409 .dragon/build/decryptor.armv7 7ee818a8216fd89f
68 228 1604369104384367640 .dragon/build/decryptor.arm64 dc60e05344c184b3
228 244 1604369104407590685 .dragon/sign/.dragon/_/Library/MobileSubstrate/DynamicLibraries/decryptor.dylib.unsym 43992a2d52408bdd
244 265 1604369104429144764 .dragon/sign/.dragon/_/Library/MobileSubstrate/DynamicLibraries/decryptor.dylib.unsigned 6d35bc716643ce75
265 278 1604369104442391762 .dragon/_/Library/MobileSubstrate/DynamicLibraries/decryptor.dylib 82bfe1a8bda26540
0 9 0 stage 32fbc80930479ff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions device/decryptor/build/.dragon/last_package
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
me.krit.dragon.internal.autodecryptor_0.1.0_iphoneos-arm.deb
138 changes: 138 additions & 0 deletions device/decryptor/build/.dragon/ninja/..ninja
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name = decryptor
lowername = decryptor

# Build file for decryptor
# Generated at 11/02/20 20:05:04

stagedir = _
location = /Library/MobileSubstrate/DynamicLibraries/
dragondir = $$DRAGONBUILD
sysroot = -isysroot $dragondir/sdks/iPhoneOS.sdk
proj_build_dir = .dragon
objdir = $proj_build_dir/obj
signdir = $proj_build_dir/sign
builddir = $proj_build_dir/build
build_target_file = $proj_build_dir/$stagedir/$location$name.dylib
pwd = .
resource_dir = Resources
toolchain-prefix = arm64-apple-darwin14-

stage = mkdir -p .dragon/_/usr/bin/; cp ../inject .dragon/_/usr/bin/inject
stage2 = cp $name.plist $
$proj_build_dir/_/Library/MobileSubstrate/DynamicLibraries/$name.plist


internalsigntarget = $signdir/$build_target_file.unsigned
internalsymtarget = $signdir/$build_target_file.unsym

fwSearch = -F$dragondir/sdks/iPhoneOS.sdk/System/Library/PrivateFrameworks/ $
-F$dragondir/frameworks
libSearch = -L$dragondir/lib -L.
modulesinternal = -fmodules -fcxx-modules -fmodule-name=$name $
-fbuild-session-file=$proj_build_dir/modules/ $
-fmodules-validate-once-per-build-session -fmodules-prune-after=345600 $
-fmodules-prune-interval=86400

cc = clang
codesign = ldid
cxx = clang++
dsym = dsymutil
ld = clang++
lipo = lipo
logos = $dragondir/modules/logos/bin/logos.pl
optool = $dragondir/bin/optool
plutil = plutil
swift = swift

targetvers = 10.0
targetprefix = -miphoneos-version-min=
targetos = iphoneos
triple =

frameworks = -framework UIKit -framework Foundation
libs =

macros =
arc = -fobjc-arc
btarg =
debug = -fcolor-diagnostics
entfile =
entflag = -S
optim = 0
warnings = -Wall

cinclude = -I$dragondir/include -I$dragondir/vendor/include $
-I$dragondir/include/_fallback -I$DRAGONBUILD/headers/ -I$pwd
header_includes =
public_headers =

usrCflags =
usrLDflags =

libflags =
lopts = -dynamiclib -ggdb -Xlinker -segalign -Xlinker 4000
typeldflags =

cflags =
ldflags =
lflags =
lfflags =
swiftflags =

theosshim =
internalcflags = $cinclude $debug $fwSearch $cflags $btarg -O$optim $
$targetprefix$targetvers $sysroot $header_includes $arc $triple $
$theosshim $macros $warnings $modulesinternal
internalldflags = -framework CydiaSubstrate
internallflags = $internalcflags $typeldflags $frameworks $libs $libflags $
$lopts $libSearch $ldflags $libs
internallfflags =
internalswiftflags = -color-diagnostics -enable-objc-interop $
-sdk/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk $
-L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos $
-g -L/usr/lib/swift -swift-version 5 -module-name $name

rule linkarmv7
command = $ld -arch armv7 $internallflags $internalldflags -o $out $in
description = Linking $in with $ld [armv7]
rule linkarm64
command = $ld -arch arm64 $internallflags $internalldflags -o $out $in
description = Linking $in with $ld [arm64]
rule linkarm64e
command = $ld -arch arm64e $internallflags $internalldflags -o $out $in
description = Linking $in with $ld [arm64e]
rule carm64
command = $cc -arch arm64 $internalcflags -c $in -o $out
description = Compiling $in with $cc [arm64]
rule stage
command = $stage && $stage2
description = Running Stage for $name
rule lipo
command = $lipo -create $in -output $out
description = Merging architechtures
rule carm64e
command = $cc -arch arm64e $internalcflags -c $in -o $out
description = Compiling $in with $cc [arm64e]
rule sign
command = $codesign $entflag$entfile $in && cp $in $out
description = Signing $name
rule carmv7
command = $cc -arch armv7 $internalcflags -c $in -o $out
description = Compiling $in with $cc [armv7]
rule debug
command = $dsym \"$in\" 2&> /dev/null; cp $in $out
description = Generating Debug Symbols for $name

build $builddir/armv7/decrypt.c.o: carmv7 decrypt.c
build $builddir/$name.armv7: linkarmv7 $builddir/armv7/decrypt.c.o
build $builddir/arm64/decrypt.c.o: carm64 decrypt.c
build $builddir/$name.arm64: linkarm64 $builddir/arm64/decrypt.c.o
build $builddir/arm64e/decrypt.c.o: carm64e decrypt.c
build $builddir/$name.arm64e: linkarm64e $builddir/arm64e/decrypt.c.o
build $internalsymtarget: lipo $builddir/$name.armv7 $builddir/$name.arm64 $
$builddir/$name.arm64e
build $internalsigntarget: debug $internalsymtarget
build $build_target_file: sign $internalsigntarget
build stage: stage build.ninja

default $build_target_file
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions device/decryptor/build/DragonMake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: decryptor
icmd: true;
id: me.krit.dragon.internal.autodecryptor
depends: mobilesubstrate
version: 0.1.0
desc: Dragon Internal Auto-Decryptor
author: krit

decryptor:
type: tweak
files:
- decrypt.c
stage:
- "mkdir -p .dragon/_/usr/bin/"
- "cp ../inject .dragon/_/usr/bin/inject"
Loading

0 comments on commit cd945fb

Please sign in to comment.