Bladeren bron

Initial release

master
Skitty 4 jaren geleden
commit
5ff0bca92b
6 gewijzigde bestanden met toevoegingen van 110 en 0 verwijderingen
  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 Bestand weergeven

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

+ 12
- 0
Makefile Bestand weergeven

@@ -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 Bestand weergeven

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

+ 1
- 0
Stonks.plist Bestand weergeven

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

+ 81
- 0
Tweak.x Bestand weergeven

@@ -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 Bestand weergeven

@@ -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

Laden…
Annuleren
Opslaan