title: Expose a binary to other Android apps
body: <p>I wanted to have <code>git</code> available as a CLI tool on my android device, usable via a local terminal app. I've successfully cross-compiled <code>git</code> for <code>aarch64-linux-android</code> and if I use a root shell to move it to one of the <code>ext4</code> filesystems on the device I can invoke it successfully.</p>
  <p>However, installing and using it with root is not desirable. I normally leave my device unrooted and only temporarily enable root to do experiments like this. Installation as root is not so bad, but it seems that the only <code>ext4</code> filesystems mounted read/write are in locations that the terminal app cannot read from, so I cannot use it as a non-root user, which is a deal breaker *.</p>
  <p>I'd prefer to package it as an APK if possible, so it can be sideloaded as a normal user. I'd also like to be able to invoke it from the terminal app. If I have to manually adjust <code>$PATH</code>, that's fine, but bonus points if the APK can place it somewhere on <code>$PATH</code> or have the OS extend <code>$PATH</code> on installation.</p>
  <p>* <em>(I know I can remount /system as r/w to install it as root, and that would make it usable to all applications. I don't want to modify /system because then &quot;factory resets&quot; are not ensured to bring me back to a working state. I know it'd be a relatively safe change. If this really is impossible, I'll do that, but an APK would be so much nicer)</em></p>