Skip to content

Commit

Permalink
Merge branch 'roothide:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
bankm1 authored Dec 8, 2024
2 parents 945d10f + e5dfe4b commit 59783bd
Show file tree
Hide file tree
Showing 30 changed files with 286 additions and 89 deletions.
24 changes: 24 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"files.associations": {
"__locale": "c",
"__tree": "c",
"bitset": "c",
"set": "c",
"syslimits.h": "c",
"mman.h": "c",
"fcntl.h": "c",
"_pthread_types.h": "c",
"_pthread_t.h": "c",
"signal.h": "c",
"algorithm": "cpp",
"__bit_reference": "c",
"chrono": "c",
"map": "c",
"unordered_map": "c",
"pwd.h": "c",
"libgen.h": "c",
"libproc.h": "c",
"proc_info.h": "c",
"libproc_private.h": "c"
}
}
16 changes: 8 additions & 8 deletions Bootstrap.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
84438D602B26546E00A1E407 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84438D5F2B26546E00A1E407 /* MobileCoreServices.framework */; };
84438D622B2654EB00A1E407 /* MobileContainerManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84438D612B2654EB00A1E407 /* MobileContainerManager.framework */; };
84438D652B27522400A1E407 /* envbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = 84438D642B27522400A1E407 /* envbuf.c */; };
84438D6C2B2CDE0100A1E407 /* AppList.m in Sources */ = {isa = PBXBuildFile; fileRef = 84438D682B2CDE0100A1E407 /* AppList.m */; };
84438D6C2B2CDE0100A1E407 /* AppInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 84438D682B2CDE0100A1E407 /* AppInfo.m */; };
84438D6D2B2CDE0100A1E407 /* AppViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84438D6B2B2CDE0100A1E407 /* AppViewController.m */; };
84438D6F2B2CE5A300A1E407 /* AppEnabler.m in Sources */ = {isa = PBXBuildFile; fileRef = 84438D6E2B2CE5A300A1E407 /* AppEnabler.m */; };
847099872B1D855D003FA4ED /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 847099862B1D855D003FA4ED /* AppDelegate.m */; };
Expand Down Expand Up @@ -83,8 +83,8 @@
84438D612B2654EB00A1E407 /* MobileContainerManager.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileContainerManager.framework; path = Bootstrap/Frameworks/MobileContainerManager.framework; sourceTree = "<group>"; };
84438D632B27522400A1E407 /* envbuf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = envbuf.h; sourceTree = "<group>"; };
84438D642B27522400A1E407 /* envbuf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = envbuf.c; sourceTree = "<group>"; };
84438D682B2CDE0100A1E407 /* AppList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppList.m; sourceTree = "<group>"; };
84438D692B2CDE0100A1E407 /* AppList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppList.h; sourceTree = "<group>"; };
84438D682B2CDE0100A1E407 /* AppInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppInfo.m; sourceTree = "<group>"; };
84438D692B2CDE0100A1E407 /* AppInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppInfo.h; sourceTree = "<group>"; };
84438D6A2B2CDE0100A1E407 /* AppViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppViewController.h; sourceTree = "<group>"; };
84438D6B2B2CDE0100A1E407 /* AppViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppViewController.m; sourceTree = "<group>"; };
84438D6E2B2CE5A300A1E407 /* AppEnabler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppEnabler.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -190,8 +190,8 @@
FE0633B52B41CF6600B94787 /* Views */,
FE0633B42B41CF5800B94787 /* Extensions */,
FE0633B32B41CF4D00B94787 /* Classes */,
84438D692B2CDE0100A1E407 /* AppList.h */,
84438D682B2CDE0100A1E407 /* AppList.m */,
84438D692B2CDE0100A1E407 /* AppInfo.h */,
84438D682B2CDE0100A1E407 /* AppInfo.m */,
847099852B1D855D003FA4ED /* AppDelegate.h */,
847099862B1D855D003FA4ED /* AppDelegate.m */,
847099882B1D855D003FA4ED /* SceneDelegate.h */,
Expand Down Expand Up @@ -378,7 +378,7 @@
847099982B1D855E003FA4ED /* main.m in Sources */,
84438D522B260FEB00A1E407 /* zstd_wrapper.m in Sources */,
8470998A2B1D855D003FA4ED /* SceneDelegate.m in Sources */,
84438D6C2B2CDE0100A1E407 /* AppList.m in Sources */,
84438D6C2B2CDE0100A1E407 /* AppInfo.m in Sources */,
84438D6D2B2CDE0100A1E407 /* AppViewController.m in Sources */,
84438D5D2B264A2800A1E407 /* NSUserDefaults+appDefaults.m in Sources */,
);
Expand Down Expand Up @@ -571,7 +571,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.3;
MARKETING_VERSION = 1.3;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.roothide.Bootstrap;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -609,7 +609,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2.3;
MARKETING_VERSION = 1.3;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.roothide.Bootstrap;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions Bootstrap/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ @implementation AppDelegate

