Restoring AddressBook.sqlitedb to iPhone – A Simplified Procedure

In my previous article, I described how to restore contacts from a backup to an iPhone.  The infuriating thing about restoring AddressBook.sqlitedb to an iPhone is that one can’t just drop in a replacement file, because after you reboot, the new file gets overwritten with an empty one.  I traced the overwriting of the addressbook to a process called dataaccessd.  This process can’t be killed easily, because launchd will automatically restart it if it dies.  After some testing, I have now devised a procedure which is simpler than the one described in my previous article:

This procedure assumes that you have already obtained a copy of AddressBook.sqlitedb which contains the contacts you want to restore.

1. Using iFunBox, navigate to Raw File System/Library/LaunchDaemons and copy com.apple.AddressBook.plist and com.apple.dataaccess.dataaccessd.plist to your computer.

2. Using iFunBox, delete com.apple.AddressBook.plist andcom.apple.dataaccess.dataaccessd.plist from your iPhone.

3. Power off and restart your iPhone

4. Using iFunBox, copy your AddressBook.sqlitedb into the iPhone at Raw File System/var/mobile/Library/AddressBook

5. Using iFunBox, copy the com.apple.AddressBook.plist andcom.apple.dataaccess.dataaccessd.plist from your computer back to the Raw File System/Library/LaunchDaemons folder in your iPhone.

6. Power off and restart the iPhone, and enjoy your restored contacts.

SS(影梭)一键搭建教程

环境:CentOS6.5 

1、 运行安装脚本

wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh
chmod +x shadowsocks.sh

./shadowsocks.sh 2>&1 | tee shadowsocks.log

2、相关配置

/etc/shadowsocks.json 
{
   "server":"your_server_ip",
   "local_address": "127.0.0.1",
   "local_port":1080,
   "port_password":{
       "8989":"password0",
       "9001":"password1",
       "9002":"password2",
       "9003":"password3",
       "9004":"password4"
   },
   "timeout":300,
   "method":"aes-256-cfb",
   "fast_open": false

Debian 的 preinst, postinst, prerm, 和 postrm 脚本

http://wiki.ubuntu.org.cn/Deb%E5%8C%85%E7%AE%A1%E7%90%86%E5%90%91%E5%AF%BC

deb包的执行脚本

许多软件安装前或安装后都需要进行一些设置工作,deb格式的软件安装过程执行的操作是由如下脚本来控制的

debian/preinst

debian/postinst

debian/prerm

debian/postrm

yagmail -- Yet Another GMAIL/SMTP client

https://github.com/kootenpv/yagmail

The goal here is to make it as simple and painless as possible to send emails.

In the end, your code will look something like this:

使用safari对webview进行调试

1. 打开模拟器(真机)的开发者模式

【设置】->【Safari】->【高级】->【Web检查器】打开

打开iphone设备中的web检查器

2. 打开Mac上Safari的开发者模式

打开Safari中的开发者模式

3. 在模拟器(真机)中打开webview应用,并打开Safari查看网络信息

打开Safari中的调试

 

完成以上几步就可以调试自己应用的webview了,那么如何调试AppStore下载应用的webview呢?

1、砸壳目标App

 

2、提取entitlement,添加get-task-allow 权限

 

3、重签名应用

 

4、安装

How to include resource files in Theos makefile?

That is not the way you include resources using theos. MyTweak_FILES variable should only include files that can be compiled. Make file handles resources differently.

To include resources you need to create a bundle as follows.

1) Create a folder called Resources in the tweak.xm directory.

2) Put all your resource files (all your PNG's) into that folder.

3) Add the following info to your make file

4) Define your bundle as follows on top of your tweak.xm file.

5) You can now initialize the bundle and use the images within your tweak as follows:

In the above steps replace your_bundle_identifier with your tweaks bundle identifier which would be in the control file. (ex: com.yourdomain.tweak_name)

Also replace your_image_name with the name of the image you want to use.

You can pretty much use any resources (ex: sound files) the above way.

https://stackoverflow.com/questions/15999757/how-to-include-resource-files-in-theos-makefile

使用 Xcode 调试第三方应用

1、将目标应用砸壳后保存到本地

http://blog.linhere.com/archives/555.html

DYLD_INSERT_LIBRARIES=/path/to/dumpdecrypted.dylib /path/to/executable

2、抽出需要的架构

lipo -detailed_info WeChat 查看静态库的架构支持

lipo WeChat -thin armv7 -output WeChat_armv7

3、还原符号表

https://github.com/tobefuturer/restore-symbol

4、提取entitlement,添加get-task-allow 权限

ldid -e WeChat.app/WeChat >> Entitlements.plist

添加:

<key>get-task-allow</key>

<true/>

5、重签名应用

获取设备上所有的证书列表:security find-identity -v -p codesigning

签名:

codesign -f -s "iPhone Developer: XXXX" --signing-time none --entitlement ./Entitlements.plist ./WeChat.app

6、安装

brew install ideviceinstaller

ideviceinstaller -i WeChat.app

或:

brew install ios-deploy
ios-deploy -d -b xxxx.app


资料:

http://swiftyper.com/2017/07/02/attach-third-app-using-xcode/

https://mp.weixin.qq.com/s?__biz=MjM5NTIyNTUyMQ==&mid=2709545175&idx=1&sn=1c080685fabf2f24269c6e544e9213d7&scene=0&key=cf237d7ae24775e8a291c430bd754bd72b2faee6c9edbe6ff3d32afdfd41e008ef2567182b323d8febc85346baef67cb&ascene=0&uin=NDU1NzA2MTk1&devicetype=iMac+MacBookPro12%2C1+OSX+OSX+10.11.5+build(15F34)&version=11020201&pass_ticket=epsDy5NSjlDNy2GvOKYYr9q%2FLcd99r%2BiT33eJCGerkt4I0vhPQPPuJbOUec7diuD

https://testerhome.com/topics/4558

一些命令记录:

lipo -info Tribe.decrypted  查看cpu架构

lipo -thin armv7 Tribe.decrypted -output Tribe.decrypted.armv7  抽出架构

otool -l Tribe.decrypted | grep crypt  查看是否加密