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

Commit 77f36e0

Browse files
authored
Clean dead code (#21)
* remove old code * More cleaning * last one * Push version
1 parent e081f26 commit 77f36e0

File tree

5 files changed

+5
-88
lines changed

5 files changed

+5
-88
lines changed

Theos/Headers/ShrinkAnimationButton.h

Lines changed: 0 additions & 6 deletions
This file was deleted.

Theos/JDEViewController.m

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -332,54 +332,4 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
332332
}
333333
}
334334

335-
336-
337-
- (UIContextMenuConfiguration *)tableView:(UITableView *)tableView contextMenuConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath point:(CGPoint)point{
338-
NSMutableArray *suggestedActions = [NSMutableArray new];
339-
340-
if(indexPath.section == 0){
341-
//Getting the cell so we can access the switch for the Menu
342-
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
343-
//break if cell is disabled
344-
if(!cell.userInteractionEnabled) {return nil;}
345-
UISwitch *cellSwitch = cell.contentView.subviews[3];
346-
347-
if (!cellSwitch.isOn) {
348-
UIAction *enable = [UIAction actionWithTitle:[_settingsManager localizedStringForKey:@"enable"] image:[UIImage systemImageNamed:@"checkmark"] identifier:nil handler:^(UIAction *handler) {
349-
[cellSwitch setOn:YES animated:YES];
350-
[self switchValueChanged:cellSwitch];
351-
}];
352-
[suggestedActions addObject:enable];
353-
} else {
354-
UIAction *disable = [UIAction actionWithTitle:[_settingsManager localizedStringForKey:@"disable"] image:[UIImage systemImageNamed:@"xmark"] identifier:nil handler:^(UIAction *handler) {
355-
[cellSwitch setOn:NO animated:YES];
356-
[self switchValueChanged:cellSwitch];
357-
}];
358-
[suggestedActions addObject:disable];
359-
}
360-
361-
362-
if(cellSwitch.tag == 2) {
363-
UIAction *location = [UIAction actionWithTitle:[_settingsManager localizedStringForKey:@"change_location"] image:[UIImage systemImageNamed:@"location"] identifier:nil handler:^(UIAction *handler) {
364-
[self didTapLocationButton:nil];
365-
}];
366-
[suggestedActions addObject:location];
367-
}
368-
}
369-
if(indexPath.section == 1 && indexPath.row < 2){
370-
UIAction *openLink = [UIAction actionWithTitle:[_settingsManager localizedStringForKey:@"link"] image:[UIImage systemImageNamed:@"link"] identifier:nil handler:^(UIAction *handler) {
371-
[self openLinkForIndexPath:indexPath];
372-
}];
373-
[suggestedActions addObject:openLink];
374-
}
375-
else {
376-
return nil;
377-
}
378-
UIMenu *menu = [UIMenu menuWithTitle:@"" children:suggestedActions];
379-
UIContextMenuConfiguration *menuConfig = [UIContextMenuConfiguration configurationWithIdentifier:nil previewProvider:nil actionProvider:^(NSArray *suggestedActions) { return menu;}
380-
];
381-
382-
return menuConfig;
383-
}
384-
385335
@end

Theos/Tweak.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#import "Headers/ZSWTappableLabel.h"
77
#import <SafariServices/SafariServices.h>
88
#import "Headers/WalkthroughViewController.h"
9-
#import "Headers/ShrinkAnimationButton.h"
109

1110
@interface PictureFeedViewController : UIViewController
1211
@property (weak, nonatomic, readwrite) UIButton *addReactionButton;
@@ -21,7 +20,7 @@
2120
UINavigationControllerDelegate>
2221
- (void)JDEuploadImage:(id)sender;
2322
- (void)picker:(PHPickerViewController *)picker didFinishPicking:(NSArray<PHPickerResult *> *)results;
24-
- (void)captureManagerStillImageCaptured:(id)iDontReallyKnow image:(id)aImage;
23+
- (void)captureManagerStillImageCaptured:(id)JDLAVCamCaptureManager_instance image:(id)aImage;
2524
- (void)loadImage:(UIImage*)image;
2625

2726
@end
@@ -52,6 +51,4 @@
5251
@end
5352

5453
@interface TappableLabel : UILabel
55-
@end
56-
@interface FeedCellTappableLabelDelegate : NSObject <ZSWTappableLabelTapDelegate>
5754
@end

Theos/Tweak.x

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,10 @@
169169
- (void)loadImage:(UIImage*)image{
170170
[[JDESettingsManager sharedInstance] logString:@"Loading selected image"];
171171
dispatch_async(dispatch_get_main_queue(), ^{
172-
[self captureManagerStillImageCaptured:self image:image];
172+
// JDLAVCamCaptureManager is the captureManager iVar but its swift not hook-able
173+
[self captureManagerStillImageCaptured:[NSClassFromString(@"JDLAVCamCaptureManager") new] image:image];
173174
});
174175
}
175-
176-
// Required as of 7.59 because the app checks the method from protocol [JDLAVCamCaptureManager isFrontCamera], delegate is self
177-
// Improve the hook later
178-
// Side effects, Captured photos wont get flipped
179-
%new
180-
- (BOOL)isFrontCamera{
181-
return NO;
182-
}
183176
%end
184177

185178
//Disable Screenshots
@@ -406,20 +399,6 @@
406399
%end
407400

408401
%hook WalkthroughViewController
409-
- (void)viewDidLayoutSubviews{
410-
%orig;
411-
412-
ShrinkAnimationButton *targetButton = nil;
413-
Class trgtClass = objc_getClass("Jodel.ShrinkAnimationButton");
414-
415-
for(id view in [self view].subviews){
416-
if([view isKindOfClass:[trgtClass class]]){
417-
targetButton = view;
418-
break;
419-
}
420-
}
421-
}
422-
423402
-(void)didTapNext{
424403
UIAlertController *accAlert = [UIAlertController alertControllerWithTitle:nil
425404
message:nil
@@ -477,8 +456,6 @@
477456

478457
%end
479458

480-
%hook ShrinkAnimationButton
481-
%end
482459
%ctor {
483460
%init(PlaceholderTextView=objc_getClass("Jodel.PlaceholderTextView"),
484461
PictureFeedViewController=objc_getClass("Jodel.PictureFeedViewController"),
@@ -491,7 +468,6 @@
491468
ImageCaptureViewController=objc_getClass("Jodel.ImageCaptureViewController"),
492469
TappableLabel=objc_getClass("Jodel.TappableLabel"),
493470
FeedCellTappableLabelDelegate=objc_getClass("Jodel.FeedCellTappableLabelDelegate"),
494-
WalkthroughViewController=objc_getClass("Jodel.WalkthroughViewController"),
495-
ShrinkAnimationButton=objc_getClass("Jodel.ShrinkAnimationButton"));
471+
WalkthroughViewController=objc_getClass("Jodel.WalkthroughViewController"));
496472
}
497473

Theos/layout/DEBIAN/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: dev.extbh.jodelemproved
22
Name: Jodel EMPROVED
3-
Version: 1.1.6
3+
Version: 1.1.7
44
Architecture: iphoneos-arm
55
Description: Customizing the Jodel app
66
Depiction: https://repo.depiction.extbh.dev/dev.extbh.jodelemproved/

0 commit comments

Comments
 (0)