update: parse Triple-T v2.x layout

Thanks to the very nice example from Piwigo, included here under the GPLv3+
https://github.com/Piwigo/Piwigo-Android

https://gitlab.com/fdroid/fdroiddata/merge_requests/5579#note_225834868
This commit is contained in:
Hans-Christoph Steiner 2019-10-04 11:06:42 +02:00
parent a7dd7a812f
commit 5904aef5a7
No known key found for this signature in database
GPG Key ID: 3E177817BA1B9BFA
37 changed files with 442 additions and 1 deletions

View File

@ -843,7 +843,11 @@ def copy_triple_t_store_metadata(apps):
logging.debug('Triple-T Gradle Play Publisher: ' + d) logging.debug('Triple-T Gradle Play Publisher: ' + d)
for root, dirs, files in os.walk(d): for root, dirs, files in os.walk(d):
segments = root.split('/') segments = root.split('/')
locale = segments[-2] if segments[-2] == 'listings' or segments[-2] == 'release-notes':
locale = segments[-1]
else:
locale = segments[-2]
for f in files: for f in files:
if f == 'fulldescription' or f == 'full-description.txt': if f == 'fulldescription' or f == 'full-description.txt':
_set_localized_text_entry(app, locale, 'description', _set_localized_text_entry(app, locale, 'description',
@ -865,6 +869,10 @@ def copy_triple_t_store_metadata(apps):
_set_localized_text_entry(app, segments[-1], 'whatsNew', _set_localized_text_entry(app, segments[-1], 'whatsNew',
os.path.join(root, f)) os.path.join(root, f))
continue continue
elif f == 'default.txt' and segments[-2] == 'release-notes':
_set_localized_text_entry(app, locale, 'whatsNew',
os.path.join(root, f))
continue
elif f == 'contactEmail' or f == 'contact-email.txt': elif f == 'contactEmail' or f == 'contact-email.txt':
_set_author_entry(app, 'authorEmail', os.path.join(root, f)) _set_author_entry(app, 'authorEmail', os.path.join(root, f))
continue continue

View File

@ -0,0 +1 @@
/build

View File

@ -0,0 +1,151 @@
plugins {
id("com.android.application")
id("com.github.triplet.play") version "2.0.0"
}
def isCi = "true" == System.getenv("CI")
def preDexEnabled = "true" == System.getProperty("pre-dex", "true")
if (project.file('../PiwigoSigning.properties').exists()) {
Properties props = new Properties()
props.load(new FileInputStream(file('../PiwigoSigning.properties')))
android {
signingConfigs {
release {
storeFile file("../piwigo_android_keystore.jks")
storePassword props['keystore.password']
keyAlias 'publishing'
keyPassword props['key.password']
}
localRelease {
storeFile file("${System.properties['user.home']}${File.separator}/.android_keystore_default")
storePassword props['keystore_default.password']
keyAlias 'defaultRelease'
keyPassword props['key_default.password']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
localRelease {
signingConfig signingConfigs.localRelease
}
}
}
play {
defaultToAppBundles = true
track = 'beta'
}
}
android {
compileSdkVersion 29
defaultConfig {
applicationId "org.piwigo.android"
minSdkVersion 16
targetSdkVersion 29
versionCode 95
versionName "0.9.5-beta"
multiDexEnabled true
}
buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "default"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
disable 'InvalidPackage'
abortOnError false
}
dexOptions {
preDexLibraries = preDexEnabled && !isCi
}
dataBinding {
enabled = true
}
testOptions {
unitTests {
returnDefaultValues = true
includeAndroidResources = true
}
}
/* Triple-T GPP is applied as plugin in all cases, so we need to configure it always */
play {
serviceAccountCredentials = file("../upload_key.json")
}
}
def daggerVersion = '2.23.2'
def okhttpVersion = '3.11.0'
def retrofitVersion = '2.6.1'
def assertjVersion = '1.2.0'
def acraVersion = '5.4.0'
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation "com.google.dagger:dagger:${daggerVersion}"
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.1.0'
annotationProcessor "com.google.dagger:dagger-compiler:${daggerVersion}"
implementation "com.google.dagger:dagger-android:${daggerVersion}"
implementation "com.google.dagger:dagger-android-support:${daggerVersion}"
annotationProcessor "com.google.dagger:dagger-android-processor:${daggerVersion}"
implementation "com.squareup.okhttp3:okhttp:${okhttpVersion}"
implementation "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"
implementation "com.squareup.retrofit2:retrofit:${retrofitVersion}"
implementation "com.squareup.retrofit2:converter-gson:${retrofitVersion}"
implementation "com.squareup.retrofit2:adapter-rxjava:${retrofitVersion}"
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation 'io.reactivex:rxjava:1.3.2'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'com.google.guava:guava:24.1-jre'
annotationProcessor 'com.google.guava:guava:24.1-jre'
implementation 'org.apache.commons:commons-lang3:3.8.1'
implementation "ch.acra:acra-mail:$acraVersion"
implementation "ch.acra:acra-dialog:$acraVersion"
implementation 'com.github.jorgecastilloprz:fabprogresscircle:1.01@aar'
implementation "com.leinardi.android:speed-dial:3.0.0"
implementation 'com.github.tingyik90:snackprogressbar:6.1.1'
implementation 'org.greenrobot:eventbus:3.1.1'
/* Don't forget to add to string libraries if you add a library here. */
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-3'
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:4.3'
testImplementation("com.squareup.assertj:assertj-android:${assertjVersion}") {
exclude group: 'com.android.support'
}
testAnnotationProcessor "com.google.dagger:dagger-compiler:${daggerVersion}"
testImplementation 'androidx.arch.core:core-testing:2.1.0'
testImplementation 'org.mockito:mockito-core:2.19.0'
testImplementation 'com.google.guava:guava:24.1-jre'
testImplementation 'androidx.appcompat:appcompat:1.1.0'
testAnnotationProcessor 'com.google.guava:guava:24.1-jre'
testImplementation 'com.google.code.findbugs:jsr305:3.0.2'
}

View File

@ -0,0 +1,5 @@
<resources>
<string name="account_type" translatable="false">org.piwigo.account_debug</string>
</resources>

View File

@ -0,0 +1,3 @@
<resources>
<string name="app_name" translatable="false">Piwigo Debug</string>
</resources>

View File

@ -0,0 +1,115 @@
/*
* Piwigo for Android
* Copyright (C) 2016-2017 Piwigo Team http://piwigo.org
* Copyright (C) 2018 Raphael Mack http://www.raphael-mack.de
*
* 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 <https://www.gnu.org/licenses/>.
*/
package org.piwigo;
import android.app.Activity;
import android.app.Application;
import android.app.Service;
import android.content.Context;
import androidx.databinding.DataBindingUtil;
import androidx.multidex.MultiDex;
import org.acra.ACRA;
import org.acra.ReportField;
import org.acra.annotation.AcraCore;
import org.acra.annotation.AcraDialog;
import org.acra.annotation.AcraMailSender;
import org.acra.data.StringFormat;
import org.piwigo.helper.DialogHelper;
import org.piwigo.helper.NetworkHelper;
import org.piwigo.helper.NotificationHelper;
import org.piwigo.internal.di.component.ApplicationComponent;
import org.piwigo.internal.di.component.BindingComponent;
import org.piwigo.internal.di.component.DaggerApplicationComponent;
import org.piwigo.internal.di.component.DaggerBindingComponent;
import org.piwigo.internal.di.module.ApplicationModule;
import javax.inject.Inject;
import dagger.android.AndroidInjector;
import dagger.android.DispatchingAndroidInjector;
import dagger.android.HasActivityInjector;
import dagger.android.HasServiceInjector;
@AcraCore(reportContent = { ReportField.APP_VERSION_CODE,
ReportField.APP_VERSION_NAME,
ReportField.USER_COMMENT,
ReportField.SHARED_PREFERENCES,
ReportField.ANDROID_VERSION,
ReportField.CUSTOM_DATA,
ReportField.STACK_TRACE,
ReportField.BUILD,
ReportField.BUILD_CONFIG,
ReportField.CRASH_CONFIGURATION,
ReportField.DISPLAY
},
alsoReportToAndroidFramework = true,
reportFormat = StringFormat.KEY_VALUE_LIST
)
@AcraMailSender(mailTo = "android@piwigo.org")
@AcraDialog(resCommentPrompt = R.string.crash_dialog_comment_prompt,
resText = R.string.crash_dialog_text)
public class PiwigoApplication extends Application implements HasActivityInjector, HasServiceInjector {
@Inject DispatchingAndroidInjector<Activity> dispatchingAndroidInjector;
@Inject DispatchingAndroidInjector<Service> dispatchingAndroidServiceInjector;
private ApplicationComponent applicationComponent;
@Override public void onCreate() {
super.onCreate();
new NetworkHelper();
new NotificationHelper(getApplicationContext());
new DialogHelper()
; initializeDependencyInjection();
}
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(base);
ACRA.init(this);
}
@Override public AndroidInjector<Activity> activityInjector() {
return dispatchingAndroidInjector;
}
private void initializeDependencyInjection() {
applicationComponent = DaggerApplicationComponent.builder()
.applicationModule(new ApplicationModule(this))
.build();
applicationComponent.inject(this);
BindingComponent bindingComponent = DaggerBindingComponent.builder()
.applicationComponent(applicationComponent)
.build();
DataBindingUtil.setDefaultComponent(bindingComponent);
}
/**
* Returns an {@link AndroidInjector} of {@link Service}s.
*/
@Override
public AndroidInjector<Service> serviceInjector() {
return dispatchingAndroidServiceInjector;
}
}

