Commit Graph

407 Commits

Author SHA1 Message Date
mpl 965aeaca33 clients/android: bump targetSdkVersion to 26
Because it is mandatory as of nov 2018:
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html

As the default Notification.Builder constructor is deprecated in API 26,
this change also adds the use of the new constructor, which requires a
notification channel Id.

Note: since the users are now in full-control of the notifications,
they can now choose to completely block the auto-upload notification
channel. Given that the main goal of the notification was to keep the
app in memory in order for auto-upload to work, one could expect that
blocking the channel would defeat the notification's purpose. However,
as far as I could test, auto-uploading seems to still be working even
after disabling the channel, and letting the activity die (tip: in
devoloper options, one can tick "Don't keep activities"). In fact,
Perkeep Uploader still always runs as a service.

Also build pk-put shipped in the app with Go 1.11.

Fixes #1202

Change-Id: I8f98e0df742915cb504b6c1cfaa42ca6dc7b6189
2018-09-22 02:40:40 +02:00
Mathieu Lonjaret ad6dae391e Merge "clients/osx: use Keepy for all app icons" 2018-09-06 18:59:08 +00:00
Sergio Pantoja fd2a64ff2d clients/osx: use Keepy for all app icons
Updates #1147

Change-Id: Ie76a2b101b3bd155f0ab318c85e7026531f5ab56
2018-09-06 01:04:57 -04:00
Sergio Pantoja 1bc914b368 clients/osx: update link to new Google Group
Updates #981

Change-Id: I78f52c28b8ff2426867af510b083d5fa724decc3
2018-09-03 00:07:05 -04:00
mpl ba5aa9d3b9 server/perkeepd/ui: replace pudgy with keepy
-busy/munching pudgy is replaced with a "dancing" keepy
-sad pudgy replaced by a sad keepy
-everywhere else is normal keepy (which is one sprite of the dancing
keepy animation)
-we still need an "interested" keepy for when the user is about to drop
something on the d&d area
-glitch embedy directory has not been removed yet, to keep the pudgy
animations technique as a reference for future work.

We also need to update the animation in the GCE launcher.

Updates #1177

Change-Id: I95fe53cb51f93b8f498c8f026eddc07285c20db7
2018-06-29 21:48:11 +02:00
Brad Fitzpatrick a9db75c56d clients/osx: fix build
Updates #1147

Change-Id: Ic529ce5f4c0bbf60ae727c8dff41dfdcc84b7631
2018-05-02 21:52:02 -07:00
Brad Fitzpatrick 789f861964 all: rename some references to .config/camlistore to .config/perkeep
Updates #981

Change-Id: Id76fe17d80380bdb973bc85ec8f54ba9500aff40
2018-05-02 21:36:29 -07:00
mpl 084d618fc5 clients/android: Keepy icon
Also downgrade the target sdk as 21 still seems to be building and
working.

Change-Id: Ib7f74442e9db0f334063dc2cc6858b1b64ed4ccf
2018-04-26 14:21:52 -07:00
mpl 2c9fbcf2ef client/android: remove self-signed cert option
Change-Id: I902b45cf7ac6e05d9085494a902a4554ac3a17af
2018-04-26 13:28:15 -07:00
mpl 92c60d7c69 clients/android: Camlistore->Perkeep renames
Change-Id: I7012bfad11b5582bb0c2383a3b3a1eb84512819a
2018-04-25 11:26:13 -07:00
mpl 5f6517b728 clients/android: adjust version numbers for incoming release
Change-Id: Iac6ca39be04e334e7a6129cf5a8c2ed299c7be25
2018-04-25 10:51:57 -07:00
mpl e35db56405 clients/android: add steps to sign the apk
Change-Id: I776dd14efca4bd10263a7c7422e0ffd5c706a523
2018-04-24 16:10:05 -07:00
mpl 2bb666ccf6 all: rename remaining occurrences of camput
Also removed misc/buildbot while at it (which contained camput
references) since we don't use it anymore at all.

TODO: the OSX app seems to be relying on finding a binary in ../bin,
which we do not use anymore. This will probably need fixing.

Updates #981

Change-Id: I14220fbad2e81181330fca4bb2d2e5fe170e1bd6
2018-04-21 16:20:24 -07:00
Brad Fitzpatrick ca76a40bbc Rename camlistored to perkeepd.
Updates #981

