<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Adolfo Reyna</title>
    <description>The latest articles on DEV Community by Adolfo Reyna (@aeroreyna).</description>
    <link>https://dev.to/aeroreyna</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F142129%2F44bebcaa-6fea-459b-a71e-cf15cb62fa6b.jpeg</url>
      <title>DEV Community: Adolfo Reyna</title>
      <link>https://dev.to/aeroreyna</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aeroreyna"/>
    <language>en</language>
    <item>
      <title>Making a New Native App for a Jailbroken iPhone 6</title>
      <dc:creator>Adolfo Reyna</dc:creator>
      <pubDate>Tue, 26 May 2026 23:19:30 +0000</pubDate>
      <link>https://dev.to/aeroreyna/making-a-new-native-app-for-a-jailbroken-iphone-6-16o5</link>
      <guid>https://dev.to/aeroreyna/making-a-new-native-app-for-a-jailbroken-iphone-6-16o5</guid>
      <description>&lt;h1&gt;
  
  
  Making a New Native App for a Jailbroken iPhone 6
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This project was performed on my own jailbroken iPhone 6 for experimentation and learning. Jailbreaking, installing packages, building software directly on-device, and changing system configuration can cause instability, security issues, data loss, or require restoring the phone. Commands and package availability may vary depending on your jailbreak, repositories, and iOS version. Proceed only on hardware you own and understand that you do so at your own risk.&lt;/p&gt;

&lt;p&gt;For this experiment, I used OpenAI Codex as a hands-on development assistant. Codex connected to the iPhone over SSH with my authorization, inspected the available tools, installed required packages, created and compiled the sample app, packaged and installed it, and verified that it launched. I supervised the process and permitted access to the device.&lt;/p&gt;

&lt;p&gt;This blog post was also written with Codex: it organized the technical steps, command examples, source snippets, and explanations based on the work carried out during the session.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The iPhone 6 is old hardware now, but it is still a pleasant little computer:&lt;br&gt;
a good screen, touch input, Wi-Fi, battery power, speakers, sensors, and a&lt;br&gt;
compact body. With an iPhone 6 running iOS 12.5.8 and a jailbreak, I wanted to&lt;br&gt;
find out whether it could still be a practical target for new software.&lt;/p&gt;

&lt;p&gt;The answer is yes. In this project I connected to the phone over SSH, explored&lt;br&gt;
low-level display access, installed an on-device iOS application toolchain, and&lt;br&gt;
built a genuine UIKit &lt;strong&gt;Hello World&lt;/strong&gt; app packaged as a Cydia-compatible&lt;br&gt;
Debian package.&lt;/p&gt;