View File

@ -0,0 +1 @@
android@piwigo.org

View File

@ -0,0 +1 @@
https://www.piwigo.org

View File

@ -0,0 +1,5 @@
Piwigo ist eine Android-APP für die freie Open Source-Foto-Hosting-Plattform Piwigo. Mit dieser App können Sie sich selbst gehostete Galerie ansehen und Fotos von Ihrem Smart-Gerät hochladen.
Piwigo wird von einer aktiven Community von Benutzern und Entwicklern bereitgestellt.
Piwigo ermöglicht eine eigene Fotogalerie im Internet zu erstellen und bietet viele leistungsstarke Funktionen wie Alben, Tags, Geolokalisierung, viele Anpassungsstufen, Upload von Besuchern, Privatsphäre, Kalender oder Statistiken.

View File

@ -0,0 +1 @@
Greifen Sie auf die Bilder Ihrer Piwigo-Foto-Gallerie zu.

View File

@ -0,0 +1,5 @@
Piwigo is a native Android Application for the free and open source photo hosting platform Piwigo. With this app you can browse you self-hosted gallery and upload photos from your smart device.
Piwigo is built by an active community of users and developers.
Piwigo empowers you to create your own photo gallery on the web and includes many powerful features such as albums, tags, geolocation, many levels of customization, upload by visitors, privacy, calendar or statistics.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
Access photos in your Piwigo photo gallery.

