Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Morpheus committed Oct 19, 2024
1 parent a4eecac commit 52115d7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 27 deletions.
Binary file not shown.
41 changes: 15 additions & 26 deletions varClean/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#include <arpa/inet.h>
#include <spawn.h>

@interface AppDelegate ()
- (void)showAlert:(NSString*)title message:(NSString*)message;
@end

@implementation AppDelegate

+ (id)getDefaultsForKey:(NSString*)key {
Expand All @@ -25,7 +29,7 @@ + (void)setDefaults:(NSObject*)value forKey:(NSString*)key {
[defaults writeToFile:configFilePath atomically:YES];
}

+ (void)showAlert:(UIAlertController*)alert {
- (void)showAlert:(NSString*)title message:(NSString*)message {

static dispatch_queue_t alertQueue = nil;

Expand All @@ -35,36 +39,21 @@ + (void)showAlert:(UIAlertController*)alert {
});

dispatch_async(alertQueue, ^{

__block UIViewController* availableVC=nil;
while(!availableVC) {
dispatch_async(dispatch_get_main_queue(), ^{
UIViewController* vc = UIApplication.sharedApplication.keyWindow.rootViewController;
while(vc.presentedViewController){
vc = vc.presentedViewController;
if(vc.isBeingDismissed) return;
}
availableVC = vc;
});
if(!availableVC) usleep(1000*100);
}

__block BOOL presented = NO;
dispatch_async(dispatch_get_main_queue(), ^{
[availableVC presentViewController:alert animated:YES completion:^{ presented=YES; }];
UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];

[alert addAction:[UIAlertAction actionWithTitle:Localized(@"Got It") style:UIAlertActionStyleDefault handler:nil]];

UIViewController* vc = self.window.rootViewController;
while(vc.presentedViewController) vc = vc.presentedViewController;
[vc presentViewController:alert animated:YES completion:^{ presented=YES; }];
});

while(!presented) usleep(100*1000);
});
}

+ (void)showMessage:(NSString*)msg title:(NSString*)title {

UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:Localized(@"Got It") style:UIAlertActionStyleDefault handler:nil]];
[self showAlert:alert];
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
__block int repeatCount=0;
[NSTimer scheduledTimerWithTimeInterval:0.1 repeats:YES block:^(NSTimer* timer) {
Expand Down Expand Up @@ -180,7 +169,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// int status=0;
// waitpid(pid, &status, 0);
// }
//

dispatch_async(dispatch_get_global_queue(0, 0), ^{

int s = socket(AF_INET, SOCK_STREAM, 0);
Expand All @@ -191,7 +180,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
a.sin_port = htons(22);

if(connect(s, (struct sockaddr*)&a, sizeof(a)) == 0) {
[AppDelegate showMessage:Localized(@"SSH Service has been installed, you can uninstall it via Sileo/Zebra.") title:Localized(@"SSH Detected")];
[self showAlert:Localized(@"SSH Detected") message:Localized(@"SSH Service has been installed, you can uninstall it via Sileo/Zebra.")];
}

close(s);
Expand All @@ -208,7 +197,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
a.sin_port = htons(27042);

if(connect(s, (struct sockaddr*)&a, sizeof(a)) == 0) {
[AppDelegate showMessage:Localized(@"Frida Service has been installed, you can uninstall it via Sileo/Zebra.") title:Localized(@"Frida Detected")];
[self showAlert:Localized(@"Frida Detected") message:Localized(@"Frida Service has been installed, you can uninstall it via Sileo/Zebra.")];
}

close(s);
Expand Down
2 changes: 1 addition & 1 deletion varClean/VarCleanController.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "VarCleanController.h"
#import "varCleanController.h"
#include "AppDelegate.h"
#import "ZFCheckbox.h"

Expand Down

0 comments on commit 52115d7

Please sign in to comment.