Compare commits
9 Commits
e9e8bee6c9
...
v122092572
Author | SHA1 | Date | |
---|---|---|---|
f4db02521d | |||
01763556b1 | |||
e2411c00d8 | |||
0473a5f7bc | |||
d0d6a4378c | |||
1dfa3c9f07 | |||
815f00e764 | |||
bdc77ab8ef | |||
6bd06cb458 |
104
.drone.yml
104
.drone.yml
@ -1,21 +1,117 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: android
|
name: test
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: code-analysis
|
- name: AnylyseBuildTest
|
||||||
image: mingc/android-build-box:latest
|
image: mingc/android-build-box:latest
|
||||||
failure: ignore
|
failure: ignore
|
||||||
commands:
|
commands:
|
||||||
- ls -la
|
- echo "---------------------------------------------------------"
|
||||||
|
- echo "Analysing..."
|
||||||
- ./gradlew sonarqube -Dsonar.projectKey=RFS2 -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN -PignoreGitVersion=true -P appLoginUrl="\"URL\"" -P appLoginUsername="\"LOGIN\"" -P appLoginPassword="\"PASS\""
|
- ./gradlew sonarqube -Dsonar.projectKey=RFS2 -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN -PignoreGitVersion=true -P appLoginUrl="\"URL\"" -P appLoginUsername="\"LOGIN\"" -P appLoginPassword="\"PASS\""
|
||||||
|
- echo "---------------------------------------------------------"
|
||||||
|
- echo "Building..."
|
||||||
|
- ./gradlew :androidApp:build -PignoreGitVersion=true -P appLoginUrl="\"URL\"" -P appLoginUsername="\"LOGIN\"" -P appLoginPassword="\"PASS\"" -P pushCache=false
|
||||||
|
- echo "---------------------------------------------------------"
|
||||||
|
- echo "Testing..."
|
||||||
|
- echo "---------------------------------------------------------"
|
||||||
environment:
|
environment:
|
||||||
SONAR_HOST_URL:
|
SONAR_HOST_URL:
|
||||||
from_secret: sonarScannerHostUrl
|
from_secret: sonarScannerHostUrl
|
||||||
SONAR_LOGIN:
|
SONAR_LOGIN:
|
||||||
from_secret: sonarScannerLogin
|
from_secret: sonarScannerLogin
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: Publish
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: createTag
|
||||||
|
image: ubuntu:latest
|
||||||
|
commands:
|
||||||
|
- apt-get update && apt-get install -y git
|
||||||
|
- ./build.sh --publish --from-ci
|
||||||
|
- git remote add pushing https://$GITEA_USR:$GITEA_PASS@gitea.amine-louveau.fr/Louvorg/ReaderForSelfoss-multiplatform.git
|
||||||
|
- git push pushing --tags
|
||||||
|
environment:
|
||||||
|
GITEA_USR:
|
||||||
|
from_secret: giteaUsr
|
||||||
|
GITEA_PASS:
|
||||||
|
from_secret: giteaPass
|
||||||
|
|
||||||
|
- name: scpFiles
|
||||||
|
image: appleboy/drone-scp
|
||||||
|
settings:
|
||||||
|
host: amine-louveau.fr
|
||||||
|
username: ubuntu
|
||||||
|
key:
|
||||||
|
from_secret: privateKey
|
||||||
|
port: 22
|
||||||
|
target: /home/ubuntu/
|
||||||
|
source: version.txt
|
||||||
|
|
||||||
|
- name: deploy
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
settings:
|
||||||
|
host: amine-louveau.fr
|
||||||
|
user: ubuntu
|
||||||
|
key:
|
||||||
|
from_secret: privateKey
|
||||||
|
command_timeout: 2m
|
||||||
|
script:
|
||||||
|
- cd /home/ubuntu
|
||||||
|
- sudo rm -rf /var/www/amine/version.txt
|
||||||
|
- sudo chown www-data:www-data ./version.txt
|
||||||
|
- sudo mv version.txt /var/www/amine/
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- promote
|
||||||
|
target:
|
||||||
|
- production
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
steps:
|
||||||
- name: build
|
- name: build
|
||||||
image: mingc/android-build-box:latest
|
image: mingc/android-build-box:latest
|
||||||
commands:
|
commands:
|
||||||
- ./gradlew :androidApp:build -PignoreGitVersion=true -P appLoginUrl="\"URL\"" -P appLoginUsername="\"LOGIN\"" -P appLoginPassword="\"PASS\"" -P pushCache=false
|
- echo "Generate APK"
|
||||||
|
- ./gradlew :androidApp:assembleGithubConfigRelease -PignoreGitVersion=true -P appLoginUrl="\"URL\"" -P appLoginUsername="\"LOGIN\"" -P appLoginPassword="\"PASS\"" -P pushCache=false
|
||||||
|
- echo "---------------------------------------------------------"
|
||||||
|
- echo "Get Key"
|
||||||
|
- wget https://amine-louveau.fr/key
|
||||||
|
- echo "---------------------------------------------------------"
|
||||||
|
- echo "Zipalign"
|
||||||
|
- $ANDROID_HOME/build-tools/31.0.0/zipalign -f -v 4 androidApp/build/outputs/apk/githubConfig/release/androidApp-githubConfig-release-unsigned.apk androidApp/build/outputs/apk/githubConfig/release/android-prod-released-ziped.apk
|
||||||
|
- echo "---------------------------------------------------------"
|
||||||
|
- echo "Sign"
|
||||||
|
- $ANDROID_HOME/build-tools/31.0.0/apksigner sign -v --out signed.apk --ks ./key --ks-key-alias $YOUR_KEY_ALIAS --ks-pass pass:$YOUR_KEYSTORE_PASSWORD --v1-signing-enabled true --v2-signing-enabled true androidApp/build/outputs/apk/githubConfig/release/android-prod-released-ziped.apk
|
||||||
|
- echo "---------------------------------------------------------"
|
||||||
|
- echo "Verify"
|
||||||
|
- $ANDROID_HOME/build-tools/31.0.0/apksigner verify signed.apk
|
||||||
|
environment:
|
||||||
|
YOUR_KEYSTORE_PASSWORD:
|
||||||
|
from_secret: keyPass
|
||||||
|
YOUR_KEY_ALIAS:
|
||||||
|
from_secret: keyAlias
|
||||||
|
|
||||||
|
- name: gitea_release
|
||||||
|
image: plugins/gitea-release
|
||||||
|
settings:
|
||||||
|
api_key:
|
||||||
|
from_secret: giteaAPI
|
||||||
|
base_url: https://gitea.amine-louveau.fr
|
||||||
|
files: signed.apk
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- tag
|
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,3 +1,14 @@
|
|||||||
|
# V2/Multiplatform rewrite
|
||||||
|
|
||||||
|
**v1**
|
||||||
|
|
||||||
|
- The app has the same functionalities as before.
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Old version changes
|
||||||
|
|
||||||
**1.7.x**
|
**1.7.x**
|
||||||
|
|
||||||
- Hiding tags with 0 articles
|
- Hiding tags with 0 articles
|
||||||
|
@ -93,7 +93,7 @@ android {
|
|||||||
}
|
}
|
||||||
flavorDimensions.add("build")
|
flavorDimensions.add("build")
|
||||||
productFlavors {
|
productFlavors {
|
||||||
create("github") {
|
create("githubConfig") {
|
||||||
versionNameSuffix = "-github"
|
versionNameSuffix = "-github"
|
||||||
dimension = "build"
|
dimension = "build"
|
||||||
}
|
}
|
||||||
|
31
androidApp/proguard-rules.pro
vendored
31
androidApp/proguard-rules.pro
vendored
@ -55,11 +55,38 @@
|
|||||||
public *;
|
public *;
|
||||||
}
|
}
|
||||||
|
|
||||||
-dontwarn com.anupcowkur.reservoir.**
|
|
||||||
|
|
||||||
-dontwarn javax.annotation.**
|
-dontwarn javax.annotation.**
|
||||||
|
|
||||||
-keep class android.support.v7.widget.SearchView { *; }
|
-keep class android.support.v7.widget.SearchView { *; }
|
||||||
|
|
||||||
# maybe remove later ?
|
# maybe remove later ?
|
||||||
-keep class * extends androidx.fragment.app.Fragment
|
-keep class * extends androidx.fragment.app.Fragment
|
||||||
|
|
||||||
|
|
||||||
|
# Keep `Companion` object fields of serializable classes.
|
||||||
|
# This avoids serializer lookup through `getDeclaredClasses` as done for named companion objects.
|
||||||
|
-if @kotlinx.serialization.Serializable class **
|
||||||
|
-keepclassmembers class <1> {
|
||||||
|
static <1>$Companion Companion;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Keep `serializer()` on companion objects (both default and named) of serializable classes.
|
||||||
|
-if @kotlinx.serialization.Serializable class ** {
|
||||||
|
static **$* *;
|
||||||
|
}
|
||||||
|
-keepclassmembers class <2>$<3> {
|
||||||
|
kotlinx.serialization.KSerializer serializer(...);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Keep `INSTANCE.serializer()` of serializable objects.
|
||||||
|
-if @kotlinx.serialization.Serializable class ** {
|
||||||
|
public static ** INSTANCE;
|
||||||
|
}
|
||||||
|
-keepclassmembers class <1> {
|
||||||
|
public static <1> INSTANCE;
|
||||||
|
kotlinx.serialization.KSerializer serializer(...);
|
||||||
|
}
|
||||||
|
|
||||||
|
# @Serializable and @Polymorphic are used at runtime for polymorphic serialization.
|
||||||
|
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault
|
||||||
|
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# NOTE: This is copy/pasted in jenkins
|
|
||||||
|
|
||||||
rm -f version.txt
|
|
||||||
printf "versionName=$1-github\nversionCode=$1" >> version.txt
|
|
||||||
|
|
||||||
# You'll need to change server as your server and define a VERSION_PATH.
|
|
||||||
scp version.txt server:$VERSION_PATH
|
|
||||||
|
|
||||||
rm version.txt
|
|
@ -11,6 +11,7 @@ import android.view.MenuItem
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.appcompat.app.ActionBarDrawerToggle
|
import androidx.appcompat.app.ActionBarDrawerToggle
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
@ -62,12 +63,10 @@ import org.kodein.di.DIAware
|
|||||||
import org.kodein.di.android.closestDI
|
import org.kodein.di.android.closestDI
|
||||||
import org.kodein.di.instance
|
import org.kodein.di.instance
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import kotlin.concurrent.thread
|
|
||||||
|
|
||||||
|
|
||||||
class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAware {
|
class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAware {
|
||||||
|
|
||||||
private val SETTINGS_ACTIVITY: Int = 101111
|
|
||||||
private val DRAWER_ID_TAGS = 100101L
|
private val DRAWER_ID_TAGS = 100101L
|
||||||
private val DRAWER_ID_HIDDEN_TAGS = 101100L
|
private val DRAWER_ID_HIDDEN_TAGS = 101100L
|
||||||
private val DRAWER_ID_SOURCES = 100110L
|
private val DRAWER_ID_SOURCES = 100110L
|
||||||
@ -94,6 +93,10 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar
|
|||||||
|
|
||||||
private lateinit var tagsBadge: Map<Long, Int>
|
private lateinit var tagsBadge: Map<Long, Int>
|
||||||
|
|
||||||
|
private val settingsLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
|
||||||
|
appSettingsService.refreshUserSettings()
|
||||||
|
}
|
||||||
|
|
||||||
override val di by closestDI()
|
override val di by closestDI()
|
||||||
private val repository : Repository by instance()
|
private val repository : Repository by instance()
|
||||||
private val appSettingsService : AppSettingsService by instance()
|
private val appSettingsService : AppSettingsService by instance()
|
||||||
@ -367,7 +370,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar
|
|||||||
false
|
false
|
||||||
}
|
}
|
||||||
addStickyPrimaryItem(R.string.title_activity_settings, R.drawable.ic_settings_black_24dp) { _, _, _ ->
|
addStickyPrimaryItem(R.string.title_activity_settings, R.drawable.ic_settings_black_24dp) { _, _, _ ->
|
||||||
startActivityForResult(Intent(this@HomeActivity, SettingsActivity::class.java), SETTINGS_ACTIVITY)
|
settingsLauncher.launch(Intent(this, SettingsActivity::class.java))
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -946,12 +949,5 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar
|
|||||||
WorkManager.getInstance(baseContext).enqueueUniquePeriodicWork("selfoss-loading", ExistingPeriodicWorkPolicy.KEEP, backgroundWork)
|
WorkManager.getInstance(baseContext).enqueueUniquePeriodicWork("selfoss-loading", ExistingPeriodicWorkPolicy.KEEP, backgroundWork)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
|
||||||
super.onActivityResult(requestCode, resultCode, data)
|
|
||||||
if (requestCode == SETTINGS_ACTIVITY) {
|
|
||||||
appSettingsService.refreshUserSettings()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,11 +69,13 @@ class SettingsActivity : AppCompatActivity(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onSupportNavigateUp(): Boolean {
|
override fun onSupportNavigateUp(): Boolean {
|
||||||
if (supportFragmentManager.popBackStackImmediate()) {
|
return if (supportFragmentManager.popBackStackImmediate()) {
|
||||||
supportActionBar?.title = getText(R.string.title_activity_settings)
|
supportActionBar?.title = getText(R.string.title_activity_settings)
|
||||||
return true
|
false
|
||||||
|
} else {
|
||||||
|
super.onBackPressed()
|
||||||
|
true
|
||||||
}
|
}
|
||||||
return super.onSupportNavigateUp()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPreferenceStartFragment(
|
override fun onPreferenceStartFragment(
|
||||||
@ -216,11 +218,4 @@ class SettingsActivity : AppCompatActivity(),
|
|||||||
setPreferencesFromResource(R.xml.pref_experimental, rootKey)
|
setPreferencesFromResource(R.xml.pref_experimental, rootKey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
|
||||||
when (item.itemId) {
|
|
||||||
android.R.id.home -> super.onBackPressed()
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item)
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,11 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# You can pass --force as first parameter to force push and tag creation.
|
|
||||||
|
|
||||||
echo "Creating tag $@"
|
|
||||||
|
|
||||||
TAG="v$@"
|
|
||||||
git tag ${TAG}
|
|
||||||
|
|
||||||
echo "Pushing tag"
|
|
||||||
|
|
||||||
git push origin ${TAG}
|
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
git fetch --tags -p
|
git fetch --tags -p
|
||||||
|
|
||||||
BASE_VERSION="1.7"
|
BASE_VERSION="1"
|
||||||
LAST_TAG=$(git tag -l | sort -V | tail -1)
|
LAST_TAG=$(git tag -l | sort -V | tail -1)
|
||||||
|
|
||||||
INITIAL_VERSION="${BASE_VERSION//./}$(date '+%y%m%j')"
|
INITIAL_VERSION="${BASE_VERSION//./}$(date '+%y%m%j')"
|
||||||
@ -21,11 +21,11 @@ VERSION="${INITIAL_VERSION}${TODAYS_VERSION}"
|
|||||||
|
|
||||||
PARAMS_EXCEPT_PUBLISH=$(echo $1 | sed 's/\-\-publish//')
|
PARAMS_EXCEPT_PUBLISH=$(echo $1 | sed 's/\-\-publish//')
|
||||||
|
|
||||||
./version.sh ${VERSION} ${PARAMS_EXCEPT_PUBLISH}
|
./version.sh ${VERSION} ${PARAMS_EXCEPT_PUBLISH} $@
|
||||||
|
|
||||||
if [[ "$@" == *'--publish'* ]]
|
if [[ "$@" == *'--publish'* ]]
|
||||||
then
|
then
|
||||||
./publish-version.sh ${VERSION}
|
./publish-version.sh ${VERSION} $@
|
||||||
else
|
else
|
||||||
echo "Did not publish. If you wanted to do so, call the script with \"--publish\" or \"--publish-local\"."
|
echo "Did not publish. If you wanted to do so, call the script with \"--publish\" or \"--publish-local\"."
|
||||||
fi
|
fi
|
@ -1,3 +1 @@
|
|||||||
A new RSS reader for <a href="http://selfoss.aditu.de/">selfoss</a>.
|
A new RSS reader for <a href="http://selfoss.aditu.de/">selfoss</a>.
|
||||||
|
|
||||||
It connects to your selfoss instance (works only with selfoss, and can't work without it), and you'll be able to read and manage all your RSS feeds.
|
|
||||||
|
15
publish-version.sh
Executable file
15
publish-version.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# NOTE: This is copy/pasted in jenkins
|
||||||
|
|
||||||
|
rm -f version.txt
|
||||||
|
printf "versionName=$1-github\nversionCode=$1" >> version.txt
|
||||||
|
|
||||||
|
if [[ "$@" == *'--from-ci'* ]]
|
||||||
|
then
|
||||||
|
echo "File created. HANDLE IN CI"
|
||||||
|
else
|
||||||
|
# You'll need to change server as your server and define a VERSION_PATH.
|
||||||
|
scp version.txt server:$VERSION_PATH
|
||||||
|
rm version.txt
|
||||||
|
fi
|
14
version.sh
Executable file
14
version.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Creating tag $1"
|
||||||
|
|
||||||
|
TAG="v$1"
|
||||||
|
git tag -a ${TAG} -m ${TAG}
|
||||||
|
|
||||||
|
if [[ "$@" == *'--from-ci'* ]]
|
||||||
|
then
|
||||||
|
echo "Tag created. HANDLE IN CI"
|
||||||
|
else
|
||||||
|
echo "Pushing tag"
|
||||||
|
git push origin ${TAG}
|
||||||
|
fi
|
Reference in New Issue
Block a user