<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Guy Kaplan on Medium]]></title>
        <description><![CDATA[Stories by Guy Kaplan on Medium]]></description>
        <link>https://medium.com/@guykaplan?source=rss-cfa9dc16b60------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*TujKy_dKEAfgYCAT.</url>
            <title>Stories by Guy Kaplan on Medium</title>
            <link>https://medium.com/@guykaplan?source=rss-cfa9dc16b60------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:19:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@guykaplan/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Developing an iOS 12 substrate tweak]]></title>
            <link>https://medium.com/@guykaplan/developing-an-ios-12-substrate-tweak-54a2e4da4187?source=rss-cfa9dc16b60------2</link>
            <guid isPermaLink="false">https://medium.com/p/54a2e4da4187</guid>
            <category><![CDATA[ios-jailbreak]]></category>
            <category><![CDATA[cydia]]></category>
            <dc:creator><![CDATA[Guy Kaplan]]></dc:creator>
            <pubDate>Mon, 09 Sep 2024 15:27:31 GMT</pubDate>
            <atom:updated>2024-09-09T15:27:31.981Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I will cover the steps needed in order to develop a Cydia Substrate jailbreak tweak.</p><h3>Background (How does it even work)</h3><p>A tweak is basically a dynamic library that is being injected to specified applications (according to a predefined filter) that can actually hook some of the Obj-C \ Swift methods (or messages if you’re using Apple’s terms) after you do that, you can just choose your own implementation of the method.</p><h3>Tools</h3><p>We will be using the following tools in order to accomplish our task.</p><h3>Frida</h3><p>Before we even start hooking to methods, we need to know <strong>what method</strong> we want to hook to.</p><p>I like to use this neat tool called frida, it’s basically a dylib injection framework written which has a good python API</p><h4>Installation</h4><p>On your device, open up Cydia and add the following repo <a href="https://build.frida.re/">https://build.frida.re</a></p><p>On your Mac, install frida using python pip pip install frida</p><h3>Theos</h3><p>Theos is a little tool which helps you with all the application creation and compilation.</p><p>You can find all you need to know about installing Theos here: <a href="https://github.com/theos/theos/wiki/Installation">https://github.com/theos/theos/wiki/Installation</a></p><p>After you download theos, download the appropriate private SDK into your $THEOS/sdks folder from here: <a href="https://github.com/theos/sdks">https://github.com/theos/sdks</a></p><h3>Writing the tweak</h3><p>In this tutorial, I will guide you through the creation of WhatsappReadReceiptsDisabler — a simple tweak I have written to disable read receipts in WhatsApp.</p><h3>Finding the right method</h3><p>This is where the true power of Frida comes in hand.</p><p>First, we want to know the name of the process we are looking for, run</p><p>frida-ps -U | grep -i whatsapp</p><p>frida-ps is like ps (shows running processes), -U means it should this command on the connected USB device (which will be your iPhone).</p><p>Gives us this output:</p><pre>PID  Name<br>----  -------------------------------------------------<br>1667  WhatsApp<br> 635  AppleIDAuthAgent<br>1210  AssetCacheLocatorService<br>...</pre><p>We can see that WhatsApp is the name of our app, and 1667 is the current PID</p><p>Now we will try this line:</p><p>frida-trace -U -m &quot;-[* *Receipt*]&quot;</p><p>Frida trace is a tool for printing calls for methods, here we use the obj-c filter of methods that contain the string Receipt in them (using wildcards), this will give us the following output (after getting into one of the conversations):</p><pre>54599 ms  -[WAChatViewController enqueueMessagesForSendingReadReceipts:0x1d0a41080]<br> 54662 ms  -[XMPPConnection sendReadReceiptsForMessagesIfNeeded:0x1d085d2b0]<br> 54662 ms    | -[WAMessage needsSendReadReceipt]<br> 54662 ms    | -[WAMessage needsSendReadReceipt]<br> 54662 ms    | -[WAMessage needsSendReadReceipt]<br> 54662 ms    | -[WAMessage needsSendReadReceipt]<br> 54662 ms    | -[WAMessage needsSendReadReceipt]<br> 54662 ms    | -[WAMessage needsSendReadReceipt]<br> 54662 ms    | -[WAMessage needsSendReadReceipt]<br> 54663 ms    | -[XMPPMultiReceipt addReceiptId:0x1d1243300 edit:0x0]<br> 54663 ms  -[XMPPConnection sendReadReceiptsForMessagesIfNeeded:0x1d0a41080]<br> 54663 ms    | -[WAMessage needsSendReadReceipt]<br> 54663 ms    | -[WAMessage needsSendReadReceipt]<br> 54663 ms    | -[WAMessage needsSendReadReceipt]<br> 54663 ms    | -[WAMessage needsSendReadReceipt]<br> 54663 ms    | -[WAMessage needsSendReadReceipt]<br> 54663 ms    | -[WAMessage needsSendReadReceipt]<br> 54663 ms    | -[WAMessage needsSendReadReceipt]</pre><p>My guess is that</p><pre>[XMPPConnection sendReadReceiptsForMessagesIfNeeded]</pre><p>is the method we are looking for.</p><h3>Hooking</h3><p>Let’s create the tweak using theos</p><p>$THEOS/bin/nic.pl</p><p>Select the appropriate settings, in the filter field we will choose:</p><p>net.whatsapp.WhatsApp</p><p>as this is the identifier of the WhatsApp application (you can find this by ssh-ing to your device and running ps -xe)</p><p>A folder will be created, looking inside we will find a file named​ Tweak.xm open it and add the following lines:</p><pre>%hook XMPPConnection</pre><pre>- (void) sendReadReceiptsForMessagesIfNeeded:(id)arg {<br>    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@&quot;ROFL&quot; <br>                                                message:@&quot;Dee dee doo doo.&quot;<br>                                               delegate:self   <br>                                      cancelButtonTitle:@&quot;OK&quot;                                                     <br>                                      otherButtonTitles:nil]; <br>    [alert show];<br>    %orig;<br>}</pre><pre>%end</pre><p>This will cause the method to open an alert view each time the method is being called so we will know we got the right method.</p><p>Build the package</p><p>make package</p><p>And deploy to device:</p><p>THEOS_DEVICE_IP=[your device ip] make install</p><p>after doing so, we can just remove the code from inside the method, this will make the method do nothing (and not send the read receipts).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54a2e4da4187" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>