Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Add pref in Settings app to let user know how to open tweak settings
Browse files Browse the repository at this point in the history
  • Loading branch information
haoict committed Jun 14, 2020
1 parent 85dea99 commit f7b400b
Show file tree
Hide file tree
Showing 16 changed files with 265 additions and 5 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# THEOS_DEVICE_IP = 192.168.1.45

ARCHS = arm64 arm64e
TARGET = iphone:clang:12.2:10.0

INSTALL_TARGET_PROCESSES = LightSpeedApp Messenger
INSTALL_TARGET_PROCESSES = LightSpeedApp Messenger Preferences

include $(THEOS)/makefiles/common.mk

Expand All @@ -14,6 +12,10 @@ MessengerNoAds_CFLAGS = -fobjc-arc

include $(THEOS_MAKE_PATH)/tweak.mk

SUBPROJECTS += pref

include $(THEOS_MAKE_PATH)/aggregate.mk

internal-stage::
$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/Application\ Support/MessengerNoAds.bundle/$(ECHO_END)
$(ECHO_NOTHING)cp -a settingsview/Resources/. $(THEOS_STAGING_DIR)/Library/Application\ Support/MessengerNoAds.bundle/$(ECHO_END)
4 changes: 2 additions & 2 deletions control
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: com.haoict.messengernoads
Name: Messenger No Ads
Depends: mobilesubstrate, com.haoict.libhdev, firmware (>= 10)
Depends: mobilesubstrate, com.haoict.libhdev (>= 4.1.0), firmware (>= 10)
Conflicts: com.haoict.messengernoads
Version: 3.5.0
Version: 3.6.0
Architecture: iphoneos-arm
Description: The best tweak for Messenger app.
The best tweak for Messenger app.
Expand Down
Binary file added photoshop/Banner-pref.psd
Binary file not shown.
5 changes: 5 additions & 0 deletions pref/MNARootListController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#import <libhdev/HPreferences/HPSPreferences.h>
#import <libhdev/HUtilities/HCommon.h>

@interface MNARootListController : HPSRootListController
@end
17 changes: 17 additions & 0 deletions pref/MNARootListController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "MNARootListController.h"

#define TWEAK_TITLE "Messenger No Ads"
#define TINT_COLOR "#00a2e8"
#define BUNDLE_NAME "MNAPref"

@implementation MNARootListController
- (id)init {
self = [super init];
if (self) {
self.tintColorHex = @TINT_COLOR;
self.bundlePath = [NSString stringWithFormat:@"/Library/PreferenceBundles/%@.bundle", @BUNDLE_NAME];
}
return self;
}

@end
16 changes: 16 additions & 0 deletions pref/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
ARCHS = arm64 arm64e

include $(THEOS)/makefiles/common.mk

BUNDLE_NAME = MNAPref
MNAPref_FILES = $(wildcard *.m)
MNAPref_INSTALL_PATH = /Library/PreferenceBundles
MNAPref_PRIVATE_FRAMEWORKS = Preferences
MNAPref_EXTRA_FRAMEWORKS = libhdev
MNAPref_CFLAGS = -fobjc-arc

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/MNAPref.plist$(ECHO_END)
Binary file added pref/Resources/Banner.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions pref/Resources/Info.plist
Original file line number Diff line number Diff line change
@@ -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>MNAPref</string>
<key>CFBundleIdentifier</key>
<string>com.haoict.messengernoadspref</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>MNARootListController</string>
</dict>
</plist>
122 changes: 122 additions & 0 deletions pref/Resources/Root.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?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>headerCellClass</key>
<string>HPSHeaderImageCell</string>
<key>image</key>
<string>/Library/PreferenceBundles/MNAPref.bundle/Banner.jpg</string>
</dict>

<!-- <dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>headerCellClass</key>
<string>HPSHeaderCell</string>
<key>label</key>
<string>Messenger No Ads</string>
<key>subtitle</key>
<array>
<string>By @haoict</string>
<string>Free and Open Source!</string>
<string>Made with love</string>
</array>
</dict> -->

<!-- Support Me -->
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>SUPPORT_ME</string>
</dict>
<dict>
<key>cell</key>
<string>PSLinkCell</string>
<key>cellClass</key>
<string>HPSLinkCell</string>
<key>label</key>
<string>Hao Nguyen 👨🏻‍💻</string>
<key>subtitle</key>
<string>@haoict</string>
<key>action</key>
<string>openURL:</string>
<key>url</key>
<string>https://messenger.com/haoict</string>
</dict>
<dict>
<key>cell</key>
<string>PSLinkCell</string>
<key>cellClass</key>
<string>HPSLinkCell</string>
<key>label</key>
<string>DONATION</string>
<key>subtitle</key>
<string>BUY_ME_A_COFFEE</string>
<key>action</key>
<string>openURL:</string>
<key>url</key>
<string>https://paypal.me/haoict</string>
</dict>
<dict>
<key>cell</key>
<string>PSLinkCell</string>
<key>cellClass</key>
<string>HPSLinkCell</string>
<key>label</key>
<string>FEATURE_REQUEST</string>
<key>subtitle</key>
<string>SEND_ME_AN_EMAIL_WITH_YOUR_REQUEST</string>
<key>action</key>
<string>openURL:</string>
<key>url</key>
<string>mailto:hao.ict56@gmail.com?subject=Messenger%20Feature%20Request</string>
</dict>
<dict>
<key>cell</key>
<string>PSLinkCell</string>
<key>cellClass</key>
<string>HPSLinkCell</string>
<key>label</key>
<string>SOURCE_CODE</string>
<key>subtitle</key>
<string>Github</string>
<key>action</key>
<string>openURL:</string>
<key>url</key>
<string>https://github.com/haoict/messengernoads</string>
</dict>
<dict>
<key>cell</key>
<string>PSLinkCell</string>
<key>cellClass</key>
<string>HPSLinkCell</string>
<key>label</key>
<string>FOUND_A_BUG</string>
<key>subtitle</key>
<string>LEAVE_A_BUG_REPORT_ON_GITHUB</string>
<key>action</key>
<string>openURL:</string>
<key>url</key>
<string>https://github.com/haoict/messengernoads/issues/new</string>
</dict>

