forked from premium-minds/simplebusybox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNOTES
104 lines (74 loc) · 4.03 KB
/
NOTES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
June 19, 2016.
The goal here is to make a simple and free build of BusyBox for Android
that does not require root. It will package the binaries within the
app-lib directory, so that all you have to do is add it to $PATH.
It seems popular to add dropbear ssh client to packages such as this one,
but to me that seems like a slippery slope...why add that and not rsync,
for example? I intend to limit to just busybox.
...
So, here's roughly how the files in jni/ were manually built. I started
with configs/android_ndk_defconfig, and customized that a bit, and had
that in .config in a regular PC host build. Then I run "make", and it
generates the auto-generated .h files, and then I run:
cp include/applet_tables.h include/applets.h include/autoconf.h \
include/usage.h include/usage_compressed.h include/NUM_APPLETS.h \
~/src/simplebusybox/jni/; cp .config ~/src/simplebusybox/jni/config
So that's where those files came from...
...
Switched to using android-ndk-r10d instead of android-ndk-r8 because even
at android-8 (froyo) it has a few more functions...
June 20, 2016.
Had to update to android-9 (gingerbread 2.3) because a bunch of things
needed sysinfo(). Last time I built busybox, I just disabled those
things (like free(1)). But it would be nice to have them. And
gingerbread happens to be a good benchmark for very old, anyways. Any
newer and we might as well jump straight to 4.x, because honeywhatever
never saw much deployment.
July 3, 2016.
I managed to build busybox, and now it is time to package it up. I
thought I would be able to hack ant to include the "busybox" binary and
symlinks into the apk file, so that it would show up in something like
/data/app/org.galexander.busybox/lib/arm/ and I could just add that to my
PATH. This would avoid the hack I used in simplesshd where I renamed the
sshd to libsshd.so so that apkbuilder would find it. That would not
suffice because we can't very well have the user typing "libless.so"
instead of "less".
But it is not ant - ant just runs apkbuilder. apkbuilder is some mess of
java. apkbuilder sucks. I'm not about to hack the java of apkbuilder.
And I'm not super inclined to dodge it and use infozip directly to create
my apk.
How did Burrows Busybox do it? Well, first off, the PATH is:
/data/data/burrows.apps.busybox/app_busybox
And second off, unpacking the APK doesn't seem to reveal the busybox. So
presumably it fetches it from somewhere and then extracts it into its
data directory, and I guess that it is legit to chmod your own data
directory to be world-readable?
So I propose packaging it as a raw resource, and then having the Activity
unpack it.
...
And that works! I can even use busybox --install -s to make the symlinks!
Nice!
Now I just need to make some UI up and then I'm set!
...
And there it is! Completely done. Just need Sarah to re-touch the
graphic assets and then I'll build it for release.
July 9, 2016.
So...I released 1.0, and then immediately found out hostname lookup
doesn't work, which is a bummer because busybox includes pidgin nc and
wget. Tracking it down, it looks like a bare call to getaddrinfo()
doesn't work, returns 7, EAI_NODATA, "No address associated with
hostname", which seems to say lookup worked but the address was bad,
which is wrong.
However, the native /system/bin/ping is able to do the resolution
alright. I was looking at ping, trying to see if it called the same
libc, and it does not! I was using -static to build busybox, and without
it, DNS resolution seems to work!
Bah, that was against platform android-19. If I link against android-10,
then without -static I get
error: only position independent executables (PIE) are supported.
Which is, I recall, why I added the -static in the first place.
They really fucked us here, apparently. Support for PIE was added at 4.1
(android-16), and then mandated by 5.0 (android-21). So really, I need
to bump up to android-16. Bah humbug. But I guess I don't care, because
I don't need busybox for anything old I have sitting around. And
anyways, even my Nexus 7 shipped with 4.1.