Difference between revisions of "Theos on MAC OS"

From Hawk Wiki
Jump to: navigation, search
(How to watch syslog in ios 8)
Line 3: Line 3:
 
First, set the os path. <br>
 
First, set the os path. <br>
 
<pre>export THEOS=/git/theos</pre>
 
<pre>export THEOS=/git/theos</pre>
 +
In mac, you can do "vim ~/.bash_profile" and add "export THEOS=/git/theos" <br>
 
Download from git, you can choose your own folder
 
Download from git, you can choose your own folder
 
<pre>
 
<pre>
Line 13: Line 14:
 
</pre>
 
</pre>
 
'''There is a bug. Need to copy from iOS device /Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate to $THEOS/lib/libsubstrate.dylib'''
 
'''There is a bug. Need to copy from iOS device /Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate to $THEOS/lib/libsubstrate.dylib'''
 +
 
Install dkpg, download from<br>
 
Install dkpg, download from<br>
 
http://www.macports.org/install.php<br>
 
http://www.macports.org/install.php<br>
Line 21: Line 23:
 
</pre>
 
</pre>
  
Additional templates<br>
+
Additional templates (optional)<br>
 
https://github.com/DHowett/theos-nic-templates<br>
 
https://github.com/DHowett/theos-nic-templates<br>
 
copy and paste to $THEOS/templates/iphone<br>
 
copy and paste to $THEOS/templates/iphone<br>
Line 29: Line 31:
 
</pre>
 
</pre>
  
After making you tweak, do
+
choose the tweak type.<br>
 +
 
 +
After edit you tweak<br>
 +
add THEOS_DEVICE_IP = 10.101.66.113 <your device ip> into makefile<br>
 +
also add ARCHS = armv7 arm64 into makefile <br>
 +
 
 
<pre>
 
<pre>
// add THEOS_DEVICE_IP = 10.101.66.113 <your device ip> into makefile
 
 
make package install
 
make package install
 
// enter your ssh password
 
// enter your ssh password
 +
</pre>
 +
 +
sample tweak.xm
 +
<pre>
 +
@interface NSString (MD5)
 +
- (id)Md5String;
 +
@end
 +
 +
%hook NSString
 +
// log string before and after md5
 +
- (id)Md5String {
 +
  %log(@"HW: -------------------------Tweak: Md5String-------------------------\n");
 +
  %log(self);
 +
  id ret = %orig;
 +
  %log(ret);
 +
  return ret;
 +
}
 +
%end
 
</pre>
 
</pre>
  

Revision as of 18:51, 20 August 2015

Install theos

This procedure works on Mac OS Yosemite.
First, set the os path.

export THEOS=/git/theos

In mac, you can do "vim ~/.bash_profile" and add "export THEOS=/git/theos"
Download from git, you can choose your own folder

cd /git
git clone https://github.com/DHowett/theos.git

Generate substrate

sudo $THEOS/bin/bootstrap.sh substrate

There is a bug. Need to copy from iOS device /Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate to $THEOS/lib/libsubstrate.dylib

Install dkpg, download from
http://www.macports.org/install.php
restart terminal after install

sudo port selfupdate
sudo port install dpkg

Additional templates (optional)
https://github.com/DHowett/theos-nic-templates
copy and paste to $THEOS/templates/iphone
Now you can create tweaks from templates

$THEOS/bin/nic.pl

choose the tweak type.

After edit you tweak
add THEOS_DEVICE_IP = 10.101.66.113 <your device ip> into makefile
also add ARCHS = armv7 arm64 into makefile

make package install
// enter your ssh password

sample tweak.xm

@interface NSString (MD5)
- (id)Md5String;
@end

%hook NSString
// log string before and after md5
- (id)Md5String {
  %log(@"HW: -------------------------Tweak: Md5String-------------------------\n");
  %log(self);
  id ret = %orig;
  %log(ret);
  return ret;
}
%end

How to watch syslog in ios 8

apt-get install socat
socat - UNIX-CONNECT:/var/run/lockdown/syslog.sock
watch