Saturday, December 12, 2009

How to remove ads from SBSettings

You have to install PHP and run this script
removeaps.php Select all

$filename = trim(shell_exec("find /Applications.* -type f -name SBSettings"));
$backup_filename = $filename.".bak";
$tmp_filename = $filename.".tmp";

while (file_exists($backup_filename)) {
$backup_filename .= ".bak";

if (!file_exists($filename)) {
die("Can't open: $filename\n");

copy($filename, $backup_filename);

echo "Patching file: $filename\n";
echo "Backup saved at: $backup_filename\n";

$fp = fopen($filename,"r");
$data = fread($fp, filesize($filename));

$data = str_replace('','extra.th4bigbo',$data);
$data = str_replace('','',$data);
$data = str_replace('','',$data);
$data = str_replace('','',$d ata);
$data = str_replace('','',$data);
$data = str_replace('','',$data);

$fp = fopen($tmp_filename,"w");

shell_exec("ldid -s \"$tmp_filename\"");
shell_exec("mv \"$tmp_filename\" \"$filename\"");
shell_exec("chmod 4755 \"$filename\"");
echo "\nDone! :)\n";


And you have to ldid -s /Applications/


Anonymous said...

I've installed PHP from saurik's source. But, how to run that (via WinSCP or Mobileterminal?) and Mobileterminal says "-sh: ldid: command not found"

Anonymous said...

Very clever...

It appears that this php script modifies the binary/executable itself (private/var/stash/Aplications.XxXxXx/

If you don't want to do it via php than just navigate to the binary and edit it in your favorite hex editor. (example: replace with an arbitrary non existent site, but keep the same length "perhaps due to check-sums/stability issue?")

Than again im not familiar with php on iphone...