mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Merge pull request #158 from misaochan/ssl-exception
Fix SSL Excetption
This commit is contained in:
commit
f5adb69c6f
3 changed files with 12 additions and 6 deletions
|
|
@ -64,14 +64,14 @@ public class LicenseList {
|
|||
}
|
||||
|
||||
public String nameForTemplate(String template) {
|
||||
Log.d("Commons", "LicenseList.nameForTemplate: template: " + template);
|
||||
//Log.d("Commons", "LicenseList.nameForTemplate: template: " + template);
|
||||
String stringId = nameIdForTemplate(template);
|
||||
Log.d("Commons", "LicenseList.nameForTemplate: stringId: " + stringId);
|
||||
//Log.d("Commons", "LicenseList.nameForTemplate: stringId: " + stringId);
|
||||
int nameId = stringIdByName(stringId);
|
||||
Log.d("Commons", "LicenseList.nameForTemplate: nameId: " + nameId);
|
||||
//Log.d("Commons", "LicenseList.nameForTemplate: nameId: " + nameId);
|
||||
if(nameId != 0) {
|
||||
String name = res.getString(nameId);
|
||||
Log.d("Commons", "LicenseList.nameForTemplate: name: " + name);
|
||||
//Log.d("Commons", "LicenseList.nameForTemplate: name: " + name);
|
||||
return name;
|
||||
}
|
||||
return template;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,9 @@ public class MethodAUpdater extends AsyncTask<Void, Void, ArrayList<String>> {
|
|||
.get();
|
||||
Log.d(TAG, "Method A URL filter" + result.toString());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
Log.e(TAG, "IO Exception: ", e);
|
||||
//Return empty arraylist
|
||||
return categories;
|
||||
}
|
||||
|
||||
ArrayList<ApiResult> categoryNodes = result.getNodes("/api/query/search/p/@title");
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import org.mediawiki.api.MWApi;
|
|||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.net.ssl.SSLPeerUnverifiedException;
|
||||
|
||||
import fr.free.nrw.commons.CommonsApplication;
|
||||
|
||||
/**
|
||||
|
|
@ -63,7 +65,9 @@ public class PrefixUpdater extends AsyncTask<Void, Void, ArrayList<String>> {
|
|||
.get();
|
||||
Log.d(TAG, "Prefix URL filter" + result.toString());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
Log.e(TAG, "IO Exception: ", e);
|
||||
//Return empty arraylist
|
||||
return categories;
|
||||
}
|
||||
|
||||
ArrayList<ApiResult> categoryNodes = result.getNodes("/api/query/allcategories/c");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue