@@ -95,160 +95,3 @@ Todo list (approx. priority order)
95
95
- some API to load/unload from all existing processes
96
96
- Linux
97
97
98
- Why rewrite Substrate?
99
- ======================
100
-
101
- iOS jailbreak community drama incoming. I hope that this library eventually
102
- becomes useful to a wide variety of people that have no knowledge or interest
103
- in the following, because that is itself one of the answers to the above
104
- question. But if you are interested, read on.
105
-
106
- As a bit of background: Substrate used to be open source. (This is where the
107
- LGPL version of the compatibility header comes from; the current one in the
108
- Debian package has the GPL on it, not that it really matters.) In fact, it was
109
- open source for two(?) contiguous periods, but it has been closed for years
110
- now, and looks to remain that way.
111
-
112
- Do I really have to have a reason to create free software alternatives to
113
- proprietary software? I was recently watching Richard Stallman's talk at 31c3,
114
- and reflecting on the fact that while I'd been worrying about this, he'd
115
- consider it immoral * not* to work on such a project. - Yes, I do? Well,
116
- then...
117
-
118
- In the short view, because iMods asked me to. The reason they can't use
119
- Substrate (allegedly; I haven't myself discussed this specific issue with
120
- saurik, and don't really care, due to the other use cases for this library; I
121
- hope I am not fundamentally misrepresenting anyone's view here) is that saurik
122
- does not want to support them because he does not think competition is healthy
123
- for the ecosystem. This is described in detail in his article [ Competition vs.
124
- Community] ( http://www.saurik.com/id/20 ) , and it appears to be an essentially
125
- irreconcilable difference between the two.
126
-
127
- After reading that, you may ask, why am I trying to subvert saurik? After he
128
- correctly says -
129
-
130
- > I could sit around and first-party the entire stack: this would be much
131
- > easier than you'd even think; after all, Dustin already did the "hard work"
132
- > of figuring out what was even possible and what kind of solution solved the
133
- > problem.
134
-
135
- why am I proceeding to write a new library, which even goes to the extent of
136
- having an API compatibility later, once saurik did the hard work of figuring
137
- out what kind of solution did a good job solving the runtime code modification
138
- problem on iOS? When saurik worries that competitors to Cydia will sap the
139
- funding he relies on to support his essential, but less glamorous, software
140
- plumbing, and his many jailbreak community initiatives, why am I enabling
141
- exactly that?
142
-
143
- Well, I'd be lying if I said I was sure it was a good idea. But to be honest,
144
- with all respect to iMods, I don't think it's likely to supplant Cydia, not in
145
- the foreseeable future or, in its current form, ever. And the kind of group
146
- that could hypothetically supplant Cydia would likely not have difficulty
147
- replicating Substrate by themselves. So I consider my own involvement to be a
148
- low-stakes game in terms of practical consequences, which makes the upsides I
149
- perceive more compelling.
150
-
151
- What are those upsides?
152
-
153
- It's worth noting that between the aforementioned two open source periods for
154
- Substrate, a younger version of me repeatedly expressed a desire for it to be
155
- open source, and when the source was released again, was quite pleased.
156
- (Being slightly less enthusiastic in practice than principle - although much of
157
- that was just timing - I don't think I noticed when it went back to closed
158
- source.) So this really goes back a lot longer than iMods, and the upsides I
159
- perceive now are pretty much the same ones I did then.
160
-
161
- Starting on the practical end and ending on the idealistic one:
162
-
163
- First of all, it was during that period that I was working on tools to cleanly
164
- hook into the iOS * kernel* for reverse engineering purposes. As part of that,
165
- I wanted a function hooker. If Substrate had been open source, I could have
166
- easily copied out the (pretty small) bit I wanted into my kernel code; instead
167
- I had to write my own, inferior version. This is notable because, whether or
168
- not it was actually useful, the work I was doing was unambiguously pro-social
169
- and not harmful to the jailbreak community. saurik has on [ various
170
- occasions] ( http://forum.xda-developers.com/showthread.php?t=2466101&page=2 )
171
- mentioned the possibility (history?) of forks of his software hoarding fixes or
172
- whatever, and stated that there isn't much legitimate reason to modify
173
- Substrate, as opposed to building on it; certainly this is mostly true, but
174
- 'not much' is not the same as 'none'. If my software is useful to anyone else
175
- doing good work along the same lines, I will be very happy.
176
-
177
- I vaguely remember saurik suggesting that an alternative would be cooperating
178
- to come up with an official way for Substrate to be integrated into the kernel,
179
- or something. But I thought and think this really wasn't a good idea - since
180
- I'm the only one I know of who actually used those tools (except for an
181
- implementation of unionfs that formed part of JailbreakMe 3.0), it would be
182
- quite pointless for saurik to maintain, and I wanted to preserve agility for
183
- that little project.
184
-
185
- Second, while iOS-related environments other than userland are a pretty niche
186
- use case, there are innumerable environments unrelated to iOS in which
187
- Substrate-like hooking would be useful; it is for this reason that I intend to
188
- port Substitute to OS X and Linux, and anyone who just wants function hooking
189
- in some embedded environment can copy that bit easily enough. (To be fair,
190
- Substrate already is ported to both of the former platforms, but that doesn't
191
- really help if it's not freely available.) Sure, it would be nice if there
192
- were an official Cydia Store for OS X and Windows and toasters, but saurik
193
- doesn't seem to have time to work on that (maybe there were other reasons to
194
- stop working on OS X? don't remember), and I don't think it's reasonable to
195
- expect everyone who wants this fairly low-level functionality to work with
196
- saurik on what is otherwise their own project.
197
-
198
- This isn't just theoretical. Several years ago, I wrote more primitive version
199
- of a subset of the functionality found in this library as
200
- 'inject_and_interpose':
201
-
202
- https://github.com/comex/inject_and_interpose
203
-
204
- Since it's been around for years, it's had time to gather attention. Despite
205
- me doing absolutely no promotion of it, and the repo not even having a readme
206
- or license (which is not a good thing), three different people have posted
207
- issues implying they have tried to use it. More importantly, after I bought
208
- the Flavours app for OS X, I was surprised to receive an email from the
209
- developer offering me a refund, on the basis that I had already supported its
210
- development by writing inject_and_interpose! (In case you're reading this:
211
- Sorry I didn't respond; I tend to be very shy and so often don't reply to
212
- emails I should.) I think it's incredible that I was able to help a project
213
- totally unknown to me get developed; this is the kind of outcome only free
214
- software can achieve. I doubt it would have worked out as well if I had
215
- demanded coordination first.
216
-
217
- Third... this one is more subjective, but it's also probably the most
218
- important. The way I see it, jailbreaking is * fundamentally* about taking
219
- something closed and fixed and opening it up to hacking and modification:
220
- perhaps allowing a mess to be made, but quite possibly ending up with something
221
- unique and different. This ideal of openness is very similar to that of free
222
- software, and I therefore believe that it's in the spirit of jailbreaking to
223
- make as much low-level stuff open as possible, both for inspection and
224
- modification by curious users (who, after gaining knowledge that way, might end
225
- up becoming quite valuable to the community). Polished tweaks that are sold
226
- commercially are one thing (although they too benefit from general openness,
227
- especially the ones with a lot of reverse engineering behind them, since the
228
- same reverse engineering can often support multiple use cases), but the
229
- underlying framework is another - especially since it's free of charge,
230
- removing at least the most obvious motivation for closing source.
231
-
232
- (Like most people, I don't entirely agree with Stallman's rhetoric - otherwise
233
- I wouldn't have just praised a commercial application! - but all in all my
234
- views are aligned in a very similar direction, just with less magnitude.)
235
-
236
- Incidentally, this affects the jailbreaks themselves even more than Substrate.
237
- I have often advocated for open source jailbreaks, and all of my own jailbreak
238
- code has been open source. There would be practical benefits there, too; past
239
- experiences aside, a certain project I've had on the backburner for years will,
240
- if I ever get to it, certainly require customizing an existing jailbreak, which
241
- currently is likely to mean reimplementing it. Not that that would be
242
- particularly hard compared to the * rest* of the project, but it's just an
243
- unnecessary speed bump, and unnecessary things frustrate the hell out of me.
244
- Especially when the jailbreaks are distributed for free!
245
-
246
- Oh, and when I say "the spirit of jailbreaking", I don't mean to change history
247
- by implying "original plan" - iOS jailbreak has always suffered from
248
- balkanization of closed source tools. Indeed, I'm happy that the open source
249
- Cydia supplanted the closed Installer, and with it saurik's generally open,
250
- community-based management style.
251
-
252
- But when I say spirit, I do mean the best part of it.
253
-
254
- comex, 30 January 2015
0 commit comments