summaryrefslogtreecommitdiffstats
path: root/slides.tex
blob: d4eb820d1c77bff3b5f4efdc5dc2129b84f7e461 (plain)
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
\documentclass[aspectratio=169]{beamer}

\mode<presentation> {
\usetheme{Hannover}
  \setbeamertemplate{authors}{}
  % Remove navigation symbols.
  \setbeamertemplate{navigation symbols}{}
}
% Dark theme. Comment if there's lots of ambient light.
%\usecolortheme{owl}

\usepackage{color}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{graphicx}
\usepackage[font=tiny,skip=0pt]{caption}
\usepackage{verbatim}

\graphicspath{{img/}}

% Use symbols instead of numerals for footnotes.
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
% Reset footnote counter every section.
\makeatletter
\@addtoreset{footnote}{subsection}
\makeatother

\newcommand{\iconframe}[2] {
  \begin{minipage}[t]{2.5em}
    \includegraphics[width=\textwidth]{app-icons/#1}
    \captionof*{figure}{#2}
  \end{minipage}
}

\title[The Chromium mess meets Android]{The Chromium mess meets Android}
\subtitle{Proposals on how to get a fully free WebView build or replace it with something completely new}
\author{David Ludovino \and Jeremy Rand \thanks{\footnotesize with support from Andrés D and Kurtis Hanna}}
\institute[Replicant]{Replicant}
\date{}
\logo{\includegraphics[scale=0.25]{logo}}
\titlegraphic{\includegraphics[width=4em]{logo}}

\begin{document}

\begin{frame}
  \maketitle
\end{frame}


\section{What is WebView?}
\begin{frame}[fragile]
  \frametitle{What is WebView?}
  \begin{columns}
    \begin{column}{0.6\textwidth}
      Renders web content (HTML, CSS, JavaScript) inside apps.\\\bigskip
      API has been around since Android 1.\\\bigskip
      \lstset{
        language=Java,
        basicstyle=\scriptsize\ttfamily,
        keywordstyle=\color{blue},
        stringstyle=\color{orange},
      }
      \begin{lstlisting}
public class MainActivity extends Activity {
  @Override
  protected void onCreate(Bundle state) {
    super.onCreate(state);
    WebView v = new WebView(this);
    setContentView(v);
    v.loadUrl("https://replicant.us");
  }
}
      \end{lstlisting}
    \end{column}
    \begin{column}{0.3\textwidth}
      \includegraphics[width=\textwidth]{webview-sample}
    \end{column}
  \end{columns}
\end{frame}

\subsection{Which apps use it?}
\begin{frame}
  \frametitle{Which apps use WebView?}
  Apps that render HTML: email clients, RSS readers, etc.\\\bigskip
  Became pervasive with the advent of cross-platform mobile frameworks.\\\medskip
  \begin{block}{Half of the apps listed at PRISM Break depend on WebView}
    \vspace{1ex}
    \centering
    \begin{tabular}{c | c}
      uses WebView & does not use WebView \\
      \hline
      \iconframe{k9mail}{K-9 Mail}
      \iconframe{osmand}{OsmAnd}
      \iconframe{nextcloud}{Nextcloud}
      \iconframe{ttrss}{Tiny Tiny RSS}
      \iconframe{i2p}{I2P}
      &
      \iconframe{orbot}{Orbot}
      \iconframe{fdroid}{F-Droid}
      \iconframe{andotp}{andOTP}
      \iconframe{shaarlier}{Shaarlier}
      \iconframe{briar}{Briar}
      \\
      \iconframe{wallabag}{wallabag}
      \iconframe{openkeychain}{OpenKeychain}
      \iconframe{etesync}{EteSync}
      \iconframe{syncthing}{Syncthing}
      \iconframe{signal}{Signal}
      &
      \iconframe{conversations}{Conversations}
      \iconframe{silence}{Silence}
      \iconframe{tincapp}{Tinc App}
      \iconframe{keepassdx}{KeePass DX}
      \iconframe{jami}{Jami}
      \\
      \iconframe{dandelion}{dandelion*}
      \iconframe{nomad}{Nomad}
      \iconframe{tusky}{Tusky}
      \iconframe{movim}{Movim}
      &
      \iconframe{bitmask}{Bitmask}
      \iconframe{wireguard}{Wireguard}
      \iconframe{fennec}{Fennec F-Droid}
      \iconframe{torbrowser}{Tor Browser}
      \iconframe{thorium}{Thorium}
      \\
    \end{tabular}
  \end{block}
\end{frame}

\subsection{What's underneath it?}
\begin{frame}
  \frametitle{What is underneath WebView?}
  \includegraphics[width=3em]{webkit} WebKit until Android 4.3 Jelly Bean (API 18).\\
  \vspace{3\baselineskip}
  \includegraphics[width=3em]{chromium} Chromium from Android 4.4 KitKat (API 19) onwards.
\end{frame}

\section{What's the matter with Chromium?}
\begin{frame}
  \frametitle{What's the matter with Chromium?}
  Privacy issues:
  \begin{itemize}
    \item Background requests to Google during build and run.
    \item Depends on Google services for several features (e.g. Safe Browsing).
    \item Limited privacy controls.
    \item API prevents extensions from blocking ads.
  \end{itemize}
  \medskip
  \pause
  Security issues:
  \begin{itemize}
    \item Prevents users from escaping the certificate authority system for TLS.
  \end{itemize}
  \medskip
  \pause
  Freedom issues:
  \begin{itemize}
    \item Pre-built binaries throughout the code base.
    \item Missing license in some source files.
  \end{itemize}
  \medskip
  \pause
  Verdict: unfit for fully free-software distributions.
\end{frame}

\section{WebView and Replicant}
\begin{frame}
  \frametitle{WebView and Replicant}
  \begin{columns}
    \begin{column}{0.1\textwidth}
      \includegraphics[width=\textwidth]{replicant}
    \end{column}
    \begin{column}{0.9\textwidth}
      Replicant:
      \begin{itemize}
        \item Android distribution
        \item compliant with GNU Free System Distribution Guidelines (FSDG)
      \end{itemize}
    \end{column}
  \end{columns}
  \vspace{2\baselineskip}
  Using outdated WebView based on Chromium 43: lots of security concerns.\\
  \vspace{2\baselineskip}
  How to create a WebView build that respects user's privacy and freedom?
\end{frame}

\section{Chromium forks}

\subsection{Desktop Chromium}
\begin{frame}
  \frametitle{Desktop Chromium forks}
  \begin{itemize}
    \item \includegraphics[height=2em]{chromium} ungoogled-chromium: aligned with privacy and freedom
    \item \includegraphics[height=2em]{bromite} Bromite: can build WebView;
      only focused on privacy and ad blocking
    \item \includegraphics[height=2em]{debian} Debian: replaces pre-builts with system libs;
      Google services not removed
    \item \includegraphics[height=2em]{iridium} Iridium: one step on every direction;
      not as thorough as others
  \end{itemize}
  \vspace{2\baselineskip}
  \begin{columns}
    \begin{column}{0.1\textwidth}
      \includegraphics[width=\textwidth]{guix}
    \end{column}
    \begin{column}{0.9\textwidth}
      Guix, a FSDG compliant distro, uses:\\
      ungoogled-chromium + build recipe that removes some files.
    \end{column}
  \end{columns}
\end{frame}

\lstset{
  basicstyle=\fontsize{5}{5}\ttfamily,
  keywordstyle=\color{brown}\bfseries\underbar,
  otherkeywords={google,Google}
}

\subsection{Android Chromium}
\begin{frame}
  \frametitle{Android Chromium forks}
  Android builds require many more pre-builts and proprietary dependencies.\\
  E.g.: Google Mobile Services (GMS)\\\bigskip
  \begin{itemize}
    \item \includegraphics[height=2em]{chromium} ungoogled-chromium-android:
      ungoogled-chromium + Android specific patches; has some remaining pre-builts
    \item \includegraphics[height=2em]{unobtainium} Unobtainium: aimed to be
      built within F-Droid (forbids pre-builts); project is unmaintained
  \end{itemize}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Android Chromium forks}
  \verb;strings classes.dex | grep google;
  \begin{block}{Chromium 78 WebView - 227 lines}
    \lstinputlisting{txt/chromium78-webview-google-strings}
  \end{block}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Android Chromium forks}
  \verb;strings classes.dex | grep google;
  \begin{block}{Bromite 78 WebView - 124 lines}
    \lstinputlisting{txt/bromite78-webview-google-strings}
  \end{block}
\end{frame}

\begin{frame}[fragile]
  \frametitle{Android Chromium forks}
  \verb;strings classes.dex | grep google;\\\bigskip
  \begin{block}{ungoogled-chromium-android 77 WebView - 10 lines}
    \lstinputlisting{txt/ungoogled77-webview-google-strings}
  \end{block}
  \begin{block}{Replicant 6 WebView - 7 lines}
    \lstinputlisting{txt/replicant6-webview-google-strings}
  \end{block}
\end{frame}

\subsection{Stepwise cleansing}
\begin{frame}
  \frametitle{Approach \#1: Stepwise cleansing}
  Still no 100\% free-software WebView apk void of privacy concerns.\\\bigskip
  Tentative approach:
  \begin{enumerate}
    \item Start with Guix's source code for ungoogled-chromium.
    \item Run Ubuntu's license check script on it.
    \item Check if original Chromium bug about licensing still applies
      (was mostly related to third-party code).
    \item Try to build WebView (will probably fail).
    \item Cherry pick patches from ungoogled-chromium-android and Unobtainium.
    \item Build everything in fdroid-server (picks leftover pre-builts).
    \item Send recipe for peer-review at GNU-linux-libre.
  \end{enumerate}
\end{frame}

\section{GeckoView shim}
\begin{frame}
  \frametitle{Approach \#2: WebView API compatibility shim for GeckoView}
  Chromium fork requires constant maintenance burden.\\\smallskip
  Google's interests do not align with ours. Check Mozilla.\\
  \vspace{2\baselineskip}
  \begin{columns}
    \begin{column}{0.1\textwidth}
      \includegraphics[width=\textwidth]{geckoview}
    \end{column}
    \begin{column}{0.9\textwidth}
      GeckoView:
      \begin{itemize}
        \item Java wrapper for Gecko browser engine.
        \item Used in Android apps as replacement for WebView.
        \item API is incompatible with WebView: not meant to be a drop-in.
      \end{itemize}
    \end{column}
  \end{columns}
\end{frame}

\subsection{Mapping WebView to GeckoView}
\begin{frame}[fragile]
  \frametitle{Mapping WebView to GeckoView}
  \begin{itemize}[<+->]
    \setlength\itemsep{1em}
    \item Some functions have a 1:1 mapping.\\\smallskip
      {\small
        \begin{tabular}{l | l}
          WebView & GeckoView \\
          \hline
          \verb|goBack()|, \verb|goForward()| & \verb|GeckoSession.NavigationDelegate|\\
          \verb|loadUrl()| &  \verb|GeckoSession.loadUri()|\\
          \verb|stopLoading()| & \verb|GeckoSession.stop()|
        \end{tabular}
      }
    \item  Others require emulation.\\\smallskip
      {\small
        \begin{tabular}{l | l}
          WebView & GeckoView \\
          \hline
          \verb|getTitle()| & \verb|GeckoSession.HistoryDelegate.HistoryItem.getTitle()|\\
          \verb|pageDown()| & \verb|PanZoomController.scrollBy(width,height)|
        \end{tabular}
      }
    \item  Others require more features from Gecko to be exposed via GeckoView,
      e.g. \verb|zoomIn()|.
    \item  Others still, added on latest Android APIs (26-29), seem too tied to Chromium,
      e.g. \verb|getWebViewLooper()|, \verb|getWebChromeClient()|, \verb|getWebViewClient()|.
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{Mapping WebView to GeckoView}
  Requires a considerable effort.\\\bigskip
  Can pay off in the long-term: no need to constantly scout
  for proprietary dependencies and privacy issues.\\\bigskip
  Burden may be lessened by collaborations, e.g., qt5-webengine replacement with Gecko underneath.
\end{frame}

\section{GeckoView on apps}
\begin{frame}
  \frametitle{Approach \#3: GeckoView on apps}
  Fork apps to use GeckoView instead of WebView.\\\bigskip
  Impossible for the small Replicant team to maintain.\\\bigskip
  Would only work if app maintainers perceive GeckoView as a better alternative.\\\bigskip
  GeckoView adds a $\sim$20 MiB bloat to any app.
\end{frame}

\section{Feedback?}
\begin{frame}
  \frametitle{Feedback?}
  \begin{itemize}
    \setlength\itemsep{1em}
    \item Questions
    \item Comments
    \item Ideas
    \item Collaboration
  \end{itemize}
  \vspace{2em}
  All welcomed!
\end{frame}

\begin{frame}
  \frametitle{Licenses (I)}
  {\scriptsize
    \begin{tabular}{l | l | l}
      item & source & license \\
      \hline
      K-9 Mail logo & \url{https://github.com/k9mail/k-9} & Apache-2.0 \\
      OsmAnd logo & \url{https://github.com/osmandapp/Osmand} & CC-BY-NC-ND 4.0 \\
      Nextcloud logo & \url{https://github.com/nextcloud/android} & AGPLv3 \\
      Tiny Tiny RSS logo & \url{https://gitlab.com/derSchabi/tttrsss} & GPLv3 \\
      I2P logo & \url{https://github.com/i2p/i2p.android.base} & Apache-2.0 \\
      Orbot logo & \url{https://gitweb.torproject.org/orbot.git} & BSD \\
      F-Droid logo & \url{https://gitlab.com/fdroid/fdroidclient} & GPLv3 \\
      andOTP logo & \url{https://github.com/andOTP/andOTP} & MIT \\
      Shaarlier logo & \url{https://github.com/dimtion/Shaarlier} & GPLv3 \\
      wallabag logo & \url{https://github.com/wallabag/android-app} & GPLv3 \\
      OpenKeychain logo & \url{https://github.com/open-keychain/open-keychain} & GPLv3 \\
      EteSync logo & \url{https://github.com/etesync/android} & GPLv3 \\
      Syncthing logo & \url{https://github.com/syncthing/syncthing-android} & MPLv2 \\
      Briar logo & \url{https://code.briarproject.org/briar/briar} & GPLv3 \\
      Conversations logo & \url{https://github.com/siacs/Conversations} & GPLv3 \\
      Signal logo & \url{https://github.com/signalapp/Signal-Android} & GPLv3 \\
      Silence logo & \url{https://git.silence.dev/Silence/Silence-Android} & GPLv3 \\
      Tinc App logo & \url{https://github.com/pacien/tincapp} & GPLv3 \\
      KeePass DX logo & \url{https://github.com/Kunzisoft/KeePassDX} & GPLv3 \\
      dandelion* logo & \url{https://github.com/gsantner/dandelion} & GPLv3 \\
      Nomad logo & \url{https://framagit.org/disroot/AndHub} & GPLv3 \\
    \end{tabular}
  }
\end{frame}

\begin{frame}
  \frametitle{Licenses (II)}
  {\scriptsize
    \begin{tabular}{l | l | l}
      item & source & license \\
      \hline
      Tusky logo & \url{https://github.com/tuskyapp/Tusky} & GPLv3 \\
      Movim logo & \url{https://github.com/movim/movim_android} & AGPLv3 \\
      Jami logo & \url{https://git.jami.net/savoirfairelinux/ring-client-android} & GPLv3 \\
      Bitmask logo & \url{https://0xacab.org/leap/bitmask_android} & GPLv3 \\
      WireGuard logo & \url{https://git.zx2c4.com/wireguard-android} & Apache-2.0 \\
      Fennec logo & \url{https://hg.mozilla.org/releases/mozilla-esr68} & MPL-2.0 \\
      Tor Browser logo & \url{https://gitweb.torproject.org/tor-browser.git} & MPL-2.0 \\
      Thorium logo & \url{https://github.com/sschueller/peertube-android} & AGPLv3 \\
      WebKit logo & \url{https://en.wikipedia.org/wiki/File:WebKit_logo_(2015).svg} & non-free \\
      Chromium logo & \url{https://commons.wikimedia.org/wiki/File:Chromium_11_Logo.svg} & CC-BY 2.5 \\
      Replicant logo & \url{https://redmine.replicant.us/projects/replicant/wiki/Artwork} & CC-BY-SA 3.0 \\
      Guix logo & \url{https://git.savannah.gnu.org/cgit/guix/guix-artwork.git/} & CC-BY-SA 4.0 \\
      Bromite logo & \url{https://github.com/bromite/bromite.github.io} & GPLv3 \\
      Iridium logo & \url{https://github.com/iridium-browser/artwork} & non-free \\
      Debian logo & \url{https://www.debian.org/logos/} & CC-BY-SA 3.0 \\
      Unobtainium logo & \url{https://gitlab.com/thermatk/Unobtainium} & BSD \\
      GeckoView logo & \url{https://github.com/mozilla/geckoview} & non-free \\
      everything else & this slideshow & CC BY-SA 4.0
    \end{tabular}
  }
\end{frame}

\end{document}