Change-Id: I8fe43c240c149074c23128a89ab426af9cbf94b4
2018-04-21 11:06:09 -07:00
Tilman Dilo b41d4aecd1 clients/android: show camput error messages
So far, errors in the uploader configuration leading to upload failures
are not reported to the user in a meaningful way. The upload process
simply stops without further feedback, which is annoying especially when
either certificate hash or password are wrong.

This change adds a text widget below the upload stats, reporting
camput's stderr output as-is. While not ideal from a usability
standpoint (log entries are too wide and too verbose, and not clearly
marked as errors), it is better to receive those verbose messages than
none at all. The error text widget is cleared when a new upload is
started.

Change-Id: I75e79d802cf64981b92c80ce9fc12d2a26552169
2018-04-04 00:47:58 +02:00
mpl 93e7679cbe clients/android: make the upload service permanent
As far as I understood, for the auto-uploading to work reliably, the
file observers need to be permanently referenced, so they can watch for
new file creations constantly. It seems that it was not the case, as
they are referenced by the upload service, which itself was meant to be
stopped as soon as it's done uploading.

Moreover, as android memory management is getting more aggressive, it is
apparently getting more likely that the service would get killed anyway,
even if it did not stop itself.

This change is therefore two-fold:

1) The service does not try to stop itself anymore when it's done
uploading. Also, the activity starts it before binding to it (because
otherwise a service that has been automatically "bound-started" gets
destroyed as soon as all its binders disconnect from it).

2) The service is declared to run on the foreground, to make it the
least likely possible for the system to kill it. That means adding a
notification to which it is tied. The notification action leads to the
settings page, so that the auto-uploading can be toggled on/off.

At first I tried creating a new service class, that would be the
smallest possible (having only the file observers), to reduce the size
of what would have to be in the foreground. But it proved harder than I
thought and would require more time to rework the app as a whole, and
I'm not sure that's the best thing to do right now. Which is why I
resorted to make the whole UploadService a foreground one. I do not know
yet whether this is an acceptable trade-off.

In addition, this CL tries harder to find the directories with
interesting files to upload, by trying directories on the SD card too.

Fixes #1049

Change-Id: I311f31acc0a1db43791a7502a45a9f2da92cf39a
2018-03-08 19:35:45 +01:00
mpl 19827cb591 clients/android: update build setup, and app.
-android plugin 3.0.1
-gradle 4.1 (requirement for the above)
-gomobile to 069be623eb8e75049d64f1419849b3e92aab1c81
-go 1.9.3
-removed permission to write on storage from the manifest
-added permission to read from storage on the manifest
-added permission checking code for reading files on storage, which is
compulsory with modern android APIs.
-add missing code to update textByteStatus and textFileStatus TextViews

Notes:
-the app won't work with a server older than rev
6e8a5930c9 as the server/client protocol
to check for existing files on the server changed at this point.
-i think with Android O there's a much higher chance that the
CamliFileObserver gets garbage collected, which breaks the
auto-uploader. We probably need to switch to a different architecture,
like running as a Foreground Service, or using the Job Scheduler to
regularly fire up the file observer. In another CL.

Updates #1049

Change-Id: I079da8e5df5be820c3985749a9e109cf0775b495
2018-02-09 18:15:02 +01:00
Paul Lindner f99e3488ff clients/osx: fix and update OSX status-menu app
- Updates the naming from Camlistore to Perkeep
- Adjusts the mount point to ~/Desktop/perkeep
- Uses the new pk-mount binary
- Uses Perkeep.log instead of Camlistore.log
- Updates to minimum build of OSX 10.10
- Moves everything a directory level higher

Still uses the old branding, will need updated assets for this.

Tested: Built manually, all features appear to work now.

point to use ~/Desktop/perkeep

Change-Id: I0e267525f342afa43b8c1f59b46b5e2a75aa7844
2018-01-30 13:30:22 -08:00
Paul Lindner 6d2d9714de all: simpify constructs by running gofmt -s on all code
Change-Id: Idc12ddcfe8f735d77c6baa942f5bb7a2c7d9b40b
2018-01-21 10:27:12 -08:00
Attila Tajti 761bff63c0 server/camlistored: add sha224 support to web UI
The web UI support the old sha1 blob hash only.