View File

@ -0,0 +1,5 @@
Piwigo est une application Android native pour la plate-forme d'hébergement photo gratuite et open source Piwigo. Avec cette application, vous pouvez parcourir votre galerie auto-hébergée et télécharger des photos depuis votre smartphone.
Piwigo est développé par une communauté active d'utilisateurs et de développeurs.
Piwigo vous permet de créer votre propre galerie de photos sur le Web et comprend de nombreuses fonctionnalités puissantes telles que des albums, des tags, la géolocalisation, de nombreux niveaux de personnalisation, le téléchargement par les visiteurs, la confidentialité, un calendrier ou de statistiques.

View File

@ -0,0 +1 @@
Accédez aux photos dans votre galerie de photos Piwigo.

View File

@ -0,0 +1,5 @@
Piwigo is a native Android Application for the free and open source photo hosting platform Piwigo. With this app you can browse you self-hosted gallery and upload photos from your smart device.
Piwigo is built by an active community of users and developers.
Piwigo empowers you to create your own photo gallery on the web and includes many powerful features such as albums, tags, geolocation, many levels of customization, upload by visitors, privacy, calendar or statistics.

View File

@ -0,0 +1 @@
Access photos in your Piwigo photo gallery.

View File

@ -0,0 +1,7 @@
Dies ist eine Beta-Version, mit großen Verbesserungen, aber noch nicht für den produktiven Einsatz vorgesehen. Seien Sie vorsichtig und stellen Sie sicher, ein vollständiges Backup zu haben.
In dieser Version haben wir
- die Unterstützung für Android 4.0 und 4.1 entfernt
- neues Design und weitere Sprachen hinzugefügt
- Unterstützung der Erstellung von Alben
- automatische Korrektur der Galerie-Seite hinzugefügt (falls möglich wird automatisch HTTPS verwendet)

View File

@ -0,0 +1,9 @@
This is a beta version, with major improvements but still not intended for production use. Please be careful and ensure you have proper backups of your gallery data.
In this version we
- dropped support for Android 4.0 "Ice Cream Sandwich" and 4.1 "Jelly Bean"
- adjusted the UI to new Piwigo style
- added German, French and initial Kannada translation
- support creation of albums
- added auto detection correction of the gallery site (automatically choosing HTTPS if possible)

View File

@ -0,0 +1,9 @@
This is a beta version, with major improvements but still not intended for production use. Please be careful and ensure you have proper backups of your gallery data.
Dans cette version nous avons :
- dropped support for Android 4.0 "Ice Cream Sandwich" and 4.1 "Jelly Bean"
- adjusted the UI to new Piwigo style
- added German, French and initial Kannada translation
- support creation of albums
- added auto detection correction of the gallery site (automatically choosing HTTPS if possible)

