浏览代码

Version 1.0

master
Gil Shahar 6 年前
父节点
当前提交
5b69959aea
没有帐户链接到提交者的电子邮件
共有 12 个文件被更改,包括 207 次插入0 次删除
  1. +13
    -0
      Makefile
  2. +1
    -0
      PearlRetry.plist
  3. +42
    -0
      Tweak.xm
  4. +9
    -0
      control
  5. 二进制
      packages/com.gilshahar7.pearlretry_1.0_iphoneos-arm.deb
  6. +14
    -0
      pearlretryprefs/Makefile
  7. +24
    -0
      pearlretryprefs/Resources/Info.plist
  8. +45
    -0
      pearlretryprefs/Resources/Root.plist
  9. 二进制
      pearlretryprefs/Resources/icon@3x.png
  10. +21
    -0
      pearlretryprefs/entry.plist
  11. +5
    -0
      pearlretryprefs/prpRootListController.h
  12. +33
    -0
      pearlretryprefs/prpRootListController.m

+ 13
- 0
Makefile 查看文件

@@ -0,0 +1,13 @@
ARCHS = armv7 arm64
include $(THEOS)/makefiles/common.mk

TWEAK_NAME = PearlRetry
PearlRetry_FILES = Tweak.xm
PearlRetry_PRIVATE_FRAMEWORKS = SpringBoardUIServices

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
install.exec "killall -9 SpringBoard"
SUBPROJECTS += pearlretryprefs
include $(THEOS_MAKE_PATH)/aggregate.mk

+ 1
- 0
PearlRetry.plist 查看文件

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

+ 42
- 0
Tweak.xm 查看文件

@@ -0,0 +1,42 @@
#define PLIST_PATH @"/var/mobile/Library/Preferences/com.gilshahar7.pearlretryprefs.plist"


@interface SBUIBiometricResource : NSObject
+ (id)sharedInstance;
- (void)noteScreenDidTurnOff;
- (void)noteScreenWillTurnOn;
@end

float delay = 0;

static void loadPrefs() {
NSMutableDictionary *prefs = [[NSMutableDictionary alloc] initWithContentsOfFile:PLIST_PATH];
delay = [[prefs objectForKey:@"delay"] floatValue];
}

void pearlretry_settingsDidUpdate(CFNotificationCenterRef center,
void * observer,
CFStringRef name,
const void * object,
CFDictionaryRef userInfo) {

}

%hook SBDashBoardPearlUnlockBehavior
-(void)_handlePearlFailure{
%orig;
[[%c(SBUIBiometricResource) sharedInstance] noteScreenDidTurnOff];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[%c(SBUIBiometricResource) sharedInstance] noteScreenWillTurnOn];
});
}
%end



%ctor{
loadPrefs();
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, (CFNotificationCallback)loadPrefs, CFSTR("com.gilshahar7.pearlretryprefs.settingschanged"), NULL, CFNotificationSuspensionBehaviorCoalesce);


}

+ 9
- 0
control 查看文件

@@ -0,0 +1,9 @@
Package: com.gilshahar7.pearlretry
Name: PearlRetry
Depends: mobilesubstrate
Version: 1.0
Architecture: iphoneos-arm
Description: Retry FaceID when failed to recognize.
Maintainer: gilshahar7
Author: gilshahar7
Section: Tweaks

二进制
packages/com.gilshahar7.pearlretry_1.0_iphoneos-arm.deb 查看文件


+ 14
- 0
pearlretryprefs/Makefile 查看文件

@@ -0,0 +1,14 @@
ARCHS = armv7 arm64
include $(THEOS)/makefiles/common.mk

BUNDLE_NAME = PearlRetryPrefs
PearlRetryPrefs_FILES = prpRootListController.m
PearlRetryPrefs_INSTALL_PATH = /Library/PreferenceBundles
PearlRetryPrefs_FRAMEWORKS = UIKit
PearlRetryPrefs_PRIVATE_FRAMEWORKS = Preferences

include $(THEOS_MAKE_PATH)/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/PearlRetryPrefs.plist$(ECHO_END)

+ 24
- 0
pearlretryprefs/Resources/Info.plist 查看文件

@@ -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>PearlRetryPrefs</string>
<key>CFBundleIdentifier</key>
<string>com.gilshahar7.pearlretryprefs</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>prpRootListController</string>
</dict>
</plist>

+ 45
- 0
pearlretryprefs/Resources/Root.plist 查看文件

@@ -0,0 +1,45 @@
<?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>PearlRetry</string>
</dict>
<dict>
<key>cell</key>
<string>PSStaticTextCell</string>
<key>label</key>
<string>Retry delay in seconds</string>
</dict>
<dict>
<key>cell</key>
<string>PSSliderCell</string>
<key>default</key>
<real>0.7</real>
<key>min</key>
<real>0.0</real>
<key>max</key>
<real>1.5</real>
<key>showValue</key>
<true/>
<key>isSegmented</key>
<true/>
<key>segmentCount</key>
<integer>30</integer>
<key>defaults</key>
<string>com.gilshahar7.pearlretryprefs</string>
<key>key</key>
<string>delay</string>
<key>PostNotification</key>
<string>com.gilshahar7.pearlretryprefs.settingschanged</string>
</dict>
</array>
<key>title</key>
<string>PearlRetryPrefs</string>
</dict>
</plist>

二进制
pearlretryprefs/Resources/icon@3x.png 查看文件

之前 之后
宽度: 87  |  高度: 87  |  大小: 27KB

+ 21
- 0
pearlretryprefs/entry.plist 查看文件

@@ -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>PearlRetryPrefs</string>
<key>cell</key>
<string>PSLinkCell</string>
<key>detail</key>
<string>prpRootListController</string>
<key>icon</key>
<string>icon.png</string>
<key>isController</key>
<true/>
<key>label</key>
<string>PearlRetry</string>
</dict>
</dict>
</plist>

+ 5
- 0
pearlretryprefs/prpRootListController.h 查看文件

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

@interface prpRootListController : PSListController

@end

+ 33
- 0
pearlretryprefs/prpRootListController.m 查看文件

@@ -0,0 +1,33 @@
#import <Preferences/PSSpecifier.h>
#include "prpRootListController.h"

@implementation prpRootListController

- (id)readPreferenceValue:(PSSpecifier*)specifier {
NSString *path = [NSString stringWithFormat:@"/User/Library/Preferences/%@.plist", specifier.properties[@"defaults"]];
NSMutableDictionary *settings = [NSMutableDictionary dictionary];
[settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile:path]];
return (settings[specifier.properties[@"key"]]) ?: specifier.properties[@"default"];
}

- (void)setPreferenceValue:(id)value specifier:(PSSpecifier*)specifier {
NSString *path = [NSString stringWithFormat:@"/User/Library/Preferences/%@.plist", specifier.properties[@"defaults"]];
NSMutableDictionary *settings = [NSMutableDictionary dictionary];
[settings addEntriesFromDictionary:[NSDictionary dictionaryWithContentsOfFile:path]];
[settings setObject:value forKey:specifier.properties[@"key"]];
[settings writeToFile:path atomically:YES];
CFStringRef notificationName = (CFStringRef)specifier.properties[@"PostNotification"];
if (notificationName) {
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), notificationName, NULL, NULL, YES);
}
}

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

return _specifiers;
}

@end

正在加载...
取消
保存