Add initial support for sha224 blob refs.

Also add sha2.js and sha224.js to goog/crypt in the embedded resources.

Change-Id: If52d75d254d6163a737c56cf1676be1ef7eddb31
2018-01-17 16:07:04 +01:00
Paul Lindner 463832ed76 clients/web/embed: Move vendor/embed to clients/web/embed and adjust paths
Addresses #889
Fixes #1024

Change-Id: I9fa1dc246b0a3a1a4e4ec7abab0a7828fdfdb41e
2018-01-09 22:33:03 +00:00
Brad Fitzpatrick 617ac40512 all: rename cammount to pk-mount
Updates #981

Change-Id: Ie1d2e3c0fd7e2b7a7801ceac0fd8f93f62d56651
2018-01-08 09:54:41 -08:00
Brad Fitzpatrick 9265c980de all: change github.com/camlistore/camlistore to github.com/perkeep/perkeep
Change-Id: I0d612bf450e9e8d9ce0767c5a0cb0c44c0d8704f
2018-01-05 19:49:59 -08:00
Brad Fitzpatrick 57648c6b83 all: update copyright holder from Google Inc to The Perkeep Authors
The AUTHORS file is the list of copyright holders.
2018-01-03 16:52:49 -08:00
Brad Fitzpatrick d6a0b05df0 Rename import paths from camlistore.org to perkeep.org.
Part of the project renaming, issue #981.

After this, users will need to mv their $GOPATH/src/camlistore.org to
$GOPATH/src/perkeep.org. Sorry.

This doesn't yet rename the tools like camlistored, camput, camget,
camtool, etc.

Also, this only moves the lru package to internal. More will move to
internal later.

Also, this doesn't yet remove the "/pkg/" directory. That'll likely
happen later.

This updates some docs, but not all.

devcam test now passes again, even with Go 1.10 (which requires vet
checks are clean too). So a bunch of vet tests are fixed in this CL
too, and a bunch of other broken tests are now fixed (introduced from
the past week of merging the CL backlog).

Change-Id: If580db1691b5b99f8ed6195070789b1f44877dd4
2018-01-01 16:03:34 -08:00
Tilman Dilo e3ac2acb7a clients/android: update gomobile to fix docker build
Due to a change in the Android NDK (starting from r16), building the
docker container fails with an error during the installation of
gomobile:
    fatal error: 'stdlib.h' file not found

This issue was addressed in more recent versions of gomobile, which
are compatible with the new NDK.
See https://github.com/golang/go/issues/21802

This CL simply updates gomobile to the most recent commit.

Change-Id: I87c468c34de441bc6acd40b717d1d950014e5a99
2017-11-20 00:11:13 +01:00
Mathieu Lonjaret 4b81ecc384 Merge "clients/android: for building, make caching volume dirs on the host" 2017-11-17 16:27:01 +00:00
mpl 281d2a16b6 clients/android: for building, make caching volume dirs on the host
The ~/.gradle and ~/.android dirs are mounted as volumes for the docker
container when building the app, because we want the gradle and android
deps to be cached on the host after they've been downloaded.

The build process was assuming that these dirs always already existed,
and this assumption makes the building process fail if they actually
don't.

Therefore this change creates the directories on the host if they don't
already exist.

Change-Id: I90b5f73db0ffcbe76adc12157e142091808bde2b
2017-11-14 19:24:56 +01:00
mpl 0837889762 client/android: fix container detection for docker in systemd cgroup
It seems that on other (more modern?) configurations, the cgroup for
processes in docker is /system.slice/docker.service instead of /docker.

I have not been able to reproduce such a configuration. But until we have
a better way to detect whether a process is in docker, it's probably ok
to just add the new path to validate the detection, which this change
does.

Fixes #973

Change-Id: I9d52bcd79a906fdc1f8310b2c8063930cf9807fb
2017-11-14 17:44:36 +01:00
Paul Lindner fa46c3935d Correct various misspelled words
Change-Id: I236e880526e4c2b0bd318da041983d557e0aa885
2017-09-11 08:33:31 -07:00
Mathieu Lonjaret 36e65ff0e0 Merge "clients/android: add multiple profiles feature" 2017-06-29 20:20:05 +00:00
mpl 8a992c4652 clients/android: add multiple profiles feature
When one has/uses several Camlistore servers, it is tedious to change
all the configuration fields (host name, user, pass, certificate)
whenever one wants to upload to a different server from the one that is
currently configured.

