diff --git a/.travis.yml b/.travis.yml index 3ae50120d..59b458523 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,12 @@ language: android jdk: oraclejdk8 + branches: only: - - test-builds - - /^v([0-9]+)\.([0-9]+).*$/ + - master + - test-builds + - /^v([0-9]+)\.([0-9]+).*$/ + android: components: - platform-tools @@ -11,44 +14,57 @@ android: - build-tools-28.0.3 - android-28 - extra-android-m2repository + addons: apt: sources: deadsnakes packages: python3.7 ssh_known_hosts: ssh.iitc.app + notifications: email: on_success: change on_failure: always + jobs: include: - stage: test-builds if: branch = test-builds env: BUILD_TYPE=test + - stage: beta + if: branch = master + env: BUILD_TYPE=beta - stage: release - if: branch != test-builds + if: NOT branch IN (test-builds, master) env: BUILD_TYPE=release -before_install: sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1 +before_install: + - sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1 + - bundle install --path vendor/bundle before_script: - - git fetch --unshallow - wget https://iitc.app/deploy/localbuildsettings.py script: ./build.py $BUILD_TYPE deploy: + # deploy to iitc site - provider: script skip_cleanup: true script: curl -s https://iitc.app/deploy/deploy.sh | bash -s -- $BUILD_TYPE on: - branch: test-builds + all_branches: true + + # deploy to google play - provider: script skip_cleanup: true - script: curl -s https://iitc.app/deploy/deploy.sh | bash -s -- $BUILD_TYPE + script: + - echo $GOOGLE_PLAY_ACCOUNT > gplay_api.json + - bundle exec fastlane deploy_$BUILD_TYPE on: - tags: true branch: master + + # deploy to github releases - provider: releases skip_cleanup: true name: $TRAVIS_TAG @@ -60,4 +76,3 @@ deploy: - ./build/release/*.zip on: tags: true - branch: master diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..7a118b49b --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "fastlane" diff --git a/README.md b/README.md index 1e27446e2..6e00990cf 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ Ingress Intel Total Conversion (IITC) ===================================== +[![Build Status](http://img.shields.io/travis/IITC-CE/ingress-intel-total-conversion/master.svg?label=beta)](https://travis-ci.org/IITC-CE/ingress-intel-total-conversion) [![Build Status](http://img.shields.io/travis/IITC-CE/ingress-intel-total-conversion/test-builds.svg?label=test-builds)](https://travis-ci.org/IITC-CE/ingress-intel-total-conversion) [![Docs Status](https://readthedocs.org/projects/iitc-ce/badge/?version=latest)](https://readthedocs.org/projects/iitc-ce/) [![LICENSE](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE) diff --git a/build_mobile.py b/build_mobile.py index bde50bdc6..c83474ffd 100755 --- a/build_mobile.py +++ b/build_mobile.py @@ -19,7 +19,7 @@ ], } iitc_script = 'total-conversion-build.user.js' -buildtypes = {'debug', 'release'} +buildtypes = {'debug', 'beta', 'release'} def add_default_settings(build_source): diff --git a/fastlane/Appfile b/fastlane/Appfile new file mode 100644 index 000000000..0402a65e6 --- /dev/null +++ b/fastlane/Appfile @@ -0,0 +1 @@ +json_key_file("gplay_api.json") diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 000000000..b2fba921a --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,32 @@ +# This file contains the fastlane.tools configuration +# You can find the documentation at https://docs.fastlane.tools +# +# For a list of all available actions, check out +# +# https://docs.fastlane.tools/actions +# +# For a list of all available plugins, check out +# +# https://docs.fastlane.tools/plugins/available-plugins +# + +default_platform(:android) + +platform :android do + desc "Deploy of beta version to Google Play" + lane :deploy_beta do + upload_to_play_store(track: "beta", + package_name: "org.exarhteam.iitc_mobile", + apk: "build/beta/IITC_Mobile-beta.apk") + end + + desc "Deploy of release to Google Play" + lane :deploy_release do + upload_to_play_store(track: "release", + package_name: "org.exarhteam.iitc_mobile", + apk: "build/release/IITC_Mobile-release.apk") + end +end + + + diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt new file mode 100644 index 000000000..82a6e7948 --- /dev/null +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -0,0 +1,8 @@ +IMPORTANT NOTE: this app runs on data hosted by Ingress. Prior to leaving a bad rating please try https://intel.ingress.com/ and note the load time and please take that in consideration when leaving your review thank you. + +Ingress Intel Total Conversion - Community Edition (IITC-CE) is a browser addon for the Ingress augmented reality game. It is faster than the standard Ingress map, and offers many more features. + +It is available for desktop browsers, such as Firefox and Chrome, and as a mobile application. + +Website: https://iitc.app +GitHub Repository: https://github.com/IITC-CE/ingress-intel-total-conversion/ \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/images/featureGraphic.png b/fastlane/metadata/android/en-US/images/featureGraphic.png new file mode 100644 index 000000000..be77836aa Binary files /dev/null and b/fastlane/metadata/android/en-US/images/featureGraphic.png differ diff --git a/fastlane/metadata/android/en-US/images/icon.png b/fastlane/metadata/android/en-US/images/icon.png new file mode 100644 index 000000000..9b8e311db Binary files /dev/null and b/fastlane/metadata/android/en-US/images/icon.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/1_en-US.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/1_en-US.png new file mode 100644 index 000000000..b99e26127 Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/1_en-US.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/2_en-US.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/2_en-US.png new file mode 100644 index 000000000..9dc688ff3 Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/2_en-US.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/3_en-US.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/3_en-US.png new file mode 100644 index 000000000..244b6cbfe Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/3_en-US.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/4_en-US.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/4_en-US.png new file mode 100644 index 000000000..3a91b80a4 Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/4_en-US.png differ diff --git a/fastlane/metadata/android/en-US/short_description.txt b/fastlane/metadata/android/en-US/short_description.txt new file mode 100644 index 000000000..601d61105 --- /dev/null +++ b/fastlane/metadata/android/en-US/short_description.txt @@ -0,0 +1 @@ +IITC-CE map for Ingress Prime game \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/title.txt b/fastlane/metadata/android/en-US/title.txt new file mode 100644 index 000000000..990be12b4 --- /dev/null +++ b/fastlane/metadata/android/en-US/title.txt @@ -0,0 +1 @@ +IITC-CE Mobile \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/video.txt b/fastlane/metadata/android/en-US/video.txt new file mode 100644 index 000000000..e69de29bb diff --git a/fastlane/metadata/android/ru-RU/full_description.txt b/fastlane/metadata/android/ru-RU/full_description.txt new file mode 100644 index 000000000..5ce68d64d --- /dev/null +++ b/fastlane/metadata/android/ru-RU/full_description.txt @@ -0,0 +1,8 @@ +ВАЖНО: это приложение использует данные, размещённые на сервере Ingress. Перед выставлением плохой оценки, пожалуйста, попробуйте открыть https://intel.ingress.com/ и обратите внимание на работу ресурса и время загрузки. Спасибо. + +Ingress Intel Total Conversion - Community Edition (IITC-CE) - это браузерное дополнение для игры в дополненной реальности Ingress. Работает быстрее, чем стандартная Ingress карта, и предлагает множество других функций. + +IITC-CE доступен для компьютерных браузеров, таких как Firefox и Chrome, а также в виде приложения для Android. + +Сайт: https://iitc.app +GitHub репозиторий: https://github.com/IITC-CE/ingress-intel-total-conversion/ \ No newline at end of file diff --git a/fastlane/metadata/android/ru-RU/short_description.txt b/fastlane/metadata/android/ru-RU/short_description.txt new file mode 100644 index 000000000..3218c941a --- /dev/null +++ b/fastlane/metadata/android/ru-RU/short_description.txt @@ -0,0 +1 @@ +Карта IITC-CE для игры Ingress Prime \ No newline at end of file diff --git a/fastlane/metadata/android/ru-RU/title.txt b/fastlane/metadata/android/ru-RU/title.txt new file mode 100644 index 000000000..990be12b4 --- /dev/null +++ b/fastlane/metadata/android/ru-RU/title.txt @@ -0,0 +1 @@ +IITC-CE Mobile \ No newline at end of file diff --git a/fastlane/metadata/android/ru-RU/video.txt b/fastlane/metadata/android/ru-RU/video.txt new file mode 100644 index 000000000..e69de29bb diff --git a/mobile/app/build.gradle b/mobile/app/build.gradle index 37826f2b5..d6a91859d 100644 --- a/mobile/app/build.gradle +++ b/mobile/app/build.gradle @@ -2,18 +2,18 @@ apply plugin: 'com.android.application' final BUILD_DATE = new Date().format('yyyy.MM.dd-HH:mm') -def getVersionCode = { -> - def git = 'git rev-list HEAD --count' +def getVersionCodeTimeStamps = { -> + def git = 'git log -1 --pretty=format:%ct' def proc = git.execute() proc.waitFor() - def desc = "${proc.in.text}".trim() + def unixtime = "${proc.in.text}".trim() - if (desc.isEmpty()) { - println "ERROR setting version code" + if (unixtime.isEmpty()) { + println "Failed to get commit date" return -1 } - return Integer.parseInt(desc) + return Integer.parseInt(unixtime) } android { @@ -24,7 +24,7 @@ android { applicationId "org.exarhteam.iitc_mobile" minSdkVersion 17 targetSdkVersion 28 - versionCode = getVersionCode() + versionCode = getVersionCodeTimeStamps() versionName "0.30.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -55,11 +55,16 @@ android { applicationIdSuffix ".debug" versionNameSuffix "-test-$BUILD_DATE" minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' signingConfig signingConfigs.debug } + beta { + versionNameSuffix "-beta-$BUILD_DATE" + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + signingConfig signingConfigs.release + } release { - minifyEnabled false + minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } diff --git a/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_JSInterface.java b/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_JSInterface.java index 2961cee67..afc53a49c 100644 --- a/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_JSInterface.java +++ b/mobile/app/src/main/java/org/exarhteam/iitc_mobile/IITC_JSInterface.java @@ -15,7 +15,6 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; -import java.lang.NullPointerException; // provide communication between IITC script and android app public class IITC_JSInterface { diff --git a/mobile/app/src/main/java/org/exarhteam/iitc_mobile/prefs/PluginPreferenceActivity.java b/mobile/app/src/main/java/org/exarhteam/iitc_mobile/prefs/PluginPreferenceActivity.java index 5bedee58e..b6799c7a3 100644 --- a/mobile/app/src/main/java/org/exarhteam/iitc_mobile/prefs/PluginPreferenceActivity.java +++ b/mobile/app/src/main/java/org/exarhteam/iitc_mobile/prefs/PluginPreferenceActivity.java @@ -1,6 +1,5 @@ package org.exarhteam.iitc_mobile.prefs; -import android.Manifest; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; @@ -21,8 +20,6 @@ import android.widget.TextView; import android.widget.Toast; -import androidx.core.app.ActivityCompat; - import org.exarhteam.iitc_mobile.IITC_FileManager; import org.exarhteam.iitc_mobile.IITC_NotificationHelper; import org.exarhteam.iitc_mobile.Log; diff --git a/mobile/app/src/main/res/layout/pref_main.xml b/mobile/app/src/main/res/layout/pref_main.xml index 2fbd4a53a..1fdd72b6d 100644 --- a/mobile/app/src/main/res/layout/pref_main.xml +++ b/mobile/app/src/main/res/layout/pref_main.xml @@ -1,8 +1,7 @@ + android:layout_width="match_parent" + android:layout_height="match_parent"> - + \ No newline at end of file