Jump to content

16 posts in this topic

Recommended Posts

Posted

I created my tweak and prefbundle according to https://iosgods.com/topic/444-tutorial-how-to-make-a-preference-bundle/

 

My preference bundle doesn't appear in settings app after I respring and it's not there. Please help and I'll give you what you need to look at.

 

I changed whatever it said to change in the files, and I included the recommended form of the asking something for prefbundle

 

I also included respring button, and ui alert properly according to the tut

Posted

And don't include a "&" in your pref at all. You actually need to use the ampersand instead.

Posted

Show your tweak.xm & .plist

Tweak.xm:

 

#define PLIST_PATH @"/var/mobile/Library/Preferences/NoSettingsSearch.plist"

 

inline bool GetPrefBool(NSString *key)

{

return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];

}

 

%hook PSSearchController

-(id)searchBar {

if(GetPrefBool(@"kNoSettingsSearch")) {

return NULL;

}

return %orig;

}

 

%end

 

 

 

 

 

.Plist from Prefbundle:

 

<?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>cell</key>

<string>PSLinkCell</string>

<key>icon</key>

<string>icon.png</string>

<key>label</key>

<string>NoSettingsSearch</string>

</dict>

<key>items</key>

<array>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>label</key>

<string>On or Off</string>

</dict>

<dict>

<key>cell</key>

<string>PSSwitchCell</string>

<key>default</key>

<false/>

<key>defaults</key>

<string>NoSettingsSearch</string>

<key>key</key>

<string>kSettingsSearch</string>

<key>label</key>

<string>Search (On or Off)</string>

</dict>

<dict>

<key>cell</key>

<string>PSGroupCell</string>

<key>label</key>

<string>Tweak by Sunny Patel only for Use!</string>

</dict>

<dict>

<key>cell</key>

<string>PSTextCell</string>

<key>label</key>

<string>Visit http://youtube.com/StarSunSunny for more!</string>

</dict>

</array>

<key>title</key>

<string>NoSettingsSearch</string>

</dict>

<dict>

<key>cell</key>

<string>PSButtonCell</string>

<key>label</key>

<string>Respring</string>

<key>action</key>

<string>respring</string>

</dict>

<dict>

<key>cell</key>

<string>PSButtonCell</string>

<key>action</key>

<string>apply</string>

<key>label</key>

<string>Thanks</string>

</dict>

<dict>

<key>action</key>

<string>link</string>

<key>cell</key>

<string>PSButtonCell</string>

<key>label</key>

<string>Subscribe to My Channel!</string>

</dict>

</plist>

Posted

Tweak.xm:

 

#define PLIST_PATH @"/var/mobile/Library/Preferences/NoSettingsSearch.plist"
inline bool GetPrefBool(NSString *key)
{
return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}
%hook PSSearchController
-(id)searchBar {
if(GetPrefBool(@"kNoSettingsSearch")) {
return NULL;
}
return %orig;
}
%end
.Plist from Prefbundle:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "[url=http://www.apple.com/DTDs/PropertyList-1.0.dtd"]http://www.apple.com/DTDs/PropertyList-1.0.dtd">[/url]
<plist version="1.0">
<dict>
	<key>entry</key>
	<dict>
		<key>cell</key>
		<string>PSLinkCell</string>
		<key>icon</key>
		<string>icon.png</string>
		<key>label</key>
		<string>NoSettingsSearch</string>
	</dict>
	<key>items</key>
	<array>
		<dict>
			<key>cell</key>
			<string>PSGroupCell</string>
			<key>label</key>
			<string>On or Off</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSSwitchCell</string>
			<key>default</key>
			<false/>
			<key>defaults</key>
			<string>NoSettingsSearch</string>
			<key>key</key>
			<string>kSettingsSearch</string>
			<key>label</key>
			<string>Search (On or Off)</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSGroupCell</string>
			<key>label</key>
			<string>Tweak by Sunny Patel only for Use!</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSTextCell</string>
			<key>label</key>
			<string>Visit [url=http://youtube.com/StarSunSunny]http://youtube.com/StarSunSunny[/url] for more!</string>
		</dict>
	</array>
	<key>title</key>
	<string>NoSettingsSearch</string>
</dict>
<dict>
	<key>cell</key>
	<string>PSButtonCell</string>
	<key>label</key>
	<string>Respring</string>
	<key>action</key>
	<string>respring</string>
</dict>
<dict>
       <key>cell</key>
       <string>PSButtonCell</string>
       <key>action</key>
       <string>apply</string>
       <key>label</key>
       <string>Thanks</string>
</dict>
<dict>
	<key>action</key>
	<string>link</string>
	<key>cell</key>
	<string>PSButtonCell</string>
	<key>label</key>
	<string>Subscribe to My Channel!</string> 
</dict>
</plist> 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines