Skip to content

Commit 7e66445

Browse files
RootHideRootHide
authored andcommitted
beta 4.2
1: Fix the issue where Sileo prompts an error when installing packages (this is caused by other legacy /var/jb bootstrap that have been installed on your device before) 2: Fixed the issue that tweak preferences cannot be saved in the TweakSettings app 4: Add a check to see if the bootstrap app version is consistent with the currently bootstrapped environment 3: Add prompt information about jailbreak detection
1 parent 4df3152 commit 7e66445

File tree

18 files changed

+95
-19
lines changed

18 files changed

+95
-19
lines changed

Bootstrap.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@
436436
"$(inherited)",
437437
"@executable_path/Frameworks",
438438
);
439-
MARKETING_VERSION = 1.0;
439+
MARKETING_VERSION = 0.4.2;
440440
OTHER_LDFLAGS = "";
441441
PRODUCT_BUNDLE_IDENTIFIER = com.roothide.Bootstrap;
442442
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -470,7 +470,7 @@
470470
"$(inherited)",
471471
"@executable_path/Frameworks",
472472
);
473-
MARKETING_VERSION = 1.0;
473+
MARKETING_VERSION = 0.4.2;
474474
OTHER_LDFLAGS = "";
475475
PRODUCT_BUNDLE_IDENTIFIER = com.roothide.Bootstrap;
476476
PRODUCT_NAME = "$(TARGET_NAME)";
Binary file not shown.

Bootstrap/AppViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ - (void)updateData:(BOOL)sort {
160160

161161
if([app.bundleURL.path.lastPathComponent isEqualToString:@"Bootstrap.app"])
162162
continue;
163+
164+
if([app.bundleIdentifier isEqualToString:NSBundle.mainBundle.bundleIdentifier]
165+
|| [app.bundleIdentifier isEqualToString:@"com.roothide.Bootstrap"])
166+
continue;
163167

164168
[applications addObject:app];
165169
}

Bootstrap/Base.lproj/Main.storyboard

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<nil key="textColor"/>
5353
<nil key="highlightedColor"/>
5454
</label>
55-
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" fixedFrame="YES" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="Bootstrap(beta 4.1)" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="mHC-UO-Fsn">
55+
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" fixedFrame="YES" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="Bootstrap(beta 4.2)" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="mHC-UO-Fsn">
5656
<rect key="frame" x="14" y="34" width="300" height="51"/>
5757
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
5858
<fontDescription key="fontDescription" type="boldSystem" pointSize="42"/>

