Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
eDrive
Commits
fce75e14
Commit
fce75e14
authored
Jul 20, 2020
by
Vincent Bourgmayer
🎼
Committed by
Arnau Vàzquez
Jul 20, 2020
Browse files
Resolve "add /e/ userAgent in request"-oreo
parent
c1c7cacb
Changes
5
Hide whitespace changes
Inline
Side-by-side
.idea/gradle.xml
deleted
100644 → 0
View file @
c1c7cacb
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"GradleSettings"
>
<option
name=
"linkedExternalProjectsSettings"
>
<GradleProjectSettings>
<compositeConfiguration>
<compositeBuild
compositeDefinitionSource=
"SCRIPT"
/>
</compositeConfiguration>
<option
name=
"distributionType"
value=
"DEFAULT_WRAPPED"
/>
<option
name=
"externalProjectPath"
value=
"$PROJECT_DIR$"
/>
<option
name=
"modules"
>
<set>
<option
value=
"$PROJECT_DIR$"
/>
<option
value=
"$PROJECT_DIR$/app"
/>
<option
value=
"$PROJECT_DIR$/nextcloud-android-lib"
/>
</set>
</option>
<option
name=
"resolveModulePerSourceSet"
value=
"false"
/>
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
.idea/jarRepositories.xml
0 → 100644
View file @
fce75e14
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"RemoteRepositoriesConfiguration"
>
<remote-repository>
<option
name=
"id"
value=
"central"
/>
<option
name=
"name"
value=
"Maven Central repository"
/>
<option
name=
"url"
value=
"https://repo1.maven.org/maven2"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"jboss.community"
/>
<option
name=
"name"
value=
"JBoss Community repository"
/>
<option
name=
"url"
value=
"https://repository.jboss.org/nexus/content/repositories/public/"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"BintrayJCenter"
/>
<option
name=
"name"
value=
"BintrayJCenter"
/>
<option
name=
"url"
value=
"https://jcenter.bintray.com/"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"Google"
/>
<option
name=
"name"
value=
"Google"
/>
<option
name=
"url"
value=
"https://dl.google.com/dl/android/maven2/"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"$USER_HOME$/Android/Sdk/extras/google/m2repository"
/>
<option
name=
"name"
value=
"$USER_HOME$/Android/Sdk/extras/google/m2repository"
/>
<option
name=
"url"
value=
"file:$USER_HOME$/Android/Sdk/extras/google/m2repository"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"$USER_HOME$/Android/Sdk/extras/android/m2repository"
/>
<option
name=
"name"
value=
"$USER_HOME$/Android/Sdk/extras/android/m2repository"
/>
<option
name=
"url"
value=
"file:$USER_HOME$/Android/Sdk/extras/android/m2repository"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"$USER_HOME$/Android/Sdk/extras/m2repository"
/>
<option
name=
"name"
value=
"$USER_HOME$/Android/Sdk/extras/m2repository"
/>
<option
name=
"url"
value=
"file:$USER_HOME$/Android/Sdk/extras/m2repository"
/>
</remote-repository>
</component>
</project>
\ No newline at end of file
app/src/main/java/foundation/e/drive/utils/AppConstants.java
View file @
fce75e14
...
...
@@ -6,10 +6,18 @@
* http://www.gnu.org/licenses/gpl.html
*/
package
foundation.e.drive.utils
;
import
android.os.Build
;
import
foundation.e.drive.BuildConfig
;
import
java.text.SimpleDateFormat
;
import
java.util.Locale
;
import
foundation.e.drive.BuildConfig
;
/**
* @author Vincent Bourgmayer
*/
...
...
@@ -33,4 +41,18 @@ public abstract class AppConstants {
public
final
static
String
notificationChannelID
=
"3310"
;
public
final
static
String
notificationChannelName
=
"eDrive channel"
;
public
final
static
String
USER_AGENT
=
"eos("
+
getBuildTime
()+
")-eDrive("
+
BuildConfig
.
VERSION_NAME
+
")"
;
/**
* Get a readable OS's build date String
* @return Os'build date
*/
private
static
String
getBuildTime
(){
long
ts
=
Build
.
TIME
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMdd"
,
Locale
.
getDefault
());
return
sdf
.
format
(
ts
);
}
}
app/src/main/java/foundation/e/drive/utils/CommonUtils.java
View file @
fce75e14
...
...
@@ -26,6 +26,7 @@ import android.webkit.MimeTypeMap;
import
com.owncloud.android.lib.common.OwnCloudBasicCredentials
;
import
com.owncloud.android.lib.common.OwnCloudClient
;
import
com.owncloud.android.lib.common.OwnCloudClientFactory
;
import
com.owncloud.android.lib.common.OwnCloudClientManagerFactory
;
import
com.owncloud.android.lib.common.accounts.AccountUtils
;
import
com.owncloud.android.lib.resources.files.FileUtils
;
...
...
@@ -159,6 +160,11 @@ public abstract class CommonUtils {
oc
=
OwnCloudClientFactory
.
createOwnCloudClient
(
serverUri
,
context
,
true
);
oc
.
setCredentials
(
new
OwnCloudBasicCredentials
(
account
.
name
,
AccountManager
.
get
(
context
).
getPassword
(
account
)));
Log
.
d
(
TAG
,
"user agent: "
+
AppConstants
.
USER_AGENT
);
if
(!
AppConstants
.
USER_AGENT
.
equals
(
OwnCloudClientManagerFactory
.
getUserAgent
()))
{
OwnCloudClientManagerFactory
.
setUserAgent
(
AppConstants
.
USER_AGENT
);
}
}
catch
(
Exception
e
)
{
Log
.
e
(
TAG
,
"Can\'t parse serverPath to Uri : "
+
e
.
toString
());
oc
=
null
;
...
...
@@ -167,6 +173,7 @@ public abstract class CommonUtils {
}
/** methods relative to file **/
/**
...
...
nextcloud-android-lib
@
880099c8
Compare
c6b717a0
...
880099c8
Subproject commit
c6b717a01c2f84015357cd9dfa8b48155ff01045
Subproject commit
880099c889253f30969b81c5e07750f070bfb65c
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment