https://github.com/flutter/flutter/issues/23811
This bug has been fixed but 1.1.3 has still not been promoted to the
beta branch. I'm not sure when that will happen, and I'm not comfortable
using the 'dev' branch of Flutter. The month of Feb is almost here, so
maybe then there will be a new release.
Jgit relies on java.nio.file which was only added in API Level 26.
https://developer.android.com/reference/java/nio/file/package-summary
This sucks because we're greately limiting the number of Android Devices
we can target. I don't get what is so special about nio, that it cannot
be treated like any other API.
I've registered GitJournal as an app on Github and tried to get the
access_token within the app. This seems to work. Though, I need to
provide the client secret as well. It's quite sad that GitHub does not
even support the Implicit Grant auth type.
Credit: https://stackoverflow.com/questions/46196240/oauth2-flow-in-flutter-app
The Timezone handling is java seems to be quite strange, so I'm going to
skip it for now and fix it later. We do seem to have proper timezone
classes in future versions of Java, but that requires me to increase the
minSDKVersion, and therefore not support very old android devices.
For now just create a local git repo and commit all the changes over
there, we're going to allow the user to first see the app and use it
however they want, and later connect it to a remote git repo.
This commit breaks the app, as the on-boarding screen is no longer
connected so you cannot push to a remote app.
In the alpha version for now. The --build-number flag fails right now,
this seems to be a regression in flutter which has been fixed, but the
new version has yet to be released.
So, when I put this into a proper CI, it's going to fail :(
We get the path ourselves as the 'git plugin' is using the
android 'getFilesDir()', instead of 'getDataDir()' which is what the
path_provider returns.
It's strange that it returns the latter as the Android docs clearly
state that one should not use this path and should use getFilesDir
instead.
Many of these do not actually need an AsyncTask, but for now I'm just
following this pattern since I don't know if blocking on the receiever
thread will result in the app's UI being blocked.
We want to use this specific version number as it is the only one that
supports `git clone` on Android. The others use a hard-link while
creating a lock file while trying to perform a 'git clone'.
The Android Internal Storage does not support hard links, and therefore
aborts. This will need to be fixed in the latest version of jgit.
Generate an SSH key if it doesn't exist and then use that one. This was
just supposed to be a PoC. Sadly, it doesn't really work. I keep
getting Auth Failures when cloning. Not really sure what the problem
is.