PrivateStorageMobile
Description
This is the Android application for the PrivateStorage service. Its first user-facing milestone is to provide a read-only view of data managed from the desktop client.
Overall plan
See this document on the next steps until we have milestones and tickets and better visibility on who's working on what, what's completed, and what's blocking.
Project status
This application is in the early stages of development. See the issue tracker and the overall plan document for detailed status information.
Build
Build an Android apk and install it to an Android device connected via USB (with necessary permissions granted):
nix-shell
cd obelisk
nix-build -A android.frontend -o result-android-frontend
./result-android-frontend/bin/deploy
Run Locally
You can run the Obelisk application locally, without a phone. To do so:
nix-shell
cd obelisk
ob run
This should eventually say something like Frontend running on http://localhost:8008
and you can then visit that address.
Theoretically, "a Web browser" is what's needed but Obelisk shortcomings currently demand Chrome (or Chromium).
It is advisable to make the browser window "phone-shaped" for a decent experience.
You can use "Developer Tools" to exactly size it to particular phones if you prefer.
Update Dependencies
nix-thunk
Some dependencies are managed using nix-thunk.
These can be found in obelisk/dep
.
Nix thunks are essentially references to git repositories. These can be unpacked to their source in-place when working on the project or packed up into a few small files.
To work with nix thunks first install the nix-thunk
tool.
Consider an example dependency "botan". From the top-level of this repo, to clone a copy of the Botan git repository at the appropriate commit, run:
nix-thunk unpack obelisk/dep/botan
You can work on it in-place and when you are done, pack it up again:
nix-thunk pack obelisk/dep/botan
This requires that changes have been committed and pushed.
Note:
A bug in the current version of Obelisk (link?) causes trouble if certain repos are unpacked.
If you have any trouble running an ob
command (ob run, ob repl, etc.) with a thunk unpacked,
try adding the flag --no-interpret obelisk/dep
and hopefully that will sort it out.
adding a new one
(Rough notes, as meejah tries to add new dependencies)
- copy-pasta an existing one
- change the
git.json
entries to be plausible - make sure to change the "nix" hash to something else or it'll just silently use the dep you copied from
- change some lines in
obelisk/haskell-overrides.nix
to reference the new library / thunk - add the thing to
obelisk/frontend/frontend.cabal
- running
nix-build -A android.frontend
inobelisk
will eventually tell you there's a hash mismatch - use
nix-hash --type sha256 --to-base16 <the thing it said>
to get the one to put in the JSON file - run
nix-build -A android.frontend
inobelisk
again