Browse Source

Initial release

master
Skitty 4 years ago
commit
5ff0bca92b
6 changed files with 110 additions and 0 deletions
  1. +3
    -0
      .gitignore
  2. +12
    -0
      Makefile
  3. +2
    -0
      README.md
  4. +1
    -0
      Stonks.plist
  5. +81
    -0
      Tweak.x
  6. +11
    -0
      control

+ 3
- 0
.gitignore View File

@@ -0,0 +1,3 @@
.theos
packages
.DS_Store

+ 12
- 0
Makefile View 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
- 0
README.md View File

@@ -0,0 +1,2 @@
# Stonks
Changes all "Stocks" text to "Stonks" system-wide on iOS.

+ 1
- 0
Stonks.plist View File

@@ -0,0 +1 @@
{ Filter = { Bundles = ( "com.apple.UIKit" ); }; }

+ 81
- 0
Tweak.x View 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
- 0
control View 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

Loading…
Cancel
Save