<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>footerText</key>
<string>Messenger No Ads, Made With ❤️</string>
<key>isStaticText</key>
<true/>
</dict>

</array>
<key>title</key>
<string>Messenger No Ads</string>
</dict>
</plist>
18 changes: 18 additions & 0 deletions pref/Resources/base.lproj/Root.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"APPLY" = "Apply";
"DO_YOU_REALLY_WANT_TO_KILL_MESSENGER" = "Do you really want to kill Messenger?";
"CONFIRM" = "Confirm";
"CANCEL" = "Cancel";
"DEFAULT" = "Default";
"MAIN_PREFERENCES" = "Main Preferences";
"OTHER_PREFERENCES" = "Other Preferences";
"RESET_SETTINGS" = "Reset Settings";
"SUPPORT_ME" = "Support Me";
"DONATION" = "Donation 💰";
"BUY_ME_A_COFFEE" = "Buy me a coffee";
"FEATURE_REQUEST" = "Feature Request ✨";
"SEND_ME_AN_EMAIL_WITH_YOUR_REQUEST" = "Send Me An Email With Your Request";
"SOURCE_CODE" = "Source Code 🤖";
"FOUND_A_BUG" = "Found A Bug 🐛";
"LEAVE_A_BUG_REPORT_ON_GITHUB" = "Leave A Bug Report on Github";
}
18 changes: 18 additions & 0 deletions pref/Resources/en.lproj/Root.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"APPLY" = "Apply";
"DO_YOU_REALLY_WANT_TO_KILL_MESSENGER" = "Do you really want to kill Messenger?";
"CONFIRM" = "Confirm";
"CANCEL" = "Cancel";
"DEFAULT" = "Default";
"MAIN_PREFERENCES" = "Main Preferences";
"OTHER_PREFERENCES" = "Other Preferences";
"RESET_SETTINGS" = "Reset Settings";
"SUPPORT_ME" = "Support Me";
"DONATION" = "Donation 💰";
"BUY_ME_A_COFFEE" = "Buy me a coffee";
"FEATURE_REQUEST" = "Feature Request ✨";
"SEND_ME_AN_EMAIL_WITH_YOUR_REQUEST" = "Send Me An Email With Your Request";
"SOURCE_CODE" = "Source Code 🤖";
"FOUND_A_BUG" = "Found A Bug 🐛";
"LEAVE_A_BUG_REPORT_ON_GITHUB" = "Leave A Bug Report on Github";
}
Binary file added pref/Resources/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pref/Resources/icon@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions pref/Resources/vi.lproj/Root.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"APPLY" = "Áp dụng";
"DO_YOU_REALLY_WANT_TO_KILL_MESSENGER" = "Bạn có muốn tắt Messenger?";
"CONFIRM" = "Xác nhận";
"CANCEL" = "Hủy";
"DEFAULT" = "Mặc định";
"OTHER_PREFERENCES" = "Tùy chỉnh phụ";
"RESET_SETTINGS" = "Đặt lại tùy chỉnh";
"SUPPORT_ME" = "Hỗ trợ tôi";
"DONATION" = "Ủng hộ 💰";
"BUY_ME_A_COFFEE" = "Mua giúp tôi một ly cà phê";
"FEATURE_REQUEST" = "Yêu cầu thêm tính năng ✨";
"SEND_ME_AN_EMAIL_WITH_YOUR_REQUEST" = "Gửi email yêu cầu";
"SOURCE_CODE" = "Mã nguồn 🤖";
"FOUND_A_BUG" = "Tìm thấy lỗi 🐛";
"LEAVE_A_BUG_REPORT_ON_GITHUB" = "Báo lỗi trên Github";
}
21 changes: 21 additions & 0 deletions pref/entry.plist
Original file line number Diff line number Diff line change
@@ -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>MNAPref</string>
<key>cell</key>
<string>PSLinkCell</string>
<key>detail</key>
<string>MNARootListController</string>
<key>icon</key>
<string>icon.png</string>
<key>isController</key>
<true/>
<key>label</key>
<string>Messenger No Ads</string>
</dict>
</dict>
</plist>
Binary file not shown.

0 comments on commit f7b400b

Please sign in to comment.