Merge pull request #1176 from kiwix/macgills/2.5-coverage
#1175 automate code coverage
75
.travis.yml
@ -4,29 +4,90 @@ jdk: oraclejdk8
|
||||
|
||||
sudo: required
|
||||
|
||||
env:
|
||||
global:
|
||||
- ANDROID_TARGET=android-22
|
||||
- ANDROID_ABI=armeabi-v7a
|
||||
|
||||
before_install:
|
||||
- openssl aes-256-cbc -K $encrypted_82adfa9c3806_key -iv $encrypted_82adfa9c3806_iv -in secrets.tar.enc -out secrets.tar -d
|
||||
- tar xvf secrets.tar
|
||||
|
||||
install:
|
||||
- pip install --user 'requests[security]'
|
||||
- wget -r -nH -nd -np -R index.html* robots.txt* http://download.kiwix.org/dev/android/api/licenses/ -e robots=off -P $ANDROID_HOME/licenses || true
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- lynx
|
||||
|
||||
before_cache:
|
||||
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
||||
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.gradle/caches/
|
||||
- $HOME/.gradle/wrapper/
|
||||
- $HOME/.android/build-cache
|
||||
- "$HOME/.gradle/caches/"
|
||||
- "$HOME/.gradle/wrapper/"
|
||||
- "$HOME/.android/build-cache"
|
||||
|
||||
android:
|
||||
components:
|
||||
- tools
|
||||
- platform-tools
|
||||
- tools
|
||||
- build-tools-27.0.3
|
||||
- build-tools-28.0.3
|
||||
- android-27
|
||||
- extra-android-m2repository
|
||||
- $ANDROID_TARGET
|
||||
- sys-img-${ANDROID_ABI}-${ANDROID_TARGET}
|
||||
|
||||
licenses:
|
||||
- '.+'
|
||||
- ".+"
|
||||
|
||||
script: ./gradlew assembleKiwixRelease testdroidUploadKiwix && ./testdroid.py
|
||||
script:
|
||||
- ./gradlew lintKiwixDebug jacocoTestKiwixDebugUnitTestReport
|
||||
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 100M
|
||||
- emulator -avd test -no-window &
|
||||
- android-wait-for-emulator
|
||||
- adb shell setprop dalvik.vm.dexopt-flags v=n,o=v
|
||||
- adb shell input keyevent 82 & # unlock screen by pressing menu button
|
||||
- adb -e logcat *:D > logcat.log &
|
||||
- ./gradlew createKiwixDebugCoverageReport
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
- ./gradlew testdroidUploadKiwixDebug
|
||||
|
||||
after_failure:
|
||||
- export LOG_DIR = ${TRAVIS_HOME}/build/kiwix/kiwix-android/app/build/outputs/reports/androidTests/connected/flavors/KIWIX/
|
||||
- lynx --dump ${LOG_DIR}com.android.builder.testing.ConnectedDevice.html
|
||||
- lynx --dump ${LOG_DIR}com.android.builder.testing.html
|
||||
- lynx --dump ${LOG_DIR}org.kiwix.kiwixmobile.tests.BasicTest.html;
|
||||
- echo " LOGCAT "; echo "========"; cat logcat.log; pkill -KILL -f adb
|
||||
|
||||
before_deploy:
|
||||
- export APP_CHANGELOG=$(cat app/src/kiwix/play/release-notes/en-US/default.txt)
|
||||
|
||||
deploy:
|
||||
|
||||
#publish on github releases
|
||||
- provider: releases
|
||||
api_key: "$GITHUB_TOKEN"
|
||||
file: app/build/outputs/apk/kiwix/release/*
|
||||
file_glob: true
|
||||
skip_cleanup: true
|
||||
overwrite: true
|
||||
body: "$APP_CHANGELOG"
|
||||
draft: true
|
||||
on:
|
||||
tags: true
|
||||
condition: $TRAVIS_BRANCH =~ ^release|master
|
||||
|
||||
#publish on play store
|
||||
- provider: script
|
||||
skip_cleanup: true
|
||||
script: ./gradlew publishKiwixRelease
|
||||
on:
|
||||
tags: true
|
||||
condition: $TRAVIS_BRANCH =~ ^release|master
|
@ -7,6 +7,7 @@ Kiwix is an offline reader for Web content. One of its main purposes is to make
|
||||
|
||||
[](https://travis-ci.org/kiwix/kiwix-android)
|
||||
[](http://chat.kiwix.org)
|
||||
[](https://codecov.io/gh/kiwix/kiwix-android)
|
||||
---
|
||||
|
||||
## Build Instructions
|
||||
|
125
app/build.gradle
@ -1,3 +1,4 @@
|
||||
import com.android.build.OutputFile
|
||||
import groovy.json.JsonSlurper
|
||||
|
||||
buildscript {
|
||||
@ -13,13 +14,18 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'checkstyle'
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-android-extensions'
|
||||
id 'kotlin-kapt'
|
||||
id 'checkstyle'
|
||||
id 'io.objectbox'
|
||||
id 'com.github.triplet.play' version '2.2.1'
|
||||
}
|
||||
|
||||
apply plugin: 'testdroid'
|
||||
apply plugin: 'io.objectbox'
|
||||
apply plugin: 'jacoco-android'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -30,12 +36,12 @@ repositories {
|
||||
google()
|
||||
}
|
||||
|
||||
String[] archs = ['arm64-v8a', 'armeabi', 'mips', 'mips64', 'x86', 'x86_64']
|
||||
String[] archs = ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64']
|
||||
dependencies {
|
||||
|
||||
// Get kiwixlib online if it is not populated locally
|
||||
if (file("../kiwixlib/src/main").list().length == 1) {
|
||||
implementation 'org.kiwix.kiwixlib:kiwixlib:1.0.11'
|
||||
implementation 'org.kiwix.kiwixlib:kiwixlib:1.0.12'
|
||||
} else {
|
||||
implementation project(':kiwixlib')
|
||||
archs = file("../kiwixlib/src/main/jniLibs").list()
|
||||
@ -67,7 +73,7 @@ dependencies {
|
||||
exclude group: 'com.android.support', module: 'recyclerview-v7'
|
||||
}
|
||||
|
||||
androidTestCompile('com.schibsted.spain:barista:2.4.0') {
|
||||
androidTestImplementation('com.schibsted.spain:barista:2.4.0') {
|
||||
exclude group: 'com.android.support'
|
||||
}
|
||||
|
||||
@ -129,6 +135,7 @@ dependencies {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
implementation "android.arch.lifecycle:extensions:1.1.1"
|
||||
@ -156,13 +163,43 @@ if(custom.listFiles()) {
|
||||
custom.eachFile() { file ->
|
||||
|
||||
def fileName = file.getName()
|
||||
if (fileName.startsWith(".") || fileName.contains("test") || fileName == "main" || fileName.contains("Test")) {
|
||||
if (fileName.startsWith(".") ||
|
||||
fileName.contains("test") ||
|
||||
fileName == "main" ||
|
||||
fileName.contains("Test")) {
|
||||
return
|
||||
}
|
||||
map.put(fileName, file.getAbsolutePath())
|
||||
}
|
||||
}
|
||||
|
||||
jacoco {
|
||||
toolVersion = "0.8.3"
|
||||
}
|
||||
|
||||
tasks.withType(Test) {
|
||||
jacoco.includeNoLocationClasses = true
|
||||
}
|
||||
|
||||
def branchName = System.getenv('TRAVIS_PULL_REQUEST') ?: "false" == "false"
|
||||
? System.getenv('TRAVIS_BRANCH') ?: "local"
|
||||
: System.getenv('TRAVIS_PULL_REQUEST_BRANCH')
|
||||
def buildNumber = System.getenv('TRAVIS_BUILD_NUMBER') ?: "dev"
|
||||
|
||||
ext {
|
||||
versionMajor = 2
|
||||
versionMinor = 5
|
||||
versionPatch = 0
|
||||
}
|
||||
|
||||
private String generateVersionName() {
|
||||
"${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"
|
||||
}
|
||||
|
||||
private Integer generateVersionCode() {
|
||||
200000 + (ext.versionMajor * 10000) + (ext.versionMinor * 100) + (ext.versionPatch)
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 27
|
||||
|
||||
@ -173,6 +210,7 @@ android {
|
||||
// See https://github.com/linkedin/dexmaker/issues/65 for why we need the following line.
|
||||
testInstrumentationRunnerArguments.notClass = 'com.android.dex.DexIndexOverflowException'
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
archivesBaseName = "${branchName.replace('/', '-')}-$buildNumber"
|
||||
}
|
||||
|
||||
aaptOptions {
|
||||
@ -194,17 +232,36 @@ android {
|
||||
warning 'InvalidPackage'
|
||||
warning 'StringFormatInvalid'
|
||||
}
|
||||
testOptions {
|
||||
unitTests.returnDefaultValues = true
|
||||
unitTests.all {
|
||||
useJUnitPlatform()
|
||||
testLogging {
|
||||
events "passed", "skipped", "failed", "standardOut", "standardError"
|
||||
outputs.upToDateWhen { false }
|
||||
showStandardStreams = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions "default"
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
storeFile file("../kiwix-android.keystore")
|
||||
storePassword System.getenv("KEY_STORE_PASSWORD") ?: "000000"
|
||||
keyAlias System.getenv("KEY_ALIAS") ?: "keystore"
|
||||
keyPassword System.getenv("KEY_PASSWORD") ?: "000000"
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
// Main build type for debugging
|
||||
debug {
|
||||
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://download.kiwix.org/\""
|
||||
buildConfigField "boolean", "KIWIX_ERROR_ACTIVITY", "false"
|
||||
// True breaks local variables being shown in breakpoints
|
||||
testCoverageEnabled false
|
||||
testCoverageEnabled true
|
||||
}
|
||||
|
||||
mock_network {
|
||||
@ -219,19 +276,12 @@ android {
|
||||
matchingFallbacks = ['debug', 'release']
|
||||
}
|
||||
|
||||
// Used to assess code coverage
|
||||
coverage {
|
||||
initWith debug
|
||||
testCoverageEnabled true
|
||||
matchingFallbacks = ['debug', 'release']
|
||||
}
|
||||
|
||||
// Release Type
|
||||
release {
|
||||
signingConfig signingConfigs.release
|
||||
buildConfigField "String", "KIWIX_DOWNLOAD_URL", "\"http://download.kiwix.org/\""
|
||||
buildConfigField "boolean", "KIWIX_ERROR_ACTIVITY", "false"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
productFlavors {
|
||||
@ -251,18 +301,22 @@ android {
|
||||
def version_code = project.property('version_code')
|
||||
versionCode version_code.toInteger()
|
||||
} else {
|
||||
versionCode 56
|
||||
versionCode generateVersionCode()
|
||||
}
|
||||
if (project.hasProperty('version_name')) {
|
||||
versionName project.property('version_name')
|
||||
} else {
|
||||
versionName "2.5"
|
||||
versionName generateVersionName()
|
||||
}
|
||||
}
|
||||
|
||||
// Custom apps built from a json file, zim file and icon set
|
||||
map.each { name, directory ->
|
||||
"$name" {
|
||||
println "Configuring $name"
|
||||
if (name == "kiwix") {
|
||||
return
|
||||
}
|
||||
if (file(directory + "/build.gradle").exists()) {
|
||||
apply from: directory + "/build.gradle"
|
||||
}
|
||||
@ -370,13 +424,32 @@ android {
|
||||
androidExtensions {
|
||||
experimental = true
|
||||
}
|
||||
testOptions {
|
||||
unitTests.returnDefaultValues = true
|
||||
|
||||
def abiCodes = ['arm64-v8a': 1, 'x86': 2, 'x86_64': 3, 'armeabi-v7a': 4]
|
||||
splits {
|
||||
abi {
|
||||
enable true
|
||||
reset()
|
||||
include "x86", "x86_64", 'armeabi-v7a', "arm64-v8a"
|
||||
universalApk true
|
||||
}
|
||||
}
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
def baseAbiVersionCode = abiCodes.get(output.getFilter(OutputFile.ABI))
|
||||
if (baseAbiVersionCode != null) {
|
||||
output.versionCodeOverride = baseAbiVersionCode * 1000000 + variant.versionCode
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Testdroid deployment configuration
|
||||
def buildNumber = System.getenv('TRAVIS_BUILD_NUMBER')
|
||||
play {
|
||||
enabled = branchName == "master" || branchName == "release"
|
||||
serviceAccountCredentials = file("../google.json")
|
||||
track = "alpha"
|
||||
resolutionStrategy = "fail"
|
||||
}
|
||||
|
||||
def findJar(prefix) {
|
||||
configurations.runtime.filter { it.name.startsWith(prefix) }
|
||||
|
@ -17,18 +17,17 @@
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.di.components;
|
||||
|
||||
import android.content.Context;
|
||||
import dagger.BindsInstance;
|
||||
import dagger.Component;
|
||||
import javax.inject.Singleton;
|
||||
import org.kiwix.kiwixmobile.di.modules.ApplicationModule;
|
||||
import org.kiwix.kiwixmobile.di.modules.JNIModule;
|
||||
import org.kiwix.kiwixmobile.di.modules.TestJNIModule;
|
||||
import org.kiwix.kiwixmobile.di.modules.TestNetworkModule;
|
||||
import org.kiwix.kiwixmobile.tests.NetworkTest;
|
||||
import org.kiwix.kiwixmobile.tests.ZimTest;
|
||||
import org.kiwix.kiwixmobile.utils.TestNetworkInterceptor;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Component;
|
||||
|
||||
/**
|
||||
* Created by mhutti1 on 13/04/17.
|
||||
*/
|
||||
@ -41,6 +40,14 @@ import dagger.Component;
|
||||
})
|
||||
public interface TestComponent extends ApplicationComponent {
|
||||
|
||||
@Component.Builder
|
||||
interface Builder {
|
||||
|
||||
@BindsInstance TestComponent.Builder context(Context context);
|
||||
|
||||
TestComponent build();
|
||||
}
|
||||
|
||||
void inject(ZimTest zimTest);
|
||||
|
||||
void inject(NetworkTest networkTest);
|
||||
|
@ -17,7 +17,6 @@
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.di.modules;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.kiwix.kiwixlib.JNIKiwix;
|
||||
import org.kiwix.kiwixlib.JNIKiwixString;
|
||||
import org.mockito.Mockito;
|
||||
|
@ -18,22 +18,21 @@
|
||||
|
||||
package org.kiwix.kiwixmobile.tests;
|
||||
|
||||
|
||||
import android.Manifest;
|
||||
import android.support.test.espresso.Espresso;
|
||||
import android.support.test.espresso.IdlingPolicies;
|
||||
import android.support.test.espresso.ViewInteraction;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.support.test.rule.GrantPermissionRule;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
import android.util.Log;
|
||||
|
||||
import com.schibsted.spain.barista.interaction.BaristaSleepInteractions;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@ -41,11 +40,8 @@ import org.kiwix.kiwixmobile.R;
|
||||
import org.kiwix.kiwixmobile.utils.KiwixIdlingResource;
|
||||
import org.kiwix.kiwixmobile.utils.SplashActivity;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onData;
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.action.ViewActions.click;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withParent;
|
||||
@ -85,6 +81,7 @@ public class DownloadTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("Broken in 2.5")//TODO: Fix in 3.0
|
||||
public void downloadTest() {
|
||||
enterHelp();
|
||||
clickOn(R.string.menu_zim_manager);
|
||||
@ -97,12 +94,6 @@ public class DownloadTest {
|
||||
|
||||
clickOn(R.string.remote_zims);
|
||||
|
||||
try {
|
||||
clickOn(R.id.network_permission_button);
|
||||
} catch (RuntimeException e) {
|
||||
Log.d(KIWIX_DOWNLOAD_TEST, "Failed to click Network Permission Button", e);
|
||||
}
|
||||
|
||||
captureAndSaveScreenshot("Before-checking-for-ZimManager-Main-Activity");
|
||||
ViewInteraction viewPager2 = onView(
|
||||
allOf(withId(R.id.manageViewPager),
|
||||
|
@ -24,11 +24,19 @@ import android.support.test.espresso.IdlingPolicies;
|
||||
import android.support.test.rule.ActivityTestRule;
|
||||
import android.support.test.rule.GrantPermissionRule;
|
||||
import android.util.Log;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.inject.Inject;
|
||||
import okhttp3.mockwebserver.MockResponse;
|
||||
import okhttp3.mockwebserver.MockWebServer;
|
||||
import okio.Buffer;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.kiwix.kiwixmobile.KiwixApplication;
|
||||
@ -37,20 +45,10 @@ import org.kiwix.kiwixmobile.R;
|
||||
import org.kiwix.kiwixmobile.ZimContentProvider;
|
||||
import org.kiwix.kiwixmobile.di.components.DaggerTestComponent;
|
||||
import org.kiwix.kiwixmobile.di.components.TestComponent;
|
||||
import org.kiwix.kiwixmobile.di.modules.ApplicationModule;
|
||||
import org.kiwix.kiwixmobile.testutils.TestUtils;
|
||||
import org.kiwix.kiwixmobile.utils.IOUtils;
|
||||
import org.kiwix.kiwixmobile.utils.KiwixIdlingResource;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import okhttp3.mockwebserver.MockResponse;
|
||||
import okhttp3.mockwebserver.MockWebServer;
|
||||
import okio.Buffer;
|
||||
|
||||
import static android.support.test.InstrumentationRegistry.getInstrumentation;
|
||||
import static android.support.test.espresso.Espresso.onData;
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
@ -93,9 +91,8 @@ public class NetworkTest {
|
||||
@Before
|
||||
public void setUp() {
|
||||
|
||||
TestComponent component = DaggerTestComponent.builder().applicationModule
|
||||
(new ApplicationModule(
|
||||
(KiwixApplication) getInstrumentation().getTargetContext().getApplicationContext())).build();
|
||||
TestComponent component = DaggerTestComponent.builder().context(
|
||||
getInstrumentation().getTargetContext().getApplicationContext()).build();
|
||||
|
||||
((KiwixApplication) getInstrumentation().getTargetContext().getApplicationContext()).setApplicationComponent(component);
|
||||
|
||||
@ -121,6 +118,7 @@ public class NetworkTest {
|
||||
|
||||
|
||||
@Test
|
||||
@Ignore("Broken in 2.5")//TODO: Fix in 3.0
|
||||
public void networkTest() {
|
||||
|
||||
mActivityTestRule.launchActivity(null);
|
||||
@ -130,13 +128,6 @@ public class NetworkTest {
|
||||
|
||||
TestUtils.allowPermissionsIfNeeded();
|
||||
|
||||
try {
|
||||
onView(withId(R.id.network_permission_button)).perform(click());
|
||||
} catch (RuntimeException e) {
|
||||
Log.i(NETWORK_TEST_TAG,
|
||||
"Permission dialog was not shown, we probably already have required permissions");
|
||||
}
|
||||
|
||||
onData(withContent("wikipedia_ab_all_2017-03")).inAdapterView(withId(R.id.libraryList)).perform(click());
|
||||
|
||||
try {
|
||||
|
@ -0,0 +1,57 @@
|
||||
package org.kiwix.kiwixmobile.utils;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/*
|
||||
* Kiwix Android
|
||||
* Copyright (C) 2018 Kiwix <android.kiwix.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
public class IOUtils {
|
||||
private IOUtils() {
|
||||
//utility class
|
||||
}
|
||||
|
||||
private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
|
||||
private static final int EOF = -1;
|
||||
|
||||
public static byte[] toByteArray(final InputStream input) throws IOException {
|
||||
try (final ByteArrayOutputStream output = new ByteArrayOutputStream()) {
|
||||
copy(input, output);
|
||||
return output.toByteArray();
|
||||
}
|
||||
}
|
||||
private static int copy(final InputStream input, final OutputStream output) throws IOException {
|
||||
final long count = copyLarge(input, output);
|
||||
if (count > Integer.MAX_VALUE) {
|
||||
return -1;
|
||||
}
|
||||
return (int) count;
|
||||
|
||||
}
|
||||
private static long copyLarge(final InputStream input, final OutputStream output) throws IOException {
|
||||
final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
|
||||
long count = 0;
|
||||
int n;
|
||||
while (EOF != (n = input.read(buffer))) {
|
||||
output.write(buffer, 0, n);
|
||||
count += n;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
1
app/src/kiwix/play/contact-email.txt
Normal file
@ -0,0 +1 @@
|
||||
contact+android@kiwix.org
|
1
app/src/kiwix/play/contact-website.txt
Normal file
@ -0,0 +1 @@
|
||||
http://www.kiwix.org
|
1
app/src/kiwix/play/default-language.txt
Normal file
@ -0,0 +1 @@
|
||||
en-US
|
9
app/src/kiwix/play/listings/de-DE/full-description.txt
Normal file
@ -0,0 +1,9 @@
|
||||
Die ganze Wikipedia auf deinem Mobilgerät!
|
||||
|
||||
Kiwix ist eine Programm, daß das Lesen der Wikipedia und anderer Inhalte (Ubuntu Dokumentation, WikiLeaks, WikiVoyage, WikiSource, etc) ohne Internetverbindung erlaubt.
|
||||
|
||||
Sobald du die Inhaltsdateien heruntergeladen hast, die sehr groß sein können, benötigst du keine Internetverbindung um sie zu verwenden.
|
||||
|
||||
Siehe die Hilfe in der App und unsere Webseite für Informationen über verfügbare Inhalte.
|
||||
|
||||
Anmerkung: Kiwix existiert auch für PCs (Windows, Mac, Linux) verfügbar..
|
1
app/src/kiwix/play/listings/de-DE/short-description.txt
Normal file
@ -0,0 +1 @@
|
||||
Die Wikipedia immer dabei; ohne Internetverbindung!
|
1
app/src/kiwix/play/listings/de-DE/title.txt
Normal file
@ -0,0 +1 @@
|
||||
Kiwix, Wikipedia offline
|
7
app/src/kiwix/play/listings/en-US/full-description.txt
Normal file
@ -0,0 +1,7 @@
|
||||
The whole of Wikipedia on your device!
|
||||
|
||||
The app is a lightweight piece of software reading bigger files stored on your device or SD card: once it is installed, you can select which additional content you would like to download (Wikipedia, Wiktionary, TED talks, etc.) and be ready for when your internet connexion is bad (or need to be in airplane mode)!
|
||||
|
||||
Please read the instructions inside the App or on the website (www.kiwix.org) to learn about the various contents that are available for download.
|
||||
|
||||
Note: Kiwix is also available on regular computers (Windows, Mac, Linux).
|
After Width: | Height: | Size: 253 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 522 KiB |
After Width: | Height: | Size: 491 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 212 KiB |
After Width: | Height: | Size: 185 KiB |
After Width: | Height: | Size: 491 KiB |
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 145 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 323 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 491 KiB |
After Width: | Height: | Size: 522 KiB |
After Width: | Height: | Size: 68 KiB |
1
app/src/kiwix/play/listings/en-US/short-description.txt
Normal file
@ -0,0 +1 @@
|
||||
Wikipedia (and a lot more) at hand everywhere. No internet required!
|
1
app/src/kiwix/play/listings/en-US/title.txt
Normal file
@ -0,0 +1 @@
|
||||
Kiwix, Wikipedia offline
|
11
app/src/kiwix/play/listings/fr-FR/full-description.txt
Normal file
@ -0,0 +1,11 @@
|
||||
Tout Wikipédia dans votre mobile !
|
||||
|
||||
Kiwix est un lecteur de contenus hors-ligne qui peut être utilisé pour Wikipédia ainsi que d'autres contenus (Documentation Ubuntu, WikiLeaks, WikiVoyage, WikiSource, etc).
|
||||
|
||||
Une fois que vous avez téléchargé le fichier de contenu (potentiellement très gros), vous n'avez plus du tout besoin de connexion pour l'utiliser.
|
||||
|
||||
Kiwix est une application légère utilisant des fichiers ZIM que vous aurez préalablement téléchargé et stocké sur la mémoire externe (carte SD).
|
||||
|
||||
Merci de consulter les instructions d'utilisations dans l'application ainsi que sur le site web pour en savoir plus sur les contenus disponibles.
|
||||
|
||||
Note: Kiwix est aussi disponible sur ordinateur (Windows, Mac, Linux).
|
1
app/src/kiwix/play/listings/fr-FR/short-description.txt
Normal file
@ -0,0 +1 @@
|
||||
Emportez la Wikipédia partout avec vous ; sans connexion !
|
1
app/src/kiwix/play/listings/fr-FR/title.txt
Normal file
@ -0,0 +1 @@
|
||||
Kiwix, Wikipédia sans Internet
|
11
app/src/kiwix/play/listings/it-IT/full-description.txt
Normal file
@ -0,0 +1,11 @@
|
||||
L'intera Wikipedia sempre con te!
|
||||
|
||||
Kiwix è un lettore non in linea di contenuti e siti di ogni genere, Wikipedia ma non solo (documentazione di Ubuntu, WikiLeaks, Wikisource, Wikivoyage ecc.).
|
||||
|
||||
Una volta scaricato l'archivio ZIM contenente il tutto (potenzialmente molto grande), non serve alcuna connessione a internet per navigarlo.
|
||||
|
||||
Kiwix è leggero e gli archivi ZIM si possono scaricare e conservare nel tuo apparecchio android o memoria esterna (scheda SD).
|
||||
|
||||
Controlla le istruzioni nell'applicazione e nel sito per sapere di più sui contenuti disponibili.
|
||||
|
||||
Nota, Kiwix è disponibile anche per computer normali (Windows, Mac e Linux).
|
1
app/src/kiwix/play/listings/it-IT/short-description.txt
Normal file
@ -0,0 +1 @@
|
||||
Wikipedia sempre con te!
|
1
app/src/kiwix/play/listings/it-IT/title.txt
Normal file
@ -0,0 +1 @@
|
||||
Kiwix
|
5
app/src/kiwix/play/listings/tr-TR/full-description.txt
Normal file
@ -0,0 +1,5 @@
|
||||
Vikipedi'nin tamamı cihazınızda!
|
||||
|
||||
Uygulama, cihazınızda veya SD kartta depolanan büyük dosyalar okuyan hafif bir yazılım parçasıdır: yükledikten sonra, hangi ek içerikler indirmek istediğinizi seçebilirsiniz (Vikipedi, Vikisözlük, TED Konferansları, v.b.) ve ne zaman internet bağlantınız kötü olsa, hazır olabilirsiniz (veya uçak modunda olmanız gerekiyorsa) !
|
||||
|
||||
Indirmek için hazır olan çeşitli içerikler hakkında bilgi edinmek için, lütfen uygulama içindeki veya web sitemizindeki talimatları okuyun (www.kiwix.org)
|
After Width: | Height: | Size: 379 KiB |
After Width: | Height: | Size: 809 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 278 KiB |
After Width: | Height: | Size: 502 KiB |
After Width: | Height: | Size: 121 KiB |
After Width: | Height: | Size: 670 KiB |
1
app/src/kiwix/play/listings/tr-TR/short-description.txt
Normal file
@ -0,0 +1 @@
|
||||
Kiwix ile, Vikipedi tamamıyla telefonunuza veya tabletinize indirin
|
1
app/src/kiwix/play/listings/tr-TR/title.txt
Normal file
@ -0,0 +1 @@
|
||||
Kiwix - offline Vikipedi
|
3
app/src/kiwix/play/release-notes/en-US/default.txt
Normal file
@ -0,0 +1,3 @@
|
||||
NEW: Downloads are now using the DownloadManager
|
||||
NEW: Downloads/Device/Library completely rewritten
|
||||
+ Lots More
|
@ -176,8 +176,6 @@
|
||||
</receiver>
|
||||
|
||||
|
||||
<service android:name=".downloader.DownloadService" />
|
||||
|
||||
<activity
|
||||
android:name=".KiwixErrorActivity"
|
||||
android:process=":error_activity" />
|
||||
|
@ -9,6 +9,7 @@ buildscript {
|
||||
classpath 'com.android.tools.build:gradle:3.4.1'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"
|
||||
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.4'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
174
google.json
Normal file
@ -0,0 +1,174 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "529266483286",
|
||||
"firebase_url": "https://dummy-robot-scouter-for-travis.firebaseio.com",
|
||||
"project_id": "dummy-robot-scouter-for-travis",
|
||||
"storage_bucket": "dummy-robot-scouter-for-travis.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:529266483286:android:3fe88d30d9c76f79",
|
||||
"android_client_info": {
|
||||
"package_name": "com.supercilex.robotscouter.debug"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyCWZh_3qAXEn9zzyRMZ0Yp2wCCkXkWbyc4"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"analytics_service": {
|
||||
"status": 1
|
||||
},
|
||||
"appinvite_service": {
|
||||
"status": 1,
|
||||
"other_platform_oauth_client": []
|
||||
},
|
||||
"ads_service": {
|
||||
"status": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:529266483286:android:fa7f0f2977f5f001",
|
||||
"android_client_info": {
|
||||
"package_name": "com.supercilex.robotscouter"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "529266483286-6vo1cbbrsvdl80mqdomk3i3m425mv07b.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.supercilex.robotscouter",
|
||||
"certificate_hash": "0c7b6732a540434aca7e4bdea13aa3ed3209242f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyCWZh_3qAXEn9zzyRMZ0Yp2wCCkXkWbyc4"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"analytics_service": {
|
||||
"status": 1
|
||||
},
|
||||
"appinvite_service": {
|
||||
"status": 2,
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
},
|
||||
"ads_service": {
|
||||
"status": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:529266483286:android:91eecf4730fc920b",
|
||||
"android_client_info": {
|
||||
"package_name": "com.firebase.uidemo"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "529266483286-qid6ms49u1kq7q3e0guv8fuvsqhthi4r.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.firebase.uidemo",
|
||||
"certificate_hash": "0c7b6732a540434aca7e4bdea13aa3ed3209242f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyCWZh_3qAXEn9zzyRMZ0Yp2wCCkXkWbyc4"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"analytics_service": {
|
||||
"status": 1
|
||||
},
|
||||
"appinvite_service": {
|
||||
"status": 2,
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
},
|
||||
"ads_service": {
|
||||
"status": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:529266483286:android:31fef6725a92125b",
|
||||
"android_client_info": {
|
||||
"package_name": "com.supercilex.test"
|
||||
}
|
||||
},
|
||||
"oauth_client": [
|
||||
{
|
||||
"client_id": "529266483286-tmk00dnjnsbqo0j6ha30rmul2u3aqppf.apps.googleusercontent.com",
|
||||
"client_type": 1,
|
||||
"android_info": {
|
||||
"package_name": "com.supercilex.test",
|
||||
"certificate_hash": "0c7b6732a540434aca7e4bdea13aa3ed3209242f"
|
||||
}
|
||||
},
|
||||
{
|
||||
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyCWZh_3qAXEn9zzyRMZ0Yp2wCCkXkWbyc4"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"analytics_service": {
|
||||
"status": 1
|
||||
},
|
||||
"appinvite_service": {
|
||||
"status": 2,
|
||||
"other_platform_oauth_client": [
|
||||
{
|
||||
"client_id": "529266483286-43pcoiq9hfu81rakcpa3o8pung09o52a.apps.googleusercontent.com",
|
||||
"client_type": 3
|
||||
}
|
||||
]
|
||||
},
|
||||
"ads_service": {
|
||||
"status": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|