Bladeren bron

Update V2.0

master
exoticswingset 4 jaren geleden
bovenliggende
commit
2449378a84
No account linked to committer's email address
9 gewijzigde bestanden met toevoegingen van 210 en 4 verwijderingen
  1. +3
    -1
      Makefile
  2. +25
    -2
      Tweak.x
  3. +1
    -1
      control
  4. +15
    -0
      truthfuldockprefs/Makefile
  5. +24
    -0
      truthfuldockprefs/Resources/Info.plist
  6. +93
    -0
      truthfuldockprefs/Resources/Root.plist
  7. +5
    -0
      truthfuldockprefs/TDPRootListController.h
  8. +23
    -0
      truthfuldockprefs/TDPRootListController.m
  9. +21
    -0
      truthfuldockprefs/entry.plist

+ 3
- 1
Makefile Bestand weergeven

@@ -1,5 +1,5 @@
INSTALL_TARGET_PROCESSES = SpringBoard
ARCHS = armv7 armv7s arm64 arm64e
ARCHS = arm64e arm64 armv7 armv7s
include ~/theos/makefiles/common.mk

TWEAK_NAME = TruthfulDock
@@ -8,3 +8,5 @@ TruthfulDock_FILES = Tweak.x
TruthfulDock_CFLAGS = -fobjc-arc

include ~/theos/makefiles/tweak.mk
SUBPROJECTS += truthfuldockprefs
include $(THEOS_MAKE_PATH)/aggregate.mk

+ 25
- 2
Tweak.x Bestand weergeven

@@ -1,5 +1,28 @@
%hook SBDockView

-(void)setBackgroundAlpha:(double)arg1 {
%orig(0.0);
NSDictionary *bundleDefaults = [[NSUserDefaults standardUserDefaults]persistentDomainForName:@"com.exoticswingset.truthfuldockprefs"];
id isTweakEnabled = [bundleDefaults valueForKey:@"isTweakEnabled"];
double alphaValue = [[bundleDefaults valueForKey:@"alphaValue"]doubleValue];
if ([isTweakEnabled isEqual:@0]) {
%orig;
} else {
%orig(alphaValue);
}
}
%end

-(BOOL)isDockInset {
NSDictionary *bundleDefaults = [[NSUserDefaults standardUserDefaults]persistentDomainForName:@"com.exoticswingset.truthfuldockprefs"];
id isTweakEnabled = [bundleDefaults valueForKey:@"isTweakEnabled"];
id classicDockEnabled = [bundleDefaults valueForKey:@"classicDockEnabled"];
if ([isTweakEnabled isEqual:@0]) {
return %orig;
} else if ([classicDockEnabled isEqual:@0]) {
return %orig;
} else {
return NO;
}
}
%end

+ 1
- 1
control Bestand weergeven

@@ -1,7 +1,7 @@
Package: com.exoticswingset.truthfuldock
Name: TruthfulDock
Depends: mobilesubstrate
Version: 0.0.2
Version: 2.0
Architecture: iphoneos-arm
Description: An awesome MobileSubstrate tweak!
Maintainer: ExoticSwingset

+ 15
- 0
truthfuldockprefs/Makefile Bestand weergeven

@@ -0,0 +1,15 @@
include ~/theos/makefiles/common.mk
ARCHS = arm64e arm64 armv7 armv7s
BUNDLE_NAME = TruthfulDockPrefs

TruthfulDockPrefs_FILES = TDPRootListController.m
TruthfulDockPrefs_INSTALL_PATH = /Library/PreferenceBundles
TruthfulDockPrefs_FRAMEWORKS = UIKit
TruthfulDockPrefs_PRIVATE_FRAMEWORKS = Preferences
TruthfulDockPrefs_CFLAGS = -fobjc-arc

include ~/theos/makefiles/bundle.mk

internal-stage::
$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END)
$(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/TruthfulDockPrefs.plist$(ECHO_END)

+ 24
- 0
truthfuldockprefs/Resources/Info.plist Bestand weergeven

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>TruthfulDockPrefs</string>
<key>CFBundleIdentifier</key>
<string>com.exoticswingset.truthfuldockprefs</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>TDPRootListController</string>
</dict>
</plist>

+ 93
- 0
truthfuldockprefs/Resources/Root.plist Bestand weergeven

@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>General</string>
</dict>

<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>com.exoticswingset.truthfuldockprefs</string>
<key>key</key>
<string>isTweakEnabled</string>
<key>label</key>
<string>Enabled</string>
</dict>

<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>Classic Dock (for notched devices)</string>
</dict>

<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<false/>
<key>defaults</key>
<string>com.exoticswingset.truthfuldockprefs</string>
<key>key</key>
<string>classicDockEnabled</string>
<key>label</key>
<string>Enabled</string>
</dict>

<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>Custom Dock Opacity</string>
</dict>

<dict>
<key>cell</key>
<string>PSSliderCell</string>
<key>default</key>
<real>0</real>
<key>defaults</key>
<string>com.exoticswingset.truthfuldockprefs</string>
<key>key</key>
<string>alphaValue</string>
<key>min</key>
<real>0</real>
<key>max></key>
<real>1</real>
<key>showValue</key>
<true/>
<key>label</key>
<string>Set Dock Opacity</string>
</dict>

<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>Save Settings</string>
</dict>

<dict>
<key>cell</key>
<string>PSButtonCell</string>
<key>label</key>
<string>Respring</string>
<key>action</key>
<string>respring</string>
</dict>

</array>
<key>title</key>
<string>TruthfulDock</string>
</dict>
</plist>

+ 5
- 0
truthfuldockprefs/TDPRootListController.h Bestand weergeven

@@ -0,0 +1,5 @@
#import <Preferences/PSListController.h>

@interface TDPRootListController : PSListController

@end

+ 23
- 0
truthfuldockprefs/TDPRootListController.m Bestand weergeven

@@ -0,0 +1,23 @@
#include "TDPRootListController.h"
#import <spawn.h>

@implementation TDPRootListController

- (NSArray *)specifiers {
if (!_specifiers) {
_specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self];
}

return _specifiers;
}

- (void)respring
{
pid_t pid;
int status;
const char* args[] = {"killall", "-9", "backboardd", NULL};
posix_spawn(&pid, "/usr/bin/killall", NULL, NULL, (char* const*)args, NULL);
waitpid(pid, &status, WEXITED);
}

@end

+ 21
- 0
truthfuldockprefs/entry.plist Bestand weergeven

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>entry</key>
<dict>
<key>bundle</key>
<string>TruthfulDockPrefs</string>
<key>cell</key>
<string>PSLinkCell</string>
<key>detail</key>
<string>TDPRootListController</string>
<key>icon</key>
<string>icon.png</string>
<key>isController</key>
<true/>
<key>label</key>
<string>TruthfulDockPrefs</string>
</dict>
</dict>
</plist>

Laden…
Annuleren
Opslaan