Bootstrap/ViewController.m

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,13 @@ - (void)viewDidLoad {
6767

6868
if(isSystemBootstrapped())
6969
{
70-
self.bootstraBtn.enabled = NO;
71-
[self.bootstraBtn setTitle:Localized(@"Bootstrapped") forState:UIControlStateDisabled];
70+
if(checkBootstrapVersion()) {
71+
self.bootstraBtn.enabled = NO;
72+
[self.bootstraBtn setTitle:Localized(@"Bootstrapped") forState:UIControlStateDisabled];
73+
} else {
74+
self.bootstraBtn.enabled = YES;
75+
[self.bootstraBtn setTitle:Localized(@"Update") forState:UIControlStateNormal];
76+
}
7277

7378
self.respringBtn.enabled = YES;
7479
self.appEnablerBtn.enabled = YES;
@@ -134,7 +139,7 @@ - (void)viewDidLoad {
134139
uname(&systemInfo);
135140
[AppDelegate addLogText:[NSString stringWithFormat:@"device-model: %s",systemInfo.machine]];
136141

137-
[AppDelegate addLogText:[NSString stringWithFormat:@"app-version: %@/%@",NSBundle.mainBundle.infoDictionary[@"CFBundleVersion"],NSBundle.mainBundle.infoDictionary[@"CFBundleShortVersionString"]]];
142+
[AppDelegate addLogText:[NSString stringWithFormat:@"app-version: %@",NSBundle.mainBundle.infoDictionary[@"CFBundleShortVersionString"]]];
138143

139144
[AppDelegate addLogText:[NSString stringWithFormat:@"boot-session: %@",getBootSession()]];
140145

@@ -162,20 +167,33 @@ - (void)viewDidLoad {
162167

163168
if(isSystemBootstrapped())
164169
{
165-
[self checkServer];
170+
if([self checkServer]) {
171+
[AppDelegate addLogText:Localized(@"bootstrap server check successful")];
172+
}
166173

167174
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkServer)
168175
name:UIApplicationWillEnterForegroundNotification object:nil];
169176
}
177+
178+
if(isBootstrapInstalled() || isSystemBootstrapped()) {
179+
if([UIApplication.sharedApplication canOpenURL:[NSURL URLWithString:@"filza://"]]
180+
|| [LSPlugInKitProxy pluginKitProxyForIdentifier:@"com.tigisoftware.Filza.Sharing"])
181+
{
182+
[AppDelegate showMesage:Localized(@"It seems that you have the Filza app installed, which may be detected as jailbroken. You can enable Tweak for it to hide it.") title:Localized(@"Warnning")];
183+
}
184+
}
170185
}
171186

172-
-(void)checkServer
187+
-(BOOL)checkServer
173188
{
174189
static bool alerted = false;
175-
if(alerted) return;
190+
if(alerted) return NO;
191+
192+
BOOL ret=NO;
176193

177194
if(spawnRoot(jbroot(@"/basebin/bootstrapd"), @[@"check"], nil, nil) != 0)
178195
{
196+
ret = NO;
179197
alerted = true;
180198

181199
UIAlertController *alert = [UIAlertController alertControllerWithTitle:Localized(@"Server Not Running") message:Localized(@"for unknown reasons the bootstrap server is not running, the only thing we can do is to restart it now.") preferredStyle:UIAlertControllerStyleAlert];
@@ -196,9 +214,11 @@ -(void)checkServer
196214

197215
[AppDelegate showAlert:alert];
198216
} else {
199-
[AppDelegate addLogText:Localized(@"bootstrap server check successful")];
200217
[self updateOpensshStatus];
218+
ret = YES;
201219
}
220+
221+
return ret;
202222
}
203223

204224
-(void)updateOpensshStatus {
@@ -373,6 +393,22 @@ - (IBAction)openssh:(id)sender {
373393
}
374394

375395
- (IBAction)bootstrap:(id)sender {
396+
397+
if(isSystemBootstrapped())
398+
{
399+
ASSERT(checkBootstrapVersion()==false);
400+
401+
UIAlertController *alert = [UIAlertController alertControllerWithTitle:Localized(@"Update") message:Localized(@"The current bootstrapped version is inconsistent with the Bootstrap app version, and you need to reboot the device to update it.") preferredStyle:UIAlertControllerStyleAlert];
402+
403+
[alert addAction:[UIAlertAction actionWithTitle:Localized(@"Cancel") style:UIAlertActionStyleDefault handler:nil]];
404+
[alert addAction:[UIAlertAction actionWithTitle:Localized(@"Reboot Device") style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
405+
ASSERT(spawnRoot(NSBundle.mainBundle.executablePath, @[@"reboot"], nil, nil)==0);
406+
}]];
407+
408+
[AppDelegate showAlert:alert];
409+
return;
410+
}
411+
376412
if(![self checkTSVersion]) {
377413
[AppDelegate showMesage:Localized(@"Your trollstore version is too old, Bootstrap only supports trollstore>=2.0") title:Localized(@"Error")];
378414
return;
@@ -384,7 +420,7 @@ - (IBAction)bootstrap:(id)sender {
384420
}
385421

386422
UIImpactFeedbackGenerator* generator = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleSoft];
387-
generator.impactOccurred;
423+
[generator impactOccurred];
388424

389425
if(find_jbroot()) //make sure jbroot() function available
390426
{
@@ -437,6 +473,7 @@ - (IBAction)bootstrap:(id)sender {
437473
[AppDelegate addLogText:[NSString stringWithFormat:@"openssh launch faild(%d):\n%@\n%@", status, log, err]];
438474
}
439475

476+
[generator impactOccurred];
440477
[AppDelegate addLogText:@"respring now..."]; sleep(1);
441478

442479
status = spawnBootstrap((char*[]){"/usr/bin/sbreload", NULL}, &log, &err);

Bootstrap/basebin/bootstrap.dylib

-48 Bytes
Binary file not shown.

Bootstrap/basebin/bootstrapd

48 Bytes
Binary file not shown.

Bootstrap/basebin/devtest

0 Bytes
Binary file not shown.

Bootstrap/basebin/preload

112 Bytes
Binary file not shown.

Bootstrap/basebin/preload.dylib

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)