Skip to content

Commit

Permalink
finished
Browse files Browse the repository at this point in the history
  • Loading branch information
RootHide authored and RootHide committed Sep 20, 2023
1 parent 83f4179 commit 7e5a39a
Show file tree
Hide file tree
Showing 33 changed files with 326 additions and 120 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,24 @@ CONTENTS =
SCHEME = Sileo
BUILD_CONFIG = Release
SILEO_APP_DIR = $(SILEOTMP)/Build/Products/Release-iphoneos/Sileo.app

else ifeq ($(SILEO_PLATFORM),iphoneos-arm64)
ARCH = arm64
PLATFORM = iphoneos
DEB_ARCH = iphoneos-arm64
DESTINATION =
CONTENTS =
PREFIX = /var/jb
SCHEME = Sileo
BUILD_CONFIG = Release
SILEO_APP_DIR = $(SILEOTMP)/Build/Products/Release-iphoneos/Sileo.app

else ifeq ($(SILEO_PLATFORM),iphoneos-arm64e)
ARCH = arm64
PLATFORM = iphoneos
DEB_ARCH = iphoneos-arm64e
DESTINATION =
CONTENTS =
PREFIX =
SCHEME = Sileo
BUILD_CONFIG = Release
Expand Down
12 changes: 6 additions & 6 deletions Sileo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
49FB3894266074B90029CAFF /* SileoRootWrapper.bundle in Embed PlugIns */ = {isa = PBXBuildFile; fileRef = 49FB388B2660745F0029CAFF /* SileoRootWrapper.bundle */; platformFilter = maccatalyst; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
56A5989B214657A700677FCA /* ZKSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 56A5989A214657A700677FCA /* ZKSwizzle.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
56A5989D214657BB00677FCA /* WhiteBlur.m in Sources */ = {isa = PBXBuildFile; fileRef = 56A5989C214657BB00677FCA /* WhiteBlur.m */; };
84FC346A2A64924700A48F2A /* libjbpath.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 84FC34692A64918B00A48F2A /* libjbpath.dylib */; platformFilter = ios; settings = {ATTRIBUTES = (Required, ); }; };
842F23EF2AA3251B00EE2E9A /* libroothide.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 842F23ED2AA3250800EE2E9A /* libroothide.tbd */; };
A8A0EA4B2665AAC900CD772C /* libzstd.1.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A8A0EA492665AAC900CD772C /* libzstd.1.tbd */; settings = {ATTRIBUTES = (Required, ); }; };
C305468621D6900C003E73FC /* PackageListHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = C305468521D6900C003E73FC /* PackageListHeader.xib */; };
C373923621D5E46900E6F704 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C373923421D5E46900E6F704 /* Localizable.strings */; };
Expand Down Expand Up @@ -1292,9 +1292,9 @@
56A5989A214657A700677FCA /* ZKSwizzle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZKSwizzle.m; sourceTree = "<group>"; };
56A5989C214657BB00677FCA /* WhiteBlur.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WhiteBlur.m; sourceTree = "<group>"; };
56A5989E2146584800677FCA /* WhiteBlur.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WhiteBlur.h; sourceTree = "<group>"; };
84332B042A646A3600D79A9B /* jbroot.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = jbroot.h; sourceTree = "<group>"; };
842F23ED2AA3250800EE2E9A /* libroothide.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; path = libroothide.tbd; sourceTree = "<group>"; };
842F23EE2AA3250800EE2E9A /* roothide.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = roothide.h; sourceTree = "<group>"; };
84EC03382A51048500D3DDB3 /* libjbpath.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libjbpath.dylib; path = ../jbpath/.theos/obj/debug/libjbpath.dylib; sourceTree = "<group>"; };
84FC34692A64918B00A48F2A /* libjbpath.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libjbpath.dylib; sourceTree = "<group>"; };
A8A0EA492665AAC900CD772C /* libzstd.1.tbd */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.text-based-dylib-definition"; path = libzstd.1.tbd; sourceTree = "<group>"; };
A8A0EA4A2665AAC900CD772C /* libzstd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libzstd.h; sourceTree = "<group>"; };
C305468521D6900C003E73FC /* PackageListHeader.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PackageListHeader.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1716,7 +1716,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
84FC346A2A64924700A48F2A /* libjbpath.dylib in Frameworks */,
842F23EF2AA3251B00EE2E9A /* libroothide.tbd in Frameworks */,
E14C5ED126680E030080BFCE /* libz.tbd in Frameworks */,
E14C5EC7266803EA0080BFCE /* libbz2.tbd in Frameworks */,
E13638F22614F6C000698D55 /* SQLite in Frameworks */,
Expand Down Expand Up @@ -2616,8 +2616,8 @@
F149E0A420B6040B005CA30B = {
isa = PBXGroup;
children = (
84332B042A646A3600D79A9B /* jbroot.h */,
84FC34692A64918B00A48F2A /* libjbpath.dylib */,
842F23ED2AA3250800EE2E9A /* libroothide.tbd */,
842F23EE2AA3250800EE2E9A /* roothide.h */,
F149E0AF20B6040B005CA30B /* Sileo */,
493B23BE260979AF007D605F /* Sileo Demo */,
4975C4EF2647750D00D344B0 /* giveMeRoot */,
Expand Down
4 changes: 2 additions & 2 deletions Sileo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class SileoAppDelegate: UIResponder, UIApplicationDelegate, UITabBarControllerDe
// let prefix = CommandPath.prefix
// let old = EvanderNetworking._cacheDirectory //but why stil got file:///var/mobile/Library/Caches/Sileo
// EvanderNetworking._cacheDirectory = URL(fileURLWithPath: prefix + old.path)
// NSLog("old=\(old), new=\(EvanderNetworking._cacheDirectory)")
// NSLog("CACHE_FORCE=\(EvanderNetworking.CACHE_FORCE), url=\(FileManager.default.urls(for: EvanderNetworking.CACHE_FORCE, in: .userDomainMask)[0]))")
// NSLog("SileoLog: old=\(old), new=\(EvanderNetworking._cacheDirectory)")
// NSLog("SileoLog: CACHE_FORCE=\(EvanderNetworking.CACHE_FORCE), url=\(FileManager.default.urls(for: EvanderNetworking.CACHE_FORCE, in: .userDomainMask)[0]))")
// if prefix != "" && old.dirExists {
// deleteFileAsRoot(old)
// }
Expand Down
2 changes: 1 addition & 1 deletion Sileo/Backend/APT Wrapper/APTJsonParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ struct ErrorParserWrapper: Decodable {
extension APTWrapper {
// APT syntax: a- = remove a; b = install b
public class func operationList(installList: Set<DownloadPackage>, removeList: Set<DownloadPackage>) throws -> APTOutput {
Thread.callStackSymbols.forEach{NSLog("callstack=\($0)")}
//Thread.callStackSymbols.forEach{NSLog("SileoLog: operationList callstack=\($0)")}

// Error check stuff
guard !(installList.isEmpty && removeList.isEmpty) else {
Expand Down
2 changes: 1 addition & 1 deletion Sileo/Backend/APT Wrapper/APTWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class APTWrapper {
spawnStatus = posix_spawn(&pid, giveMeRootPath, &fileActions, nil, argv + [nil], env + [nil])
}

NSLog("spawn2=\(arguments)")
NSLog("SileoLog: spawn2=\(arguments)")

if spawnStatus != 0 {
return
Expand Down
1 change: 1 addition & 0 deletions Sileo/Backend/DPKG Wrapper/DPKGArchitecture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct DPKGArchitecture {
enum Architecture: String, Decodable {
case rootful = "iphoneos-arm"
case rootless = "iphoneos-arm64"
case roothide = "iphoneos-arm64e"
case intel = "darwin-amd64"
case applesilicon = "darwin-arm64"
}
Expand Down
11 changes: 8 additions & 3 deletions Sileo/Backend/DPKG Wrapper/DpkgWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ class DpkgWrapper {
let defaultArchitectures: DPKGArchitecture = DPKGArchitecture(primary: .applesilicon, foreign: [])
#else
let defaultArchitectures: DPKGArchitecture
if Bootstrap.rootless {
defaultArchitectures = DPKGArchitecture(primary: .rootless, foreign: [])
if Bootstrap.roothide {
defaultArchitectures = DPKGArchitecture(primary: .roothide, foreign: [.rootless])
} else if Bootstrap.rootless {
defaultArchitectures = DPKGArchitecture(primary: .rootless, foreign: [])
} else {
defaultArchitectures = DPKGArchitecture(primary: .rootful, foreign: [])
}
NSLog("defaultArch=\(defaultArchitectures.primary.rawValue)")
NSLog("SileoLog: defaultArch=\(defaultArchitectures.primary.rawValue)")
#endif
#if targetEnvironment(simulator) || TARGET_SANDBOX
print("Default Archs: \(defaultArchitectures)")
Expand All @@ -98,6 +100,9 @@ class DpkgWrapper {
_foreign.insert(arch)
}
}
if Bootstrap.roothide {
_foreign.insert(DPKGArchitecture.Architecture.rootless)
}
return DPKGArchitecture(primary: arch, foreign: _foreign)
#endif
}()
Expand Down
4 changes: 3 additions & 1 deletion Sileo/Backend/DatabaseManager/DatabaseManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,12 @@ class DatabaseManager {
}

public func deleteRepo(repo: Repo) {
if !repo.archAvailabile {
return
}
let file = RepoManager.shared.cacheFile(named: "Packages", for: repo).lastPathComponent
let repoURL = Expression<String>("repoURL")
let packages = Table("Packages")
_ = try? database.run(packages.filter(repoURL == file).delete())
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class DependencyResolverAccelerator {
}

public func removeRepo(repo: Repo) {
if !repo.archAvailabile {
return
}
let url = RepoManager.shared.cacheFile(named: "Packages", for: repo)
let newSourcesFile = depResolverPrefix.appendingPathComponent(url.lastPathComponent)
toBePreflighted.removeValue(forKey: url)
Expand Down
Loading

0 comments on commit 7e5a39a

Please sign in to comment.