Browse Source

Initial

master
mac-user669 4 years ago
parent
commit
30cda69740
5 changed files with 25 additions and 67 deletions
  1. +2
    -2
      Makefile
  2. +2
    -2
      README.md
  3. +1
    -1
      Stonks.plist
  4. +13
    -55
      Tweak.x
  5. +7
    -7
      control

+ 2
- 2
Makefile View File

INSTALL_TARGET_PROCESSES = SpringBoard
ARCHS = armv7 arm64 arm64e
INSTALL_TARGET_PROCESSES = AppStore
ARCHS = arm64 arm64e
TARGET = iphone:clang::7.0 TARGET = iphone:clang::7.0


include $(THEOS)/makefiles/common.mk include $(THEOS)/makefiles/common.mk

+ 2
- 2
README.md View File

# Stonks
Changes all "Stocks" text to "Stonks" system-wide on iOS.
# GetFree
Changes the App Store's "GET" text to "Free"

+ 1
- 1
Stonks.plist View File

{ Filter = { Bundles = ( "com.apple.UIKit" ); }; }
{ Filter = { Bundles = ( "com.apple.AppStore" ); }; }

+ 13
- 55
Tweak.x View File

// Stonks - Changes all "Stocks" text to "Stonks"
// By Skitty
// GetFree - Changes the App Store's "GET" text to "Free"
// By mac-user669

// Based off Stonks by Skitty


static BOOL enabled = YES; 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])];
NSString *GetToFree(NSString *origString) {
NSString *newString = [origString stringByReplacingOccurrencesOfString:@"GET" withString:@"Free"];
return newString; return newString;
} }
NSAttributedString *attributedStocksToStonks(NSAttributedString *origString) {
NSAttributedString *attributedGetToFree(NSAttributedString *origString) {
NSMutableAttributedString *newString = [origString mutableCopy]; NSMutableAttributedString *newString = [origString mutableCopy];
while ([newString.mutableString containsString:@"Stocks"]) {
NSRange range = [newString.mutableString rangeOfString:@"Stocks"];
NSMutableAttributedString *replaceString = [[NSMutableAttributedString alloc] initWithString:@"Stonks"];
while ([newString.mutableString containsString:@"GET"]) {
NSRange range = [newString.mutableString rangeOfString:@"GET"];
NSMutableAttributedString *replaceString = [[NSMutableAttributedString alloc] initWithString:@"Free"];
[newString enumerateAttributesInRange:range options:0 usingBlock:^(NSDictionary<NSAttributedStringKey, id> *attrs, NSRange range, BOOL *stop) { [newString enumerateAttributesInRange:range options:0 usingBlock:^(NSDictionary<NSAttributedStringKey, id> *attrs, NSRange range, BOOL *stop) {
[replaceString addAttributes:attrs range:NSMakeRange(0, replaceString.length)]; [replaceString addAttributes:attrs range:NSMakeRange(0, replaceString.length)];
}]; }];
return [newString copy]; return [newString copy];
} }


// Global text views
// Actual hook
%hook UILabel %hook UILabel
- (void)setText:(NSString *)text { - (void)setText:(NSString *)text {
if (enabled) { if (enabled) {
text = stocksToStonks(text);
text = GetToFree(text);
} }
%orig(text); %orig(text);
} }
- (void)setAttributedText:(NSAttributedString *)attributedText { - (void)setAttributedText:(NSAttributedString *)attributedText {
if (enabled) { if (enabled) {
attributedText = attributedStocksToStonks(attributedText);
attributedText = attributedGetToFree(attributedText);
} }
%orig(attributedText); %orig(attributedText);
} }
%end %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

+ 7
- 7
control View File

Package: xyz.skitty.stonks
Name: Stonks
Package: com.mac-user669.getfree
Name: GetFree
Depends: mobilesubstrate Depends: mobilesubstrate
Version: 1.0 Version: 1.0
Architecture: iphoneos-arm 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
Description: Changes the App Store's "GET" text to "Free"
Depiction: https://mac-user669.github.io/repo/depictions/?p=com.mac-user669.getfree/
SileoDepiction: https://mac-user669.github.io/repo/sileodepictions/GetFree.json
Maintainer: mac-user669
Author: mac-user669
Section: Tweaks Section: Tweaks

Loading…
Cancel
Save