├── KeyboardTools.plist
├── Makefile
├── README.md
├── Tweak.xm
├── control
└── layout
└── DEBIAN
└── postinst
/KeyboardTools.plist:
--------------------------------------------------------------------------------
1 | {
2 | Filter = {
3 | Bundles = (
4 | "com.apple.UIKit"
5 | );
6 | };
7 | }
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | ARCHS = arm64e arm64
2 |
3 | export THEOS=/var/theos
4 | THEOS_PACKAGE_SCHEME=rootless
5 |
6 | export SDKVERSION = 14.5
7 |
8 |
9 | export iP = 192.168.1.107
10 | export Port = 22
11 | export Pass = alpine
12 | export Bundle = com.apple.Preferences
13 |
14 | DEBUG = 0
15 |
16 | INSTALL_TARGET_PROCESSES = SpringBoard
17 |
18 | include $(THEOS)/makefiles/common.mk
19 |
20 | TWEAK_NAME = KeyboardTools
21 |
22 | KeyboardTools_FILES = Tweak.xm
23 | KeyboardTools_CFLAGS = -fobjc-arc
24 |
25 | include $(THEOS_MAKE_PATH)/tweak.mk
26 |
27 |
28 | install6::
29 | install6.exec
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | # KeyboardTools
5 |
6 | A jailbreak tweak designed to enhance the text editing experience within iOS applications. This tweak adds a custom input accessory view to the keyboard, providing users with quick access to essential text editing tools
7 |
8 | ## Features:
9 |
10 | - Copy: Copies the selected text to the clipboard.
11 | - Paste: Pastes text from the clipboard to the current text field.
12 | - Cut: Cuts the selected text and copies it to the clipboard.
13 | - Undo: Reverts the last text change.
14 | - Select All: Selects all text within the current text field.
15 | - Move Left: Moves the writing indicator (cursor) one position to the left.
16 | - Move Right: Moves the writing indicator (cursor) one position to the right.
17 | - Done: Dismisses the keyboard.
18 |
19 |
20 |
21 | ## Supports iOS 15 and 16 - Dopamine~Rootless and RootHide
22 |
23 | ### ScreenShot
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Tweak.xm:
--------------------------------------------------------------------------------
1 | // By @CrazyMind90
2 |
3 | #pragma GCC diagnostic ignored "-Wunused-variable"
4 | #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
5 |
6 |
7 | #import
8 | #import
9 |
10 |
11 | @interface KeyboardTools : NSObject
12 |
13 | @property UITextField *_self;
14 |
15 | -(void) done;
16 | -(void) copyText;
17 | -(void) paste;
18 | -(void) selectAll;
19 | -(void) undo;
20 | -(void) cut;
21 | -(void) moveLeft;
22 | -(void) moveRight;
23 | - (UIBarButtonItem *) allocWithSystemImageNamed:(NSString *)imageName action:(SEL)action;
24 | @end
25 |
26 | @implementation KeyboardTools
27 |
28 |
29 | -(void) done {
30 | [self._self resignFirstResponder];
31 | }
32 |
33 | -(void) copyText {
34 | UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
35 | UITextRange *selectedRange = [self._self selectedTextRange];
36 | if (selectedRange && !selectedRange.isEmpty) {
37 | NSString *selectedText = [self._self textInRange:selectedRange];
38 | pasteboard.string = selectedText;
39 | }
40 | }
41 |
42 | -(void) paste {
43 | UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
44 | if (pasteboard.string.length > 0)
45 | self._self.text = [NSString stringWithFormat:@"%@%@",self._self.text.length > 0 ? self._self.text : @"",pasteboard.string];
46 | }
47 |
48 | -(void) selectAll {
49 | [self._self selectAll:self._self.text];
50 | }
51 |
52 | -(void) undo {
53 | [self._self.undoManager undo];
54 | }
55 |
56 | -(void) cut {
57 | [self._self cut:self._self.text];
58 | }
59 |
60 | -(void) moveLeft {
61 | UITextRange *selectedRange = [self._self selectedTextRange];
62 | if (selectedRange) {
63 | UITextPosition *newPosition = [self._self positionFromPosition:selectedRange.start inDirection:UITextLayoutDirectionLeft offset:1];
64 | if (newPosition) {
65 | self._self.selectedTextRange = [self._self textRangeFromPosition:newPosition toPosition:newPosition];
66 | }
67 | }
68 | }
69 |
70 | -(void) moveRight {
71 | UITextRange *selectedRange = [self._self selectedTextRange];
72 | if (selectedRange) {
73 | UITextPosition *newPosition = [self._self positionFromPosition:selectedRange.start inDirection:UITextLayoutDirectionRight offset:1];
74 | if (newPosition) {
75 | self._self.selectedTextRange = [self._self textRangeFromPosition:newPosition toPosition:newPosition];
76 | }
77 | }
78 | }
79 |
80 | - (UIBarButtonItem *) allocWithSystemImageNamed:(NSString *)imageName action:(SEL)action {
81 | return [[UIBarButtonItem alloc] initWithImage:[[UIImage systemImageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] style:UIBarButtonItemStylePlain target:self action:action];
82 | }
83 |
84 | @end
85 |
86 |
87 | KeyboardTools *tools;
88 | %hook UITextField
89 | - (void)layoutSubviews {
90 |
91 | %orig;
92 |
93 |
94 | if (![NSBundle.mainBundle.bundleIdentifier isEqual:@"com.tigisoftware.Filza"]) {
95 |
96 |
97 | UIToolbar *toolBar = [[UIToolbar alloc] init];
98 |
99 | [toolBar sizeToFit];
100 |
101 | if (!tools)
102 | tools = [KeyboardTools new];
103 |
104 | tools._self = self;
105 |
106 |
107 | UIBarButtonItem *done = [tools allocWithSystemImageNamed:@"checkmark.circle" action:@selector(done)];
108 | UIBarButtonItem *copy = [tools allocWithSystemImageNamed:@"doc.on.doc" action:@selector(copyText)];
109 | UIBarButtonItem *paste = [tools allocWithSystemImageNamed:@"doc.on.clipboard" action:@selector(paste)];
110 | UIBarButtonItem *cut = [tools allocWithSystemImageNamed:@"scissors" action:@selector(cut)];
111 | UIBarButtonItem *undo = [tools allocWithSystemImageNamed:@"arrow.uturn.backward" action:@selector(undo)];
112 | UIBarButtonItem *selectAll = [tools allocWithSystemImageNamed:@"selection.pin.in.out" action:@selector(selectAll)];
113 | UIBarButtonItem *moveLeft = [tools allocWithSystemImageNamed:@"arrow.left.circle" action:@selector(moveLeft)];
114 | UIBarButtonItem *moveRight = [tools allocWithSystemImageNamed:@"arrow.right.circle" action:@selector(moveRight)];
115 |
116 |
117 | UIColor *tintColor = [UIColor whiteColor];
118 | done.tintColor = tintColor;
119 | copy.tintColor = tintColor;
120 | paste.tintColor = tintColor;
121 | cut.tintColor = tintColor;
122 | undo.tintColor = tintColor;
123 | selectAll.tintColor = tintColor;
124 | moveLeft.tintColor = tintColor;
125 | moveRight.tintColor = tintColor;
126 |
127 |
128 | UIBarButtonItem *space = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
129 |
130 | toolBar.items = [NSArray arrayWithObjects:space, done, space, copy, space, paste, space, cut, space, undo, space, selectAll, space, moveLeft, space, moveRight, space, nil];
131 |
132 | self.inputAccessoryView = toolBar;
133 |
134 | }
135 |
136 | }
137 |
138 |
139 |
140 |
141 | %end
142 |
--------------------------------------------------------------------------------
/control:
--------------------------------------------------------------------------------
1 | Package: com.crazymind90.keyboardtools
2 | Name: KeyboardTools
3 | Depends: mobilesubstrate
4 | Version: 1.4
5 | Architecture: iphoneos-arm64
6 | Description: More tools on your keyboard - Dissmiss,Copy,Paste,Cut,Select and Select all
7 | Maintainer: @CrazyMind90
8 | Author: @CrazyMind90
9 | Section: Tweaks
10 |
--------------------------------------------------------------------------------
/layout/DEBIAN/postinst:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | mainPath=""
4 | if [ -e "/usr/lib/libroothide.dylib" ]; then
5 | echo "RootHide detected ...";
6 | else
7 | echo "Dopamine detected ...";
8 | mainPath="/var/jb";
9 | fi
10 |
11 | ldid -s $mainPath/Library/MobileSubstrate/DynamicLibraries/KeyboardTools.dylib $mainPath/Library/MobileSubstrate/DynamicLibraries/KeyboardTools.dylib
12 |
13 |
14 |
--------------------------------------------------------------------------------