mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
Fix log reporting for release builds (#1916)
* Fix log reporting for release builds * Fix logs for release builds * wip * Clean up the branch to exclude unrelated changes * With java docs * Uncomment quiz checker * Check for external storage permissions before sending logs * With more java docs * Fix crash while zipping log files * Do not log token and cookies * Add instruction to restart app
This commit is contained in:
parent
02fe0044a6
commit
b0b4b08100
28 changed files with 761 additions and 136 deletions
|
|
@ -8,7 +8,6 @@ import android.support.annotation.NonNull;
|
|||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.VisibleForTesting;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
|
|
@ -213,8 +212,6 @@ public class ApacheHttpClientMediaWikiApi implements MediaWikiApi {
|
|||
@Override
|
||||
public void setAuthCookie(String authCookie) {
|
||||
api.setAuthCookie(authCookie);
|
||||
|
||||
Timber.d("Mediawiki auth cookie is %s", api.getAuthCookie());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -894,7 +891,7 @@ public class ApacheHttpClientMediaWikiApi implements MediaWikiApi {
|
|||
|
||||
CustomApiResult result = api.upload(filename, file, dataLength, pageContents, editSummary, getCentralAuthToken(), getEditToken(), progressListener::onProgress);
|
||||
|
||||
Log.e("WTF", "Result: " + result.toString());
|
||||
Timber.wtf("Result: " + result.toString());
|
||||
|
||||
String resultStatus = result.getString("/api/upload/@result");
|
||||
|
||||
|
|
@ -981,7 +978,7 @@ public class ApacheHttpClientMediaWikiApi implements MediaWikiApi {
|
|||
new PageTitle(userName).getText());
|
||||
HttpUrl.Builder urlBuilder = HttpUrl.parse(url).newBuilder();
|
||||
urlBuilder.addQueryParameter("user", userName);
|
||||
Log.i("url", urlBuilder.toString());
|
||||
Timber.i("Url %s", urlBuilder.toString());
|
||||
Request request = new Request.Builder()
|
||||
.url(urlBuilder.toString())
|
||||
.build();
|
||||
|
|
|
|||
|
|
@ -38,9 +38,6 @@ public class CustomApiResult {
|
|||
|
||||
static CustomApiResult fromRequestBuilder(Http.HttpRequestBuilder builder, HttpClient client) throws IOException {
|
||||
|
||||
Timber.d("API request is %s", builder.toString());
|
||||
Timber.d("API params are %s", client.getParams());
|
||||
|
||||
try {
|
||||
DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
Document doc = docBuilder.parse(builder.use(client).charset("utf-8").data("format", "xml").asResponse().getEntity().getContent());
|
||||
|
|
|
|||
|
|
@ -140,8 +140,6 @@ public class CustomMwApi {
|
|||
}
|
||||
|
||||
public CustomApiResult upload(String filename, InputStream file, long length, String text, String comment, String centralAuthToken, String token, ProgressListener uploadProgressListener) throws IOException {
|
||||
Timber.d("Token being used is %s", token);
|
||||
|
||||
Http.HttpRequestBuilder builder = Http.multipart(apiURL)
|
||||
.data("action", "upload")
|
||||
.data("token", token)
|
||||
|
|
@ -157,8 +155,6 @@ public class CustomMwApi {
|
|||
builder.file("file", filename, file);
|
||||
}
|
||||
|
||||
Timber.d("Final cookies are %s", client.getCookieStore().getCookies().toString());
|
||||
|
||||
return CustomApiResult.fromRequestBuilder(builder, client);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue