Skip to content

Commit

Permalink
include example image by default, and set it as app icon too
Browse files Browse the repository at this point in the history
This gives something to quickly click and try.
  • Loading branch information
eighthave committed Sep 5, 2014
1 parent 2eea13a commit 7ca0e3e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
Binary file modified res/drawable-hdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable-ldpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable-mdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/raw/alberti_cipher_disk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions src/info/guardianproject/iocipherexample/FileBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import info.guardianproject.iocipher.VirtualFileSystem;

import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
Expand Down Expand Up @@ -76,6 +77,25 @@ protected void onResume() {
if (!vfs.isMounted())
vfs.mount("my fake password");

File sample = new File("/alberti_cipher_disk.jpg");
if (!sample.exists()) {
try {
InputStream in = getResources().openRawResource(R.raw.alberti_cipher_disk);
OutputStream out = new FileOutputStream(sample);
byte[] buffer = new byte[8192];
int len;
while ((len = in.read(buffer)) != -1) {
out.write(buffer, 0, len);
}
in.close();
out.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}

// generate some files to have something to see
if (!new File("/dir0").exists())
for (int i = 0; i < 4; i++)
Expand Down

0 comments on commit 7ca0e3e

Please sign in to comment.