├── README.md └── libhdev.framework ├── Headers ├── HPreferences │ ├── HPSEditTextCell.h │ ├── HPSHeaderImageCell.h │ ├── HPSHeaderTextCell.h │ ├── HPSLinkCell.h │ ├── HPSListItemsController.h │ ├── HPSPreferences.h │ ├── HPSRootListController.h │ ├── HPSSliderCell.h │ ├── HPSSubListController.h │ └── HPSSwitchCell.h ├── HUtilities │ ├── HCommon.h │ ├── HDownloadMedia.h │ ├── HDownloadMediaWithProgress.h │ ├── HImageUtil.h │ ├── HLicenseManager.h │ ├── HSecurityViewController.h │ └── HUtilities.h └── libhdev.h ├── Info.plist └── libhdev /README.md: -------------------------------------------------------------------------------- 1 | # libhdev 2 | This is developer library for better preferences and useful utilities. 3 | 4 | ## How to use 5 | 6 | ### Installation: 7 | 8 | - Download this repository put the `libhdev.framework` into your `theos/lib` folder 9 | 10 | ### Importing: 11 | 12 | - Import the library in your header or main file `#import `
13 | - Add the framework to your Makefile `$(TWEAK_NAME)_EXTRA_FRAMEWORKS = libhdev`
14 | - Add dependency to your tweak in your control file `Depends: mobilesubstrate, preferenceloader, com.haoict.libhdev`
15 | - Make sure the user also adds my repo (https://haoict.github.io/cydia/) to be able to download it 16 | 17 | ### Usage: 18 | 19 | Check `libhdev.framework\Headers\...` for public headers 20 | 21 | For example: 22 | In `libhdev.framework\Headers\HUtilities\HCommon.h`, you can see the static function 23 | 24 | ``` 25 | + (void)showAlertMessage:(NSString *)message withTitle:(NSString *)title viewController:(UIViewController *)viewController; 26 | ``` 27 | 28 | You can call it in your code 29 | 30 | ``` 31 | #import 32 | 33 | [HCommon showAlertMessage:@"Hello, world" withTitle:@"Alert" viewController:nil]; 34 | ``` 35 | 36 | More example can be found here: https://github.com/haoict/tiktok-god or https://github.com/haoict/facebook-no-ads or my other open source tweaks in the same Github -------------------------------------------------------------------------------- /libhdev.framework/Headers/HPreferences/HPSEditTextCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "../HUtilities/HCommon.h" 4 | #import "HPSRootListController.h" 5 | 6 | @interface HPSEditTextCell : PSEditableTableCell 7 | @end 8 | -------------------------------------------------------------------------------- /libhdev.framework/Headers/HPreferences/HPSHeaderImageCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "../HUtilities/HCommon.h" 3 | 4 | @interface HPSHeaderImageCell : UITableViewHeaderFooterView 5 | @end 6 | -------------------------------------------------------------------------------- /libhdev.framework/Headers/HPreferences/HPSHeaderTextCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "../HUtilities/HCommon.h" 3 | #import "HPSRootListController.h" 4 | 5 | @interface HPSHeaderTextCell : UITableViewHeaderFooterView 6 | @end 7 | -------------------------------------------------------------------------------- /libhdev.framework/Headers/HPreferences/HPSLinkCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "../HUtilities/HCommon.h" 4 | #import "HPSRootListController.h" 5 | 6 | @interface HPSLinkCell : PSTableCell 7 | @end 8 | -------------------------------------------------------------------------------- /libhdev.framework/Headers/HPreferences/HPSListItemsController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import "../HUtilities/HCommon.h" 5 | #import "HPSRootListController.h" 6 | 7 | @interface HPSListItemsController : PSListItemsController 8 | @end 9 | -------------------------------------------------------------------------------- /libhdev.framework/Headers/HPreferences/HPSPreferences.h: -------------------------------------------------------------------------------- 1 | #import "HPSRootListController.h" 2 | #import "HPSSubListController.h" -------------------------------------------------------------------------------- /libhdev.framework/Headers/HPreferences/HPSRootListController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import "../HUtilities/HCommon.h" 5 | 6 | @interface HPSRootListController : PSListController 7 | @property (nonatomic) NSString *tintColorHex; 8 | @property (nonatomic) NSString *labelTextColorHex; 9 | @property (nonatomic) NSString *subtitleTextColorHex; 10 | @property (nonatomic) NSString *bundlePath; 11 | @property (nonatomic) NSString *plistName; 12 | - (NSString *)getSavedPrefPath:(PSSpecifier *)specifier; 13 | - (NSString *)localizedItem:(NSString *)key; 14 | @end 15 | -------------------------------------------------------------------------------- /libhdev.framework/Headers/HPreferences/HPSSliderCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "../HUtilities/HCommon.h" 4 | #import "HPSRootListController.h" 5 | 6 | @interface HPSSliderCell : PSSliderTableCell 7 | @end 8 | -------------------------------------------------------------------------------- /libhdev.framework/Headers/HPreferences/HPSSubListController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import "./HPSRootListController.h" 5 | 6 | @interface HPSSubListController : HPSRootListController 7 | @end 8 | -------------------------------------------------------------------------------- /libhdev.framework/Headers/HPreferences/HPSSwitchCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "../HUtilities/HCommon.h" 4 | #import "HPSRootListController.h" 5 | 6 | @interface HPSSwitchCell : PSSwitchTableCell 7 | @end 8 | -------------------------------------------------------------------------------- /libhdev.framework/Headers/HUtilities/HCommon.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #define IS_iPAD ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) 5 | #define IS_LANDSCAPE UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) 6 | 7 | typedef NS_ENUM(NSUInteger, HDownloadMediaType) { 8 | Image, 9 | Video 10 | }; 11 | 12 | @interface NSTask : NSObject 13 | @property (copy) NSArray *arguments; 14 | @property (copy) NSString *currentDirectoryPath; 15 | @property (copy) NSDictionary *environment; 16 | @property (copy) NSString *launchPath; 17 | @property (readonly) int processIdentifier; 18 | @property (retain) id standardError; 19 | @property (retain) id standardInput; 20 | @property (retain) id standardOutput; 21 | + (id)currentTaskDictionary; 22 | + (id)launchedTaskWithDictionary:(id)arg1; 23 | + (id)launchedTaskWithLaunchPath:(id)arg1 arguments:(id)arg2; 24 | - (id)init; 25 | - (void)interrupt; 26 | - (bool)isRunning; 27 | - (void)launch; 28 | - (bool)resume; 29 | - (bool)suspend; 30 | - (void)terminate; 31 | @end 32 | 33 | @interface HCommon : NSObject 34 | + (NSString *)localizedItem:(NSString *)key bundlePath:(NSString *)bundlePath; 35 | + (NSString *)localizedItem:(NSString *)key bundlePath:(NSString *)bundlePath table:(NSString *)table; 36 | + (UIColor *)colorFromHex:(NSString *)hexString; 37 | + (void)respring; 38 | + (void)killProcess:(NSString *)procName viewController:(UIViewController *)viewController alertTitle:(NSString *)alertTitle message:(NSString *)message confirmActionLabel:(NSString *)confirmActionLabel cancelActionLabel:(NSString *)cancelActionLabel; 39 | + (void)showAlertMessage:(NSString *)message withTitle:(NSString *)title viewController:(UIViewController *)viewController; 40 | + (void)showToastMessage:(NSString *)message withTitle:(NSString *)title timeout:(double)timeout viewController:(UIViewController *)viewController; 41 | + (BOOL)isDarkMode; 42 | + (BOOL)isNotch; 43 | + (UIWindow *)mainWindow; 44 | @end -------------------------------------------------------------------------------- /libhdev.framework/Headers/HUtilities/HDownloadMedia.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "HCommon.h" 4 | 5 | @interface HDownloadMedia : NSObject 6 | + (void)checkPermissionToPhotosAndDownload:(NSString *)url appendExtension:(NSString *)fileExtension mediaType:(HDownloadMediaType)mediaType toAlbum:(NSString *)albumName; 7 | + (void)checkPermissionToPhotosAndDownloadURL:(NSURL *)url appendExtension:(NSString *)fileExtension mediaType:(HDownloadMediaType)mediaType toAlbum:(NSString *)albumName; 8 | + (void)downloadAndSaveMediaToPhotoLibrary:(NSString *)url appendExtension:(NSString *)fileExtension mediaType:(HDownloadMediaType)mediaType toAlbum:(NSString *)albumName; 9 | @end 10 | -------------------------------------------------------------------------------- /libhdev.framework/Headers/HUtilities/HDownloadMediaWithProgress.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import "HCommon.h" 5 | 6 | @interface HDownloadMediaWithProgress : NSObject 7 | @property (nonatomic, retain) UIView *view; 8 | @property (nonatomic, retain) NSURL *mediaUrl; 9 | @property (nonatomic, retain) NSString *fileExtension; 10 | @property (nonatomic, assign) HDownloadMediaType mediaType; 11 | @property (nonatomic, retain) NSString *albumName; 12 | @property (nonatomic, retain) UILabel *percentageLabel; 13 | - (void)checkPermissionToPhotosAndDownloadURL:(NSURL *)url appendExtension:(NSString *)fileExtension mediaType:(HDownloadMediaType)mediaType toAlbum:(NSString *)albumName view:(UIView *)view; 14 | - (void)checkPermissionToPhotosAndDownloadURL:(NSURL *)url appendExtension:(NSString *)fileExtension mediaType:(HDownloadMediaType)mediaType toAlbum:(NSString *)albumName viewController:(UIViewController *)viewController; 15 | - (void)checkPermissionToPhotosAndDownload:(NSString *)url appendExtension:(NSString *)fileExtension mediaType:(HDownloadMediaType)mediaType toAlbum:(NSString *)albumName view:(UIView *)view; 16 | - (void)checkPermissionToPhotosAndDownload:(NSString *)url appendExtension:(NSString *)fileExtension mediaType:(HDownloadMediaType)mediaType toAlbum:(NSString *)albumName viewController:(UIViewController *)viewController; 17 | @end 18 | -------------------------------------------------------------------------------- /libhdev.framework/Headers/HUtilities/HImageUtil.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "HCommon.h" 4 | 5 | @interface HImageUtil : NSObject 6 | + (NSString *)encodeToBase64String:(UIImage *)image; 7 | + (UIImage *)decodeBase64ToImage:(NSString *)strEncodeData; 8 | + (NSString *)hexFromColor:(UIColor *)color; 9 | + (UIColor *)colorFromHex:(NSString *)hexString; 10 | + (UIColor *)backgroundColor:(UIImage *)image; 11 | + (UIColor *)primaryColor:(UIImage *)image; 12 | + (UIColor *)secondaryColor:(UIImage *)image; 13 | + (BOOL)isDarkImage:(UIImage *)image; 14 | @end -------------------------------------------------------------------------------- /libhdev.framework/Headers/HUtilities/HLicenseManager.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "HCommon.h" 4 | 5 | @interface HLicenseManager : NSObject 6 | + (void)licenseTracker:(NSString *)licenseServer apiKey:(NSString *)apiKey plistFile:(NSString *)plistFile tweakName:(NSString *)tweakName tweakVersion:(NSString *)tweakVersion; 7 | @end -------------------------------------------------------------------------------- /libhdev.framework/Headers/HUtilities/HSecurityViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | 5 | @interface HSecurityViewController : UIViewController 6 | - (void)authenticate; 7 | @end -------------------------------------------------------------------------------- /libhdev.framework/Headers/HUtilities/HUtilities.h: -------------------------------------------------------------------------------- 1 | #import "HCommon.h" 2 | #import "HDownloadMedia.h" 3 | #import "HDownloadMediaWithProgress.h" 4 | #import "HImageUtil.h" 5 | #import "HLicenseManager.h" 6 | #import "HSecurityViewController.h" -------------------------------------------------------------------------------- /libhdev.framework/Headers/libhdev.h: -------------------------------------------------------------------------------- 1 | #import "HPreferences/HPSPreferences.h" 2 | #import "HUtilities/HUtilities.h" -------------------------------------------------------------------------------- /libhdev.framework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | libhdev 9 | CFBundleIdentifier 10 | com.haoict.libhdev 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | FMWK 15 | CFBundleShortVersionString 16 | 1.0.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /libhdev.framework/libhdev: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haoict/libhdev-public/9177b763b170acb79f89d1e0543051bf7c4f49fa/libhdev.framework/libhdev --------------------------------------------------------------------------------