Initial release
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
.theos
|
||||
packages
|
||||
.DS_Store
|
12
Makefile
Normal file
12
Makefile
Normal file
@ -0,0 +1,12 @@
|
||||
INSTALL_TARGET_PROCESSES = SpringBoard
|
||||
ARCHS = armv7 arm64 arm64e
|
||||
TARGET = iphone:clang::7.0
|
||||
|
||||
include $(THEOS)/makefiles/common.mk
|
||||
|
||||
TWEAK_NAME = Stonks
|
||||
|
||||
Stonks_FILES = Tweak.x
|
||||
Stonks_CFLAGS = -fobjc-arc
|
||||
|
||||
include $(THEOS_MAKE_PATH)/tweak.mk
|
2
README.md
Normal file
2
README.md
Normal file
@ -0,0 +1,2 @@
|
||||
# Stonks
|
||||
Changes all "Stocks" text to "Stonks" system-wide on iOS.
|
1
Stonks.plist
Normal file
1
Stonks.plist
Normal file
@ -0,0 +1 @@
|
||||
{ Filter = { Bundles = ( "com.apple.UIKit" ); }; }
|
81
Tweak.x
Normal file
81
Tweak.x
Normal file
@ -0,0 +1,81 @@
|
||||
// Stonks - Changes all "Stocks" text to "Stonks"
|
||||
// By Skitty
|
||||
|
||||
static BOOL enabled = YES;
|
||||
|
||||
NSString *stocksToStonks(NSString *origString) {
|
||||
NSString *newString = [origString stringByReplacingOccurrencesOfString:@"Stocks" withString:@"Stonks"];
|
||||
newString = [newString stringByReplacingOccurrencesOfString:@"stocks" withString:@"stonks"];
|
||||
newString = [newString stringByReplacingOccurrencesOfString:@"STOCKS" withString:@"STONKS"];
|
||||
newString = [newString stringByReplacingOccurrencesOfString:@"stocks" withString:@"stonks" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [newString length])];
|
||||
return newString;
|
||||
}
|
||||
NSAttributedString *attributedStocksToStonks(NSAttributedString *origString) {
|
||||
NSMutableAttributedString *newString = [origString mutableCopy];
|
||||
while ([newString.mutableString containsString:@"Stocks"]) {
|
||||
NSRange range = [newString.mutableString rangeOfString:@"Stocks"];
|
||||
NSMutableAttributedString *replaceString = [[NSMutableAttributedString alloc] initWithString:@"Stonks"];
|
||||
[newString enumerateAttributesInRange:range options:0 usingBlock:^(NSDictionary<NSAttributedStringKey, id> *attrs, NSRange range, BOOL *stop) {
|
||||
[replaceString addAttributes:attrs range:NSMakeRange(0, replaceString.length)];
|
||||
}];
|
||||
[newString replaceCharactersInRange:range withAttributedString:replaceString];
|
||||
}
|
||||
return [newString copy];
|
||||
}
|
||||
|
||||
// Global text views
|
||||
%hook UILabel
|
||||
- (void)setText:(NSString *)text {
|
||||
if (enabled) {
|
||||
text = stocksToStonks(text);
|
||||
}
|
||||
%orig(text);
|
||||
}
|
||||
- (void)setAttributedText:(NSAttributedString *)attributedText {
|
||||
if (enabled) {
|
||||
attributedText = attributedStocksToStonks(attributedText);
|
||||
}
|
||||
%orig(attributedText);
|
||||
}
|
||||
%end
|
||||
|
||||
%hook UITextView
|
||||
- (void)setText:(NSString *)text {
|
||||
if (enabled) {
|
||||
text = stocksToStonks(text);
|
||||
}
|
||||
%orig(text);
|
||||
}
|
||||
- (void)setAttributedText:(NSAttributedString *)attributedText {
|
||||
if (enabled) {
|
||||
attributedText = attributedStocksToStonks(attributedText);
|
||||
}
|
||||
%orig(attributedText);
|
||||
}
|
||||
%end
|
||||
|
||||
// App names
|
||||
%hook SBApplication
|
||||
- (void)setDisplayName:(id)name {
|
||||
if (enabled){
|
||||
name = stocksToStonks(name);
|
||||
}
|
||||
%orig(name);
|
||||
}
|
||||
- (id)displayName {
|
||||
return stocksToStonks(%orig);
|
||||
}
|
||||
%end
|
||||
|
||||
// Folder names
|
||||
%hook SBFolder
|
||||
- (void)setDisplayName:(id)name {
|
||||
if (enabled){
|
||||
name = stocksToStonks(name);
|
||||
}
|
||||
%orig(name);
|
||||
}
|
||||
- (id)displayName {
|
||||
return stocksToStonks(%orig);
|
||||
}
|
||||
%end
|
11
control
Normal file
11
control
Normal file
@ -0,0 +1,11 @@
|
||||
Package: xyz.skitty.stonks
|
||||
Name: Stonks
|
||||
Depends: mobilesubstrate
|
||||
Version: 1.0
|
||||
Architecture: iphoneos-arm
|
||||
Description: Change all "Stocks" text to "Stonks"
|
||||
Depiction: https://skitty.xyz/repo/depictions/?p=xyz.skitty.stonks
|
||||
SileoDepiction: https://skitty.xyz/repo/depictions/?s=xyz.skitty.stonks
|
||||
Maintainer: Skitty
|
||||
Author: Skitty
|
||||
Section: Tweaks
|
Reference in New Issue
Block a user