+ (void)addLogText:(NSString*)text
{
SYSLOG("addLogText: %@", text);
[NSNotificationCenter.defaultCenter postNotificationName:@"LogMsgNotification" object:text];
}

Expand Down
2 changes: 1 addition & 1 deletion Bootstrap/AppEnabler.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import <Foundation/Foundation.h>
#include <sys/stat.h>
#include "AppList.h"
#include "AppInfo.h"
#include "common.h"

NSString * relativize(NSURL * to, NSURL * from, BOOL fromIsDir) {
Expand Down
2 changes: 1 addition & 1 deletion Bootstrap/AppList.h → Bootstrap/AppInfo.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import <UIKit/UIKit.h>


@interface AppList : NSObject
@interface AppInfo : NSObject
@property (nonatomic, strong) NSString *infoPlistPath;

@property (nonatomic, readonly) NSString* bundleIdentifier;
Expand Down
4 changes: 2 additions & 2 deletions Bootstrap/AppList.m → Bootstrap/AppInfo.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://github.com/wujianguo/iOSAppsInfo
// modified by Shadow-

#import "AppList.h"
#import "AppInfo.h"
#import <dlfcn.h>

@interface UIImage ()
Expand Down Expand Up @@ -42,7 +42,7 @@ + (instancetype)applicationProxyForIdentifier:(NSString*)identifier;
@end


@implementation AppList
@implementation AppInfo
{
PrivateApi_LSApplicationProxy* _applicationProxy;
UIImage* _icon;
Expand Down
24 changes: 12 additions & 12 deletions Bootstrap/AppViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#import "AppViewController.h"
#include "AppDelegate.h"
#import "AppList.h"
#import "AppInfo.h"
#include "common.h"
#include "AppDelegate.h"
#include <sys/stat.h>
Expand Down Expand Up @@ -54,7 +54,7 @@ -(void)reloadSearch {
isFiltered = true;
filteredApps = [[NSMutableArray alloc] init];
searchText = searchText.lowercaseString;
for (AppList* app in appsArray) {
for (AppInfo* app in appsArray) {
NSRange nameRange = [app.name.lowercaseString rangeOfString:searchText options:NSCaseInsensitiveSearch];
NSRange bundleIdRange = [app.bundleIdentifier.lowercaseString rangeOfString:searchText options:NSCaseInsensitiveSearch];
if(nameRange.location != NSNotFound || bundleIdRange.location != NSNotFound) {
Expand Down Expand Up @@ -127,7 +127,7 @@ - (void)viewWillAppear:(BOOL)animated {
[self.tableView.refreshControl endRefreshing];
}

-(BOOL)tweakEnabled:(AppList*)app {
-(BOOL)tweakEnabled:(AppInfo*)app {
struct stat st;
if(lstat([app.bundleURL.path stringByAppendingPathComponent:@".jbroot"].fileSystemRepresentation, &st)==0) {
return YES;
Expand Down Expand Up @@ -156,7 +156,7 @@ - (void)updateData:(BOOL)sort {

for(id proxy in allInstalledApplications)
{
AppList* app = [AppList appWithPrivateProxy:proxy];
AppInfo* app = [AppInfo appWithPrivateProxy:proxy];

// if(app.isHiddenApp) continue;

Expand Down Expand Up @@ -196,7 +196,7 @@ - (void)updateData:(BOOL)sort {

if(sort)
{
NSArray *appsSortedByName = [applications sortedArrayUsingComparator:^NSComparisonResult(AppList *app1, AppList *app2) {
NSArray *appsSortedByName = [applications sortedArrayUsingComparator:^NSComparisonResult(AppInfo *app1, AppInfo *app2) {

BOOL enabled1 = [self tweakEnabled:app1];
BOOL enabled2 = [self tweakEnabled:app2];
Expand All @@ -217,9 +217,9 @@ - (void)updateData:(BOOL)sort {
else
{
NSMutableArray *newapps = [NSMutableArray array];
[applications enumerateObjectsUsingBlock:^(AppList *newobj, NSUInteger idx, BOOL * _Nonnull stop) {
[applications enumerateObjectsUsingBlock:^(AppInfo *newobj, NSUInteger idx, BOOL * _Nonnull stop) {
__block BOOL hasBeenContained = NO;
[self->appsArray enumerateObjectsUsingBlock:^(AppList *obj, NSUInteger idx, BOOL * _Nonnull stop) {
[self->appsArray enumerateObjectsUsingBlock:^(AppInfo *obj, NSUInteger idx, BOOL * _Nonnull stop) {
if ([obj.bundleIdentifier isEqualToString:newobj.bundleIdentifier]) {
hasBeenContained = YES;
*stop = YES;
Expand All @@ -231,8 +231,8 @@ - (void)updateData:(BOOL)sort {
}];

NSMutableArray *tmpArray = [NSMutableArray array];
[self->appsArray enumerateObjectsUsingBlock:^(AppList *obj, NSUInteger idx, BOOL * _Nonnull stop) {
[applications enumerateObjectsUsingBlock:^(AppList *newobj, NSUInteger idx, BOOL * _Nonnull stop) {
[self->appsArray enumerateObjectsUsingBlock:^(AppInfo *obj, NSUInteger idx, BOOL * _Nonnull stop) {
[applications enumerateObjectsUsingBlock:^(AppInfo *newobj, NSUInteger idx, BOOL * _Nonnull stop) {
if ([obj.bundleIdentifier isEqualToString:newobj.bundleIdentifier]) {
[tmpArray addObject:newobj];
*stop = YES;
Expand Down Expand Up @@ -291,7 +291,7 @@ - (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize {
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"];

AppList* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row];
AppInfo* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row];

if(!app.isHiddenApp) {
UIImage *image = app.icon;
Expand Down Expand Up @@ -328,7 +328,7 @@ - (void)switchChanged:(id)sender {
CGPoint pos = [switchInCell convertPoint:switchInCell.bounds.origin toView:self.tableView];
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:pos];
BOOL enabled = switchInCell.on;
AppList* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row];
AppInfo* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row];

dispatch_async(dispatch_get_global_queue(0, 0), ^{
[AppDelegate showHudMsg:Localized(@"Applying")];
Expand Down Expand Up @@ -365,7 +365,7 @@ - (void)cellLongPress:(UIGestureRecognizer *)recognizer
long tag = recognizer.view.tag;
NSIndexPath* indexPath = [NSIndexPath indexPathForRow:tag&0xFFFFFFFF inSection:tag>>32];

AppList* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row];
AppInfo* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row];

dispatch_async(dispatch_get_global_queue(0, 0), ^{
PrivateApi_LSApplicationWorkspace* _workspace = [NSClassFromString(@"LSApplicationWorkspace") new];
Expand Down
Loading

0 comments on commit 59783bd

Please sign in to comment.