Therefore, this change adds a new entry to the main menu that allows to
create new profiles, and to switch between profiles. Each profile has
its own configuration file, which enables to switch between servers
effortlessly once they're all configured.

https://storage.googleapis.com/camlistore-screenshots/Screenshot_20170606-151931.png
https://storage.googleapis.com/camlistore-screenshots/Screenshot_20170606-152007.png
https://storage.googleapis.com/camlistore-screenshots/Screenshot_20170606-152026.png
https://storage.googleapis.com/camlistore-screenshots/Screenshot_20170606-152041.png

Mininum SDK API increased to 11 because of SharedPreferences's
getStringSet.

Change-Id: I52e2de9e67e84188b1a4b16e046a0d47a35efc62
2017-06-29 17:01:44 +02:00
Tilman Dilo 374e24ac03 clients/android: update build tools and gradle versions
Android Studio requires newer versions of the Android SDK Build-Tools
and Gradle to build the uploader application.

In this commit, Gradle is updated to version 3.3 (as suggested by
Android Studio) and the Android SDK Build-Tools to the most recent
release.

Change-Id: Ief04ec56a6fffb0b46bd28820134c8e7a1ebbede
2017-06-26 22:54:40 +02:00
Tilman Dilo 1c14d2d219 clients/android: improve robustness of camput deployment
When reinstalling the app, using shell commands to set executable
permissions on the camput binary sometimes fails for unknown reasons.
The camput binary keeps 0660 permissions even though no error is
reported. The frequency of failed deployments seems to increase when
more recent build tools are used in the build process. On a Nexus 5X,
observed failure rates are in the order of one in twenty up to one in
six.

This commit removes all use of shell commands for deploying camput and
utilizes native java methods instead. While the resulting permissions of
camput change from 0700 to 0760, this is acceptable as the group is
app-specific and not shared.

A call to fsync is added to ensure that all file data (not just
metadata) is committed to disk before the file is renamed. This should
be safer in the event of a power loss as we're most likely writing to an
ext4 file system (the noauto_da_alloc mount option is used on modern
devices, see [1]).

With these changes, no failures to set executable permission bits could
be observed, regardless of build tool version used (v19.1 and v26.0,
n=30 each).

Fixes #932

[1] https://www.kernel.org/doc/Documentation/filesystems/ext4.txt

Change-Id: I290b4ce896aa449afef89ac87cdd0431752ceb93
2017-06-24 10:29:51 +02:00
Mathieu Lonjaret 79ea22dc0c Merge "clients/android: avoid wifi manager memory leak" 2017-06-21 00:01:22 +00:00
Tilman Dilo f7901d271c clients/android: avoid wifi manager memory leak
When building the uploader application with a newer version of the build
tools, the build fails in stage app:lintVitalRelease with a lint error of
type WifiMangerLeak. The wifi manager instance should always be obtained
from an application context in order to avoid a memory leak on Android
versions before N. See:
https://developer.android.com/reference/android/net/wifi/WifiManager.html

This commit implements the recommendation to obtain the wifi manager
instance through the application context.

Change-Id: I59ff0dfb381b82d9b4f201b646f11b34b3de3cff
2017-06-19 19:24:50 +02:00
Tilman Dilo d29f4c24a9 clients/android: fix permissions of camput binary
While the log message claims that the permissions of the camput binary
were set to 0700, they were actually set to 0777.

Change-Id: Ic5adbc05af161431823a3fb1685af5fa9a4b6647
2017-06-17 15:13:05 +02:00
mpl 68cd59797a clients/android: migrate to gradle
Android applications nowadays are supposed to be developped with Android
Studio, which uses gradle as the build system, with the android plugin.

This change modifies the app setup and file tree layout so it can be
built with gradle (in docker by default) instead of with ant.

