Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

Commit

Permalink
Fix a stupid crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ExTBH committed Jun 19, 2023
1 parent 67bfc2f commit acf05f6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Theos/packages/
.theos
.cache/

This comment has been minimized.

Copy link
@alhartya000

alhartya000 Sep 5, 2023

[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٤ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٤ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٤ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٤ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٤ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٤ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٥ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٥ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Adding setting button
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٣ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٥ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٥٦ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٥٦ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٥٩ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤٢:٠٢ +0000] Presenting settings VC

compile_commands.json

This comment has been minimized.

Copy link
@alhartya000

alhartya000 Sep 5, 2023

[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٤ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٤ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٤ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٤ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٤ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٤ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٥ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٣٥ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Adding setting button
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٠ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٣ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٤٥ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٥٦ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٥٦ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤١:٥٩ +0000] Spoofed location to 21.787528;40.458863
[٢٠٢٣-٠٩-٠٥ ١٦:٤٢:٠٢ +0000] Presenting settings VC

compile_commands.json
.DS_Store
44 changes: 33 additions & 11 deletions Theos/Tweak.x
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,46 @@

//Add Settings button
@interface MainFeedViewController : UIViewController
@property (nonatomic, strong) UIBarButtonItem *settingsButton;
- (void)addSettingsButton;
@end

%hook MainFeedViewController
%property (nonatomic, strong) UIBarButtonItem *settingsButton;

- (void)viewDidLoad{
%orig;
@try{
JELog(@"Adding setting button");
MainFeedViewController *usableSelf = self;
UIBarButtonItem *statsButton = [[UIBarButtonItem alloc] initWithTitle:[[JDESettingsManager sharedInstance] localizedStringForKey:@"emproved"]
style:UIBarButtonItemStyleDone target:self
action:@selector(presentJDEViewController:)];

usableSelf.navigationItem.leftBarButtonItem = statsButton;
}
@catch(NSException *exception){
JELog(@"Failed to add settings button: %@", exception);
[self addSettingsButton];
[self addObserver:self forKeyPath:@"navigationItem" options:NSKeyValueObservingOptionNew context:nil];
}

- (void)dealloc {
// Remove observer to avoid memory leaks
[self removeObserver:self forKeyPath:@"navigationItem"];
%orig;
}

%new
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context {
// Check if the observed keyPath is "navigationItem"
if ([keyPath isEqualToString:@"navigationItem"]) {
// Re-add the button whenever the navigationItem changes
[self addSettingsButton];
}
}
%new
- (void)addSettingsButton {
// Create the button
MainFeedViewController *usableSelf = self;
usableSelf.settingsButton = [[UIBarButtonItem alloc] initWithTitle:[[JDESettingsManager sharedInstance] localizedStringForKey:@"emproved"]
style:UIBarButtonItemStyleDone
target:self
action:@selector(presentJDEViewController:)];

// Add the button to the navigation item

usableSelf.navigationItem.leftBarButtonItem = usableSelf.settingsButton;
}

%new
-(void)presentJDEViewController:(id)sender{
Expand Down
6 changes: 3 additions & 3 deletions Theos/layout/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: dev.extbh.jodelemproved
Name: Jodel EMPROVED
Version: 1.1.7-3
Version: 1.1.8
Architecture: iphoneos-arm
Description: Customizing the Jodel app
Depiction: https://repo.depiction.extbh.dev/dev.extbh.jodelemproved/
Homepage: https://extbh.dev
Maintainer: ExTBH <[email protected]>
Author: ExTBH <[email protected]>
Maintainer: ExTBH
Author: ExTBH
Section: Tweaks
Depends: mobilesubstrate (>= 0.9.5000), firmware (>= 14.0)

0 comments on commit acf05f6

Please sign in to comment.