View File

@ -0,0 +1,9 @@
This is a beta version, with major improvements but still not intended for production use. Please be careful and ensure you have proper backups of your gallery data.
In this version we
- dropped support for Android 4.0 "Ice Cream Sandwich" and 4.1 "Jelly Bean"
- adjusted the UI to new Piwigo style
- added German, French and initial Kannada translation
- support creation of albums
- added auto detection correction of the gallery site (automatically choosing HTTPS if possible)

View File

@ -0,0 +1,21 @@
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }
}
}

View File

@ -0,0 +1,2 @@
rootProject.name = 'Piwigo-Android'
include ':app'

View File

@ -0,0 +1,29 @@
Categories:
- Graphics
- Multimedia
License: GPL-3.0-or-later
AuthorName: Piwigo Mobile Apps Team
AuthorEmail: android@piwigo.org
WebSite: https://piwigo.org/
SourceCode: https://github.com/Piwigo/Piwigo-Android
IssueTracker: https://github.com/Piwigo/Piwigo-Android/issues
Translation: https://crowdin.com/project/piwigo-android
AutoName: Piwigo
RepoType: git
Repo: https://github.com/Piwigo/Piwigo-Android
Builds:
- versionName: 0.9.5-beta
versionCode: 95
commit: v0.9.5
subdir: app
gradle:
- yes
AutoUpdateMode: Version v%v
UpdateCheckMode: Tags
UpdateCheckIgnore: (alpha|beta|rc|RC|dev)
CurrentVersion: 0.9.5-beta
CurrentVersionCode: 95

View File

@ -193,6 +193,47 @@ class UpdateTest(unittest.TestCase):
locales = sorted(list(apps['org.fdroid.ci.test.app']['localized'].keys())) locales = sorted(list(apps['org.fdroid.ci.test.app']['localized'].keys()))
self.assertEqual(correctlocales, locales) self.assertEqual(correctlocales, locales)
def test_insert_triple_t_2_metadata(self):
packageName = 'org.piwigo.android'
tmptestsdir = tempfile.mkdtemp(prefix=inspect.currentframe().f_code.co_name,
dir=self.tmpdir)
os.rmdir(tmptestsdir)
shutil.copytree(os.path.join(self.basedir, 'triple-t-2'), tmptestsdir)
os.chdir(tmptestsdir)
config = dict()
fdroidserver.common.fill_config_defaults(config)
config['accepted_formats'] = ('yml')
fdroidserver.common.config = config
fdroidserver.update.config = config
fdroidserver.update.options = fdroidserver.common.options
apps = fdroidserver.metadata.read_metadata(xref=True)
self.assertTrue(packageName in apps)
fdroidserver.update.copy_triple_t_store_metadata(apps)
correctlocales = ['de-DE', 'en-US', 'fr-FR', 'kn-IN']
app = apps[packageName]
self.assertEqual('android@piwigo.org', app['authorEmail'])
self.assertEqual('https://www.piwigo.org', app['authorWebSite'])
locales = sorted(list(app['localized'].keys()))
self.assertEqual(correctlocales, locales)
kn_IN = app['localized']['kn-IN']
self.assertTrue('description' in kn_IN)
self.assertTrue('name' in kn_IN)
self.assertTrue('summary' in kn_IN)
en_US = app['localized']['en-US']
self.assertTrue('whatsNew' in en_US)
os.chdir(os.path.join('repo', packageName))
self.assertTrue(os.path.exists(os.path.join('en-US', 'icon.png')))
self.assertTrue(os.path.exists(os.path.join('en-US', 'featureGraphic.png')))
self.assertTrue(os.path.exists(os.path.join('en-US', 'phoneScreenshots', '01_Login.jpg')))
self.assertTrue(os.path.exists(os.path.join('en-US', 'sevenInchScreenshots', '01_Login.png')))
self.assertFalse(os.path.exists(os.path.join('de-DE', 'icon.png')))
self.assertFalse(os.path.exists(os.path.join('de-DE', 'featureGraphic.png')))
self.assertFalse(os.path.exists(os.path.join('de-DE', 'phoneScreenshots', '01_Login.jpg')))
self.assertFalse(os.path.exists(os.path.join('de-DE', 'sevenInchScreenshots', '01_Login.png')))
def javagetsig(self, apkfile): def javagetsig(self, apkfile):
getsig_dir = 'getsig' getsig_dir = 'getsig'
if not os.path.exists(getsig_dir + "/getsig.class"): if not os.path.exists(getsig_dir + "/getsig.class"):