The initial motivation for this change is to make changes to the app in
Go, using 'gomobile bind' to call the Go code from java. As the canonical
example at golang.org/x/mobile/example/bind/hello uses gradle, the
first step was to migrate the app to gradle.

Even if we don't end up using gomobile, this change is interesting as it
makes it easier for android apps developpers to contribute to the app if
it uses the recommended "modern" way.

Change-Id: I8386012db640324b62e18ffc128b68ba971fa953
2017-06-04 01:41:35 +02:00
Mathieu Lonjaret 726843fbc9 Merge "android: avoid excessive UI updates" 2016-10-18 13:17:40 +00:00
Tilman Dilo bf4ebe0fe3 android: avoid excessive UI updates
On some devices, updating notifications and status text at a high rate
causes whole-system UI lag and even complete system freezes. On a
Nexus 5, the uploader is completely unusable and requires a hard phone
restart almost every time "upload all" is triggered from the UI. The
device freezes happen across multiple stock Android releases.

This commit reduces the update rate of the UI significantly by updating
the notification only when the integer percent value of the upload
progress changes. It also reduces the update rate of the status text to
around 30 fps, which should still be plenty. With both of the changes,
the uploader behaves as expected. Either change alone is not enough to
get rid of the device freezes.

Change-Id: I2c170772d29c4670c8c10d09cdaea96207fc9e61
2016-10-15 23:15:29 +02:00
Tilman Dilo 95a0d4bc21 android: add Cardboard Camera directory
Automatically upload panoramas created with the Cardboard Camera app.

Change-Id: I1a32ac9a947c3b5f7fec479139ff8ee85368a8b7
2016-10-12 23:33:09 +02:00
Tilman Dilo 555cc5fca6 android: build client with Go 1.7
Change-Id: I7736a10a6a3e30408643e678b7f8fc942f028ff7
2016-09-05 21:53:29 +02:00
mpl 8143b55e77 android: fix/update docker build
Fixes #772

Change-Id: I3980b14714d44950a2710ca5908d3db90f0f09bd
2016-05-13 22:51:02 +02:00
Tilman Dilo d208b531c9 Fix permissions for files
Use mode 0644 instead of 0755 for non-vendored files.

Change-Id: Ifbe1d5e21f24814531248a8a6c84d6f0a72c071c
2016-04-28 21:15:09 +02:00
Will Norris 7ec2b0ac2e website: update doc URLs
s/docs/doc/ and s/http/https/ for camlistore.org doc URLs in website and
code.

Change-Id: I875e2acece1f594a304f2bdb63f756fcb315abc8
2016-04-27 08:48:50 -07:00
Brad Fitzpatrick ddbe440e45 Update more (all remaining) issue links to Github.
Change-Id: Ia796410afb292615e63f7f42b5ecda3d18d7c325
2014-12-13 17:40:54 +11:00
Fabian Wickborn f369c56a4b Android: Added null-check, fixed duped permissions
- Added a null check I missed in my last commit.
- Fixed duplicated Permission ACCESS_NETWORK_STATE in manifest.

Change-Id: I0da93b3e83ac584cb8fe36b2c3b9f1c711b08a8a
2014-08-24 11:59:37 +02:00
Fabian Wickborn 23975a92cd Option to restrict WiFI SSID for Android client
This is a first shot at
https://code.google.com/p/camlistore/issues/detail?id=496.

A user can enter a SSID and the upload will only run over Wifis with
this SSID. If the SSID option is left empty, everything works as before.

Change-Id: Ief3642c5b9c14d059f42696531fa33d1d780ab1c
2014-08-23 19:49:50 +02:00
Brad Fitzpatrick c9bf045aac Merge "Support more Android camera paths" 2014-08-22 16:49:17 +00:00
Fabian Wickborn 0fc94f3c72 Support more Android camera paths
I scratched my own itch and addressed
https://code.google.com/p/camlistore/issues/detail?id=494
for my HTC One M8 which stores pictures taken with its camera
to /sdcard/DCIM/100MEDIA.

Hardcoding these paths is far from being a good solution. I hope I can
find the time to get deeper into Android coding and come up with some
for https://code.google.com/p/camlistore/issues/detail?id=37 over the
next weeks.

Change-Id: I4e351c1915c5c7f66948d434d72763c826a25a16
2014-08-22 14:44:09 +00:00