&lt;p&gt;The finished app runs directly from the Home Screen and displays a fullscreen&lt;br&gt;
native interface with a working button:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello, iPhone 6!
Native UIKit app installed through a .deb
[ Tap Me ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the path from an old jailbroken phone to a new native app.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Device
&lt;/h2&gt;

&lt;p&gt;The phone was already configured as an SSH host named &lt;code&gt;iphone6&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh iphone6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first inspection confirmed the exact target:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Device: iPhone7,2 (iPhone 6)
Architecture: arm64
iOS: 12.5.8
Darwin: 18.7.0
Shell: /bin/sh
Jailbreak layout: rootful
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;rootful&lt;/code&gt; detail matters. On this generation of jailbreak, native&lt;br&gt;
applications are installed in the traditional location:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/Applications/YourApp.app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Newer rootless jailbreak environments generally package applications beneath&lt;br&gt;
&lt;code&gt;/var/jb&lt;/code&gt;, but that does not apply to this iOS 12 device.&lt;/p&gt;
&lt;h2&gt;
  
  
  What Was Already Installed
&lt;/h2&gt;

&lt;p&gt;The jailbroken phone already contained a surprisingly useful command-line&lt;br&gt;
environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt / dpkg / dpkg-deb
clang / LLVM
git
curl / wget / ssh
ldid
uicache / uiopen
Python 3.7.3
MobileSubstrate
NewTerm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those tools are enough to investigate the system and compile simple native&lt;br&gt;
code. A new application still needs more structure: SDK framework stubs,&lt;br&gt;
packaging support, and standard project templates. That is what Theos&lt;br&gt;
provides.&lt;/p&gt;
&lt;h2&gt;
  
  
  An Early Detour: Direct Display Access
&lt;/h2&gt;

&lt;p&gt;Before writing a UIKit app, I tried the most direct experiment possible: a C&lt;br&gt;
program that writes pixels into the phone's framebuffer.&lt;/p&gt;

&lt;p&gt;Unlike Linux devices with &lt;code&gt;/dev/fb0&lt;/code&gt;, iOS exposes display plumbing through&lt;br&gt;
private frameworks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/System/Library/PrivateFrameworks/IOMobileFramebuffer.framework
/System/Library/PrivateFrameworks/IOSurface.framework
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The C test loaded those frameworks, requested the main display, and attempted&lt;br&gt;
to obtain the writable &lt;code&gt;IOSurface&lt;/code&gt; behind the current screen:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;get_main_display&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;display&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;get_default_surface&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;display&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;surface&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The executable required &lt;code&gt;ldid&lt;/code&gt; signing and private framebuffer-related&lt;br&gt;
entitlements. Once those were supplied, the call reached the real display&lt;br&gt;
service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iomfb_paint_test: starting
loaded IOMobileFramebuffer and IOSurface; requesting main display
IOMobileFramebufferGetMainDisplay: 0x00000000 display=0x101000600
requesting the display default IOSurface
IOMobileFramebufferGetLayerDefaultSurface: 0xe00002c1 surface=0x0
No writable display IOSurface was exposed. This is expected on iOS 9 and later.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In other words, the native code ran and obtained the main display object, but&lt;br&gt;
iOS 12 would not expose the live pixel buffer for modification. That boundary&lt;br&gt;
is sensible for a phone operating system, and it pointed toward the better&lt;br&gt;
solution: build a regular UIKit application and let iOS render it normally.&lt;/p&gt;
&lt;h2&gt;
  
  
  Preparing an On-Device App Toolchain
&lt;/h2&gt;

&lt;p&gt;The conventional jailbreak development system is&lt;br&gt;
&lt;a href="https://theos.dev/" rel="noopener noreferrer"&gt;Theos&lt;/a&gt;. It handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;UIKit application project structure.&lt;/li&gt;
&lt;li&gt;Compilation against an iPhone SDK.&lt;/li&gt;
&lt;li&gt;Fake-signing application executables.&lt;/li&gt;
&lt;li&gt;Staging an app under &lt;code&gt;/Applications&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Building a &lt;code&gt;.deb&lt;/code&gt; package that Cydia or &lt;code&gt;dpkg&lt;/code&gt; can install.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Theos' official iOS setup documentation recommends using a normal user account&lt;br&gt;
rather than building everything as &lt;code&gt;root&lt;/code&gt;. On this phone, the development&lt;br&gt;
workspace lives under the &lt;code&gt;mobile&lt;/code&gt; account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/var/mobile/theos
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Installing Build Prerequisites
&lt;/h3&gt;

&lt;p&gt;The phone had &lt;code&gt;clang&lt;/code&gt;, &lt;code&gt;ldid&lt;/code&gt;, and &lt;code&gt;dpkg-deb&lt;/code&gt;, but not &lt;code&gt;make&lt;/code&gt; or &lt;code&gt;perl&lt;/code&gt;. Those&lt;br&gt;
were installed from the configured jailbreak package repositories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; make perl rsync com.bingner.plutil
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One historical-package wrinkle appeared here: installing Bingner's working&lt;br&gt;
&lt;code&gt;plutil&lt;/code&gt; implementation removed older conflicting packages that had installed&lt;br&gt;
an incompatible &lt;code&gt;plutil&lt;/code&gt; binary. That was acceptable for this build machine&lt;br&gt;
because the replacement is the tool needed by current packaging workflows.&lt;/p&gt;
&lt;h3&gt;
  
  
  Installing Theos
&lt;/h3&gt;

&lt;p&gt;Theos itself was cloned under the normal mobile account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;su - mobile &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s1"&gt;'cd /var/mobile &amp;amp;&amp;amp; git clone --recursive https://github.com/theos/theos.git /var/mobile/theos'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The official installer script normally automates this, but on this particular&lt;br&gt;
device its dependency-elevation step waited for interactive &lt;code&gt;sudo&lt;/code&gt; input. With&lt;br&gt;
the prerequisite packages already installed through root SSH, cloning Theos as&lt;br&gt;
&lt;code&gt;mobile&lt;/code&gt; achieved the intended ownership and directory layout cleanly.&lt;/p&gt;
&lt;h3&gt;
  
  
  Installing an SDK That Matches the Phone
&lt;/h3&gt;

&lt;p&gt;UIKit application builds require SDK headers and &lt;code&gt;.tbd&lt;/code&gt; linker stubs. The&lt;br&gt;
device had some legacy headers under &lt;code&gt;/var/include&lt;/code&gt;, but it did not initially&lt;br&gt;
have normal SDK stubs for linking a UIKit application.&lt;/p&gt;

&lt;p&gt;Theos can retrieve SDK archives. Rather than downloading its newest SDK, I&lt;br&gt;
installed the release matching this iOS 12 phone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;su - mobile &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s1"&gt;'export THEOS=/var/mobile/theos; bash /var/mobile/theos/bin/install-sdk iPhoneOS12.4'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After extraction, the necessary files existed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/var/mobile/theos/sdks/iPhoneOS12.4.sdk/System/Library/Frameworks/UIKit.framework/UIKit.tbd
/var/mobile/theos/sdks/iPhoneOS12.4.sdk/System/Library/Frameworks/Foundation.framework/Foundation.tbd
/var/mobile/theos/sdks/iPhoneOS12.4.sdk/usr/lib/libSystem.tbd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At that point, the phone had a real on-device UIKit build environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Hello World Application
&lt;/h2&gt;

&lt;p&gt;The first app was deliberately small: one view controller, two labels, and a&lt;br&gt;
button. It is enough to confirm compilation, signing, packaging, installation,&lt;br&gt;
launching, touch handling, and native layout all work on the device.&lt;/p&gt;

&lt;p&gt;The source tree looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HelloWorld/
  Makefile
  control
  main.m
  HWRAppDelegate.h
  HWRAppDelegate.m
  HWRViewController.h
  HWRViewController.m
  Resources/
    Info.plist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Targeting iOS 12 and arm64
&lt;/h3&gt;

&lt;p&gt;The Theos &lt;code&gt;Makefile&lt;/code&gt; targets the installed iPhoneOS 12.4 SDK, with an iOS 12&lt;br&gt;
deployment target and the &lt;code&gt;arm64&lt;/code&gt; architecture used by the iPhone 6:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="nv"&gt;TARGET&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; iphone:clang:12.4:12.0
&lt;span class="nv"&gt;ARCHS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; arm64
&lt;span class="nv"&gt;INSTALL_TARGET_PROCESSES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; HelloWorld

&lt;span class="k"&gt;include&lt;/span&gt;&lt;span class="sx"&gt; $(THEOS)/makefiles/common.mk&lt;/span&gt;

&lt;span class="nv"&gt;APPLICATION_NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; HelloWorld

&lt;span class="nv"&gt;HelloWorld_FILES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; main.m HWRAppDelegate.m HWRViewController.m
&lt;span class="nv"&gt;HelloWorld_FRAMEWORKS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; UIKit Foundation
&lt;span class="nv"&gt;HelloWorld_CFLAGS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;-fobjc-arc&lt;/span&gt;

&lt;span class="k"&gt;include&lt;/span&gt;&lt;span class="sx"&gt; $(THEOS_MAKE_PATH)/application.mk&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Starting UIKit
&lt;/h3&gt;

&lt;p&gt;The entry point is standard Objective-C UIKit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight objective_c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#import &amp;lt;UIKit/UIKit.h&amp;gt;
#import "HWRAppDelegate.h"
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;argc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;@autoreleasepool&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;UIApplicationMain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;argc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                 &lt;span class="n"&gt;NSStringFromClass&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;HWRAppDelegate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The application delegate creates a window and gives it a root view controller:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight objective_c"&gt;&lt;code&gt;&lt;span class="k"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BOOL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;application&lt;/span&gt;&lt;span class="p"&gt;:(&lt;/span&gt;&lt;span class="n"&gt;UIApplication&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;application&lt;/span&gt;
        &lt;span class="nf"&gt;didFinishLaunchingWithOptions&lt;/span&gt;&lt;span class="p"&gt;:(&lt;/span&gt;&lt;span class="n"&gt;NSDictionary&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;launchOptions&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;window&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;UIWindow&lt;/span&gt; &lt;span class="nf"&gt;alloc&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nf"&gt;initWithFrame&lt;/span&gt;&lt;span class="p"&gt;:[&lt;/span&gt;&lt;span class="n"&gt;UIScreen&lt;/span&gt; &lt;span class="nf"&gt;mainScreen&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;bounds&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rootViewController&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;HWRViewController&lt;/span&gt; &lt;span class="nf"&gt;alloc&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;window&lt;/span&gt; &lt;span class="nf"&gt;makeKeyAndVisible&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;YES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Drawing the First Screen
&lt;/h3&gt;

&lt;p&gt;The view controller creates a dark fullscreen view, a greeting, a subtitle,&lt;br&gt;
and a touchable system button:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight objective_c"&gt;&lt;code&gt;&lt;span class="n"&gt;UILabel&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;UILabel&lt;/span&gt; &lt;span class="nf"&gt;alloc&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nf"&gt;initWithFrame&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;CGRectZero&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;translatesAutoresizingMaskIntoConstraints&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;NO&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;@"Hello, iPhone 6!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textColor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;UIColor&lt;/span&gt; &lt;span class="nf"&gt;whiteColor&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;font&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;UIFont&lt;/span&gt; &lt;span class="nf"&gt;boldSystemFontOfSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textAlignment&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;NSTextAlignmentCenter&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;view&lt;/span&gt; &lt;span class="nf"&gt;addSubview&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="n"&gt;UIButton&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;UIButton&lt;/span&gt; &lt;span class="nf"&gt;buttonWithType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;UIButtonTypeSystem&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;translatesAutoresizingMaskIntoConstraints&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;NO&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt; &lt;span class="nf"&gt;setTitle&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s"&gt;@"Tap Me"&lt;/span&gt; &lt;span class="nf"&gt;forState&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;UIControlStateNormal&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt; &lt;span class="nf"&gt;addTarget&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;
           &lt;span class="nl"&gt;action:&lt;/span&gt;&lt;span class="k"&gt;@selector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;buttonTapped&lt;/span&gt;&lt;span class="p"&gt;:)&lt;/span&gt;
 &lt;span class="n"&gt;forControlEvents&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;UIControlEventTouchUpInside&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;view&lt;/span&gt; &lt;span class="nf"&gt;addSubview&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;button&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Button taps update the secondary label:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight objective_c"&gt;&lt;code&gt;&lt;span class="k"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;buttonTapped&lt;/span&gt;&lt;span class="p"&gt;:(&lt;/span&gt;&lt;span class="n"&gt;UIButton&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;sender&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tapCount&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;messageLabel&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;NSString&lt;/span&gt; &lt;span class="nf"&gt;stringWithFormat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s"&gt;@"Button tapped %ld time%@"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                              &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;long&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tapCount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                              &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tapCount&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="s"&gt;@""&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;@"s"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The app also hides the status bar to use the full iPhone display:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight objective_c"&gt;&lt;code&gt;&lt;span class="k"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BOOL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;prefersStatusBarHidden&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;YES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Packaging for Cydia
&lt;/h2&gt;

&lt;p&gt;Cydia-installed software is packaged as Debian archives. The app's &lt;code&gt;control&lt;/code&gt;&lt;br&gt;
file declares package metadata:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Package: com.reynafamily.helloworld
Name: Hello World
Version: 0.0.1
Architecture: iphoneos-arm
Description: A native UIKit Hello World test for the jailbroken iPhone 6.
Maintainer: Adolfo Reyna
Author: Adolfo Reyna
Section: Utilities
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On this rootful jailbreak, Theos stages the built bundle into:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Applications/HelloWorld.app/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;with the application executable and its &lt;code&gt;Info.plist&lt;/code&gt; inside.&lt;/p&gt;

&lt;h3&gt;
  
  
  An iOS 12 Theos Quirk
&lt;/h3&gt;

&lt;p&gt;The app compiled and linked correctly, but the normal Theos package step failed&lt;br&gt;
when it attempted to execute its &lt;code&gt;fakeroot.sh&lt;/code&gt; helper directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Killed: 9 /var/mobile/theos/bin/fakeroot.sh
make: *** [before-stage] Error 137
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The shell script itself was fine; this jailbreak was terminating its direct&lt;br&gt;
execution. Calling the same script explicitly through &lt;code&gt;bash&lt;/code&gt; fixed packaging.&lt;br&gt;
I also selected the already-installed &lt;code&gt;dpkg-deb&lt;/code&gt; backend:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;su - mobile &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'
  export THEOS=/var/mobile/theos
  export PATH=/usr/bin:/bin:/usr/sbin:/sbin
  cd /var/mobile/HelloWorld
  make package \
    FAKEROOT="bash /var/mobile/theos/bin/fakeroot.sh -p /var/mobile/HelloWorld/.theos/fakeroot" \
    _THEOS_PLATFORM_DPKG_DEB=dpkg-deb \
    THEOS_PLATFORM_DEB_COMPRESSION_TYPE=gzip
'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That generated the installable application package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/var/mobile/HelloWorld/packages/com.reynafamily.helloworld_0.0.1-+debug_iphoneos-arm.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The package was only about 12 KB, a nice reminder that a native UIKit hello&lt;br&gt;
world app does not need a large runtime or a browser framework.&lt;/p&gt;
&lt;h2&gt;
  
  
  Installing and Launching the App
&lt;/h2&gt;

&lt;p&gt;Installation used &lt;code&gt;dpkg&lt;/code&gt;, just as Cydia ultimately would:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dpkg &lt;span class="nt"&gt;-i&lt;/span&gt; /var/mobile/HelloWorld/packages/com.reynafamily.helloworld_0.0.1-+debug_iphoneos-arm.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The installed app bundle appeared at:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/Applications/HelloWorld.app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SpringBoard was told to register the new app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;uicache &lt;span class="nt"&gt;-p&lt;/span&gt; /Applications/HelloWorld.app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then the app was launched directly over SSH:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;uiopen com.reynafamily.helloworld
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final verification showed a normal running UIKit process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mobile  ...  /Applications/HelloWorld.app/HelloWorld

Package: com.reynafamily.helloworld
Status: install ok installed
Architecture: iphoneos-arm
Version: 0.0.1-+debug
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The app was now present on the iPhone's Home Screen and interactive like any&lt;br&gt;
other installed application.&lt;/p&gt;
&lt;h2&gt;
  
  
  What This Unlocks
&lt;/h2&gt;

&lt;p&gt;A functioning Hello World app establishes much more than a label on a screen.&lt;br&gt;
This iPhone can now be a native target for small personal applications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A bedside clock or information display.&lt;/li&gt;
&lt;li&gt;A household dashboard.&lt;/li&gt;
&lt;li&gt;A music remote.&lt;/li&gt;
&lt;li&gt;A status monitor for self-hosted services.&lt;/li&gt;
&lt;li&gt;A local photo-frame application.&lt;/li&gt;
&lt;li&gt;A touch controller for custom hardware or home automation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;UIKit on iOS 12 is old, but it is mature, lightweight, and completely adequate&lt;br&gt;
for focused applications. Keeping the design intentionally simple is an&lt;br&gt;
advantage on this hardware.&lt;/p&gt;
&lt;h2&gt;
  
  
  Files from the Project
&lt;/h2&gt;

&lt;p&gt;Display-access experiment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;iomfb_paint_test.c
iomfb_entitlements.plist
libSystem.B.tbd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Native Hello World application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HelloWorld/Makefile
HelloWorld/control
HelloWorld/main.m
HelloWorld/HWRAppDelegate.h
HelloWorld/HWRAppDelegate.m
HelloWorld/HWRViewController.h
HelloWorld/HWRViewController.m
HelloWorld/Resources/Info.plist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;An iPhone 6 running iOS 12.5.8 is no longer a reasonable target for arbitrary&lt;br&gt;
modern software, but a jailbroken one can still be a delightful native&lt;br&gt;
development device.&lt;/p&gt;

&lt;p&gt;The key lesson was to work with the platform instead of underneath it. Direct&lt;br&gt;
framebuffer access reached an iOS security barrier. A regular UIKit app,&lt;br&gt;
compiled with Theos, fake-signed, packaged as a &lt;code&gt;.deb&lt;/code&gt;, and installed through&lt;br&gt;
the jailbreak package system worked exactly as hoped.&lt;/p&gt;

&lt;p&gt;The phone now has a native application built specifically for it. More&lt;br&gt;
importantly, it has a repeatable path for whatever small app comes next.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Theos, installation on iOS:
&lt;a href="https://theos.dev/docs/installation-ios" rel="noopener noreferrer"&gt;https://theos.dev/docs/installation-ios&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Theos, New Instance Creator and application templates:
&lt;a href="https://theos.dev/docs/NIC.html" rel="noopener noreferrer"&gt;https://theos.dev/docs/NIC.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Theos, rootful and rootless packaging:
&lt;a href="https://theos.dev/docs/rootless" rel="noopener noreferrer"&gt;https://theos.dev/docs/rootless&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;The Apple Wiki, IOMobileFramebuffer:
&lt;a href="https://theapplewiki.com/wiki/Dev:IOMobileFramebuffer" rel="noopener noreferrer"&gt;https://theapplewiki.com/wiki/Dev:IOMobileFramebuffer&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>iphone</category>
      <category>ios</category>
      <category>retrocomputing</category>
    </item>
    <item>
      <title>Using DOI tags as References with Pandoc</title>
      <dc:creator>Adolfo Reyna</dc:creator>
      <pubDate>Mon, 01 Jul 2019 20:28:11 +0000</pubDate>
      <link>https://dev.to/aeroreyna/using-doi-tags-as-references-with-pandoc-id3</link>
      <guid>https://dev.to/aeroreyna/using-doi-tags-as-references-with-pandoc-id3</guid>
      <description>&lt;p&gt;Pandoc is a powerful text conversion tool that allows to write scientific documents completely in Markdown, and to be transform in properly formatted pdfs, web document, Latex or even Docx files.&lt;br&gt;
With the use of filters, pandoc is able to extend the Markdown capabilities to reference in text previously published works, and to make use of figure, equations, table, etc. numbering and inside references as well.&lt;/p&gt;

&lt;p&gt;I personally have found two filters very useful: Pandoc-citeproc and Pandoc-crossref.&lt;br&gt;
Citeproc is a filter that looks for references in the text with the form @referencetag and format them with the indicated style (like APA or IEEE) in text and in the reference block at the end of the document.&lt;br&gt;
In the other hand, the crossref filter give us a proper way of inserting equations, figures, tables and listings (code blocks), in such ways that they're automatically and properly numbered and referenced through custom tags.&lt;/p&gt;

&lt;p&gt;Pandoc-citeproc requires to be pointed to a biblatex&lt;sup id="fnref1"&gt;1&lt;/sup&gt; file which contains the information of the works cited, and optionally a csl file that determines the reference style used. These both can be indicated directly in the Markdown file using the YAML block in the beginning of the document as follows:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;paper.md

--------
title: Pandoc doi2bib filter
bibliography: library.bib
csl: csl/apa.csl
--------

The author of [@Fausto2019] has mentioned this issue before.

# Refereces:

~~~

and the .bib file should contain the information of the reference such as:

~~~biblatex
@article{@Fausto2019,
    doi = {10.1007/s10462-018-09676-2},
    url = {https://doi.org/10.1007%2Fs10462-018-09676-2},
    year = 2019,
    month = {jan},
    publisher = {Springer Nature},
    author = {Fernando Fausto and Adolfo Reyna-Orta and Erik Cuevas and {\'{A}}ngel G. Andrade and Marco Perez-Cisneros},
    title = {From ants to whales: metaheuristics for all tastes},
    journal = {Artificial Intelligence Review}
}
~~~

Then the command `pandoc -s paper.md --filter pandoc-citeproc -t html` return the converted text from markdown to html with the references included:

~~~html
&amp;lt;!--Partial Result:--&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;header id="title-block-header"&amp;gt;
&amp;lt;h1 class="title"&amp;gt;Pandoc doi2bib filter&amp;lt;/h1&amp;gt;
&amp;lt;p class="date"&amp;gt;2019-07-01 10:35:49&amp;lt;/p&amp;gt;
&amp;lt;/header&amp;gt;
&amp;lt;p&amp;gt;The author of &amp;lt;span class="citation" data-cites="Fausto2019"&amp;gt;(Fausto et al. 2019)&amp;lt;/span&amp;gt; has mentioned this issue before.&amp;lt;/p&amp;gt;
&amp;lt;h1 id="refereces" class="unnumbered"&amp;gt;Refereces:&amp;lt;/h1&amp;gt;
&amp;lt;div id="refs" class="references" role="doc-bibliography"&amp;gt;
&amp;lt;div id="ref-Fausto2019"&amp;gt;
&amp;lt;p&amp;gt;Fausto, Fernando, Adolfo Reyna-Orta, Erik Cuevas, ├üngel G. Andrade, and Marco Perez-Cisneros. 2019. ÔÇ£From Ants to Whales: Metaheuristics for All Tastes.ÔÇØ &amp;lt;em&amp;gt;Artificial Intelligence Review&amp;lt;/em&amp;gt;, January. Springer Nature. &amp;lt;a href="https://doi.org/10.1007/s10462-018-09676-2"&amp;gt;https://doi.org/10.1007/s10462-018-09676-2&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
~~~

In this way, it is fairly simple to write and manage the document and presented in the required format for collages to collaborate or to be submitted for publication (most likely in Latex).

However, with this framework the creation and maintaining of the references file (.bib) and the referring tags of the cited works is left to be done manually or by third parties, such as reference managers like Zotero or Mendeley.

Due to the fact that most recent publications make use of the digital object identifier (DOI)[^2], it is possible to use this index as the citation tag in our documents.
By doing so, it is warranted that all citations reference to a unique document, different to usual tags on which an author could potentially have several publications for each year.
This also open the window for further automatization, as there is reliable web services that offers the citation information of any given DOI, such as [https://dx.doi.org/]().

This concept give birth to a new pandoc filter called [doi2bib](https://github.com/aeroreyna/pandoc-doi2bib).
This filter make use of specified bibliography file (only .bib) in the YAML configuration, it search for all references with the format @DOI:XXX.XXX\XXXXXXX and updates the this file accordingly.
This means that any new reference is automatically added using the reliable information offered in the correct format by _doi.org_.

This tool offers the following benefits:

 - The specified file can be an empty file, previously existed .bib filed or not existent.

 - Only newly references required to be downloaded, therefore it does not add significantly time of compilation.

 - Several document can share this .bib file, or use a global one for all your documents.

 - If all your reference uses this format, a new file with only the current citations in order of citation can be generated simply by changing the specified bibliography file in the document.

To make use of this filter, just download the last build from the [Github](https://github.com/aeroreyna/pandoc-doi2bib) and paste it in the same Path of your pandoc executable.
Then this can be implemented using the command `pandoc -s paper.md --filter pandoc-doi2bib --filter pandoc-citeproc -o paper.pdf`

~~~markdonw
paper.md

--------
title: Pandoc doi2bib filter
bibliography: library.bib
csl: csl/apa.csl
--------

The author of [@DOI:10.1007/s10462-018-09676-2] has mentioned this issue before.

# Refereces:

~~~

which results in:

![](https://thepracticaldev.s3.amazonaws.com/i/otd6iy7ftb5dkr0sjdaj.png)

I´m using this framework for my thesis and prospect publications, so I hope it might helps others as well.


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;Others file types like bibtex, json, or yaml can be used as well. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>markdown</category>
      <category>pandoc</category>
      <category>citation</category>
      <category>doi</category>
    </item>
  </channel>
</rss>
