foobnix / LibreraReader

Book Reader for Android
http://librera.mobi
Other
3.08k stars 313 forks source link

FDroid release #110

Open sdfg2 opened 6 years ago

sdfg2 commented 6 years ago

Are you planning an fdroid release?

foobnix commented 6 years ago

Yes, but have not time to study how to do that. In any case you can download apk directly from beta.librera.mobi or archive.librera.mobi

sdfg2 commented 6 years ago

Yeah that's what I'm doing just now, I was just wondering about the future for updating and things.

Thanks for the quick response, I'm glad things are going well for you with this :-)

IzzySoft commented 5 years ago

F-Droid maintainer here. Unfortunately, we've run into a lot of problems, so we currently cannot build this app:

(see here for details)

Both violates our inclusion citeria. Is there a chance to solve that, @foobnix?

foobnix commented 5 years ago

Both violates our inclusion citeria. Is there a chance to solve that, @foobnix?

Sorry but my app can't work without those jars and google play libraries.

IzzySoft commented 5 years ago

Thanks for your answer, though it is not what we had hoped for. I'll then have to close the RFP at F-Droid, as we cannot build this app in this situation.

By the way, there probably would be a way around those JARs: most of them seem to come from free software projects, so those could possibly be included as git submodules. But no such thing for the Google Play stuff. Just wondering why an eBook reader should depend on such? What is it you need from GMS that is essential? Seeing the my-google-play-services-fake directory, would such a substitute (provided e.g. via a separate build flavor) really cut off too much functionality?

foobnix commented 5 years ago

Google Play stuff. Just wondering why an eBook reader should depend on such?

Yes, my app used a lot third party components, like Recycle View or Card View All of the Google stuff you can see in this file https://github.com/foobnix/LibreraReader/blob/master/update_all.sh

Seeing the my-google-play-services-fake directory, would such a substitute (provided e.g. via a separate build flavor) really cut off too much functionality?

Yes, this flow for PRO version without Ads (cut the ads functionality :)

You can build an app without google play ads using this dependency project.

If you are ok with all of this dependencies, I can help you write the build script that can in one click download and prepare apk for PRO version or you can take it here https://github.com/foobnix/LibreraReader/releases

Ivan

IzzySoft commented 5 years ago

Thanks, @foobnix! I've asked our "integrators" to check. To me this looks as if it could work – but never having built a single app, I cannot tell for sure.

foobnix commented 5 years ago

PRO version is without play-services, I don't see other violations

IzzySoft commented 5 years ago

Neither do I (if it is OK for you that we have it in F-Droid). Just thinking about "too complex builds" concerning those libraries, but as a non-dev I hardly can tell. @rudloff could throw in his opinion, that would be more important than mine here.

Rudloff commented 5 years ago

Even if we can build a version without Play services, there is still the problem of the multiple prebuilt JARs. We need to either:

foobnix commented 5 years ago

I will prepare build script that also fetch libraries from maven.

IzzySoft commented 5 years ago

Cool, thanks! Best would AFAIK be Maven Central or JCenter. Note that not all maven repos are "trusted" by F-Droid. There's a list somewhere in the code of fdroidserver… Ah, here it is:

    allowed_repos = [re.compile(r'^https?://' + re.escape(repo) + r'/*') for repo in [
        'repo1.maven.org/maven2',  # mavenCentral()
        'jcenter.bintray.com',     # jcenter()
        'jitpack.io',
        'www.jitpack.io',
        'repo.maven.apache.org/maven2',
        'oss.jfrog.org/artifactory/oss-snapshot-local',
        'oss.sonatype.org/content/repositories/snapshots',
        'oss.sonatype.org/content/repositories/releases',
        'oss.sonatype.org/content/groups/public',
        'clojars.org/repo',  # Clojure free software libs
        's3.amazonaws.com/repo.commonsware.com',  # CommonsWare
        'plugins.gradle.org/m2',  # Gradle plugin repo
        'maven.google.com',  # Google Maven Repo, https://developer.android.com/studio/build/dependencies.html#google-maven
        ]
    ]

Uh, and forget about the s? in the regex, must be https :wink:

foobnix commented 5 years ago

@Rudloff @IzzySoft Please find build script for fdroid https://github.com/foobnix/LibreraReader/tree/master/Builder/fdroid it will build APK to the folder fdroid/release

foobnix commented 5 years ago

I have also added (get jars from maven) https://github.com/foobnix/LibreraReader/blob/master/Builder/update_jars.sh

it looks like repo.spring.io and github.com is missing in your allow jars list

Rudloff commented 5 years ago

It looks like okhttp-digest is also available on jCenter: https://jcenter.bintray.com/com/burgstaller/okhttp-digest/1.18/okhttp-digest-1.18.jar And CloudRail on Maven Central: https://repo1.maven.org/maven2/com/cloudrail/cloudrail-si-android/2.22.4/cloudrail-si-android-2.22.4.aar

foobnix commented 5 years ago

@Rudloff I have fix update_jar.sh script Is it something else I can help with publishing my app on fdroid?

Rudloff commented 5 years ago

Another problem is that the dandar3 repositories you are using contain prebuilt JARs and we don't allow that (we have no way to know if the libraries have been modified). Would it be possible to get them from Google's repository (or build them from source but that might be too much work)?

Overall, I think it would be easier if you were using a package manager like Maven or Gradle.

I also noticed that cloudrail-si-android is not open source, so we can't include it. (But I'm a bit surprised, I thought Maven Central contained open source libraries.)

foobnix commented 5 years ago

@Rudloff @IzzySoft I have migrated the project to AndroidStudio Please find "fdroid" flavor in the gradle build The fdroid is without ads and without Cloudrail Ivan

IzzySoft commented 5 years ago

Thanks @foobnix! But now we have another problem:

    betaImplementation 'com.google.android.gms:play-services-ads:16.0.0'
    libreraImplementation 'com.google.android.gms:play-services-ads:16.0.0'
    pdf_v2Implementation 'com.google.android.gms:play-services-ads:16.0.0'
    ebookaImplementation 'com.google.android.gms:play-services-ads:16.0.0'
    tts_readerImplementation 'com.google.android.gms:play-services-ads:16.0.0'
    pdf_classicImplementation 'com.google.android.gms:play-services-ads:16.0.0'

GMS is proprietary, and not permitted in F-Droid. Could you make a build flavor coming without that? Further I'm not sure about Cloudrail. I vaguely remember issues with that; @Rudloff might be able to tell.

Rudloff commented 5 years ago

@IzzySoft There is a fdroid flavor that does not contain play-services-ads or cloudrail-si-android (somethingImplementation is only triggered when using the something flavor).

IzzySoft commented 5 years ago

@Rudloff I just wondered as the quoted part seems to be in the "general" dependencies block. I assume the "prefix" on the "implementation" keyword (e.g. "betaImplementation" → "beta") then does address the flavor – so only "fdroidImplementation" applies to the fdroid flavor, correct? In that case: 🙊 – and thanks for the hint!

foobnix commented 5 years ago

@Rudloff @IzzySoft Is it something else you need from my side to publish the app?

foobnix commented 5 years ago

@Rudloff @IzzySoft I have updated readme how to build mudpf

/Builder/link_to_mupdf_1.11.sh (Change the paths to mupdf and jniLibs) ./gradlew assebleFdroidRelease

IzzySoft commented 5 years ago

Thanks @foobnix! For build relevant things, I can't answer – Pierre must say.

Rudloff commented 5 years ago

I tried building 01d24f80029cb31c4d43a8ac175ffbb718d83cad and using Gradle definitely makes it easier for us, thanks!

However, I have another problem. We remove binary files before build and link_to_mupdf_1.11.sh seems to fail because we removed Builder/jni-1.11/simd/i386/lib/jsimd_i386.a:

DEBUG: buildserver > Android NDK: ERROR:jni/simd/Android.mk:simd_i386: LOCAL_SRC_FILES points to a missing file
DEBUG: buildserver > Android NDK: Check that jni/simd/i386/lib/jsimd_i386.a exists  or that its path is correct

I see the cource for this library is in the repository, but I'm not sure how to build it.

foobnix commented 5 years ago

@Rudloff please find an updated build (included sources of simd)

Rudloff commented 5 years ago

I tried 9ec9df1e2cb16214ab8d0bcef23ab5990d5a6580 and now the NDK stuff builds correctly, but I get this error:

DEBUG: buildserver > Execution failed for task ':app:processFdroidReleaseManifest'.
DEBUG: buildserver > > Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 16 declared in library [:pro] /home/vagrant/build/com.foobnix.pro.pdf.reader/pro/build/intermediates/library_manifest/release/AndroidManifest.xml as the library might be using APIs not available in 14
DEBUG: buildserver >    Suggestion: use a compatible library with a minSdk of at most 14,
DEBUG: buildserver >        or increase this project's minSdk version to at least 16,
DEBUG: buildserver >        or use tools:overrideLibrary="com.foobnix.pdf.pro" to force usage (may lead to runtime failures)
foobnix commented 5 years ago

@Rudloff Please try the final commit ( I have added minSdkVersion 16 to fdroid)

Rudloff commented 5 years ago

a1d97d860c8b35174c3e14429ee63f62d39e2e12 now builds correctly, thanks! I think we have everything we need. Feel free to ping me when you tag a new release and we will try to publish it.

foobnix commented 5 years ago

@Rudloff @IzzySoft Please make the first Droid release of Librera PRO 8.0.39 UPD. Is it FDroid support many apk for the different type of CPU (like Google play) or you publish only one apk? (You can make universal apk in this case but with 4x bigger size)

foobnix commented 5 years ago

@Rudloff @IzzySoft Is there any news about Librera release on F-Droid?

Rudloff commented 5 years ago

The merge request is still waiting for someone to review it: https://gitlab.com/fdroid/fdroiddata/merge_requests/4560

IzzySoft commented 5 years ago

Someone with build experience at that, which is why I am out.

esmoak commented 5 years ago

Looks like you guys made this happen. I knew I would see @IzzySoft at the forefront helping this along. Another great app in the F-Droid repo. Thanks, everyone and @foobnix

foobnix commented 5 years ago

@IzzySoft @esmoak Thanks for the help and for the first F-Droid release. It would be good if the F-Droid can divide apks by CPU architecture to reduce apk size in 4 times

I am working on a new update and will give more info to you soon.

IzzySoft commented 5 years ago

Yes, that would be great – but I don't know if the build process supports that (not my area of proficience: I have no build experience and thus rather focus on the metadata). Can't hurt to ask, though (just not me :laughing: – @Rudloff might know).

Rudloff commented 5 years ago

We can build a separate APK for each architecture but they will need to have different version codes (and we probably need to add a separate Builds: entry for each APK).

foobnix commented 5 years ago

@Rudloff @IzzySoft Please update Librera PRO 8.1.179

You should remove google services from the file 1) LibreraReader/build.gradle //F-DROID REMOVE THIS LINE classpath 'com.google.gms:google-services:4.2.0'

and from 2) LibreraReader/app/build.gradle

//F-DROID REMOVE THIS LINES BEGIN implementation 'com.google.android.gms:play-services-auth:16.0.1'

implementation 'com.google.http-client:google-http-client-gson:1.28.0'
implementation('com.google.api-client:google-api-client-android:1.28.0') {
    exclude group: 'org.apache.httpcomponents'
}
implementation('com.google.apis:google-api-services-drive:v3-rev156-1.25.0') {
    exclude group: 'org.apache.httpcomponents'
}
//F-DROID REMOVE THIS LINES END

and

//F-DROID REMOVE THIS LINE apply plugin: 'com.google.gms.google-services'

IzzySoft commented 5 years ago

I can't (no build experience at all), so waiting for Pierre.

foobnix commented 5 years ago

@Rudloff @IzzySoft Hi, why don't you update Librera build on F-Droid? Now you can make a build with new Mupdf 1.16.1 Ivan

IzzySoft commented 5 years ago

@foobnix Please see the comment exactly before your last: no use in pinging me for this, I cannot do a thing about it. Currently, auto-update is NOT enabled, and cannot be, because. Our update checker cannot work with variables or function calls, it just performs RegEx matching (and thus needs static values for versionName and versionCode).

Until that is solved, you'd need to open an MR for each new release – or an issue asking someone else to do that (I just checked, and see neither open for Librera – so that answers the question why there are no updates built). Both of course will always cause delays, so the best approach would be getting auto-update-check working.

Further technical questions are better directed at one of our packagers, I cannot answer them for the reason mentioned above, sorry.

foobnix commented 5 years ago

@IzzySoft Thank you for information, I have changed the Gradle build file for automatic updates. Now you don't need to apply any Regexp, remove lines etc.

F-Droid release with static variables and universal apk

but change to use Mupdf 1.16.1 (not 1.11)

all-fdroid.sh

./link_to_mupdf_1.16.1.sh
./gradlew clean assembleFdroidRelease
IzzySoft commented 5 years ago

Again, not me (I'm no packager). And unless I'm looking at the wrong branch, build.gradle still uses variables for versionName and versionCode – so we still cannot enable automated update checks.

foobnix commented 5 years ago

@IzzySoft @Rudloff Please see in the build file in the header for fdroid is static variables else{ codeNumber = 3200 versionNumber = "8.1.269" db = 8 }

Rudloff commented 5 years ago

I confirm auto update does not work for this app. It gets the wrong version:

DEBUG: Check tag: '8.1.269'
DEBUG: Directory: build/com.foobnix.pro.pdf.reader
DEBUG: > git rev-parse --show-toplevel
DEBUG: Directory: build/com.foobnix.pro.pdf.reader
DEBUG: > git submodule foreach --recursive git reset --hard
DEBUG: Directory: build/com.foobnix.pro.pdf.reader
DEBUG: > git submodule foreach --recursive git clean -dffx
DEBUG: Directory: build/com.foobnix.pro.pdf.reader
DEBUG: > git checkout -f 8.1.269
DEBUG: Directory: build/com.foobnix.pro.pdf.reader
DEBUG: > git clean -dffx
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/build.gradle'
DEBUG: ..got package=None, version=None, vercode=None
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/pro/src/main/AndroidManifest.xml'
DEBUG: ..got package=None, version=None, vercode=None
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/pro/build.gradle'
DEBUG: ..got package=None, version=1.0, vercode=1
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/pro/src/main/AndroidManifest.xml'
DEBUG: ..got package=None, version=None, vercode=None
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/app/src/main/AndroidManifest.xml'
DEBUG: ..got package=None, version=7.12.87, vercode=941
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/app/build.gradle'
DEBUG: ..got package=com.foobnix.pro.pdf.reader, version=None, vercode=None
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/app/src/fdroid/AndroidManifest.xml'
DEBUG: ..got package=com.foobnix.pro.pdf.reader, version=None, vercode=None
DEBUG: Adding possible subdir app
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/app/src/main/AndroidManifest.xml'
DEBUG: ..got package=None, version=7.12.87, vercode=941
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/app/build.gradle'
DEBUG: ..got package=com.foobnix.pro.pdf.reader, version=None, vercode=None
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/app/src/fdroid/AndroidManifest.xml'
DEBUG: ..got package=com.foobnix.pro.pdf.reader, version=None, vercode=None
DEBUG: Manifest exists in subdir 'app'. Found version 7.12.87 (941)
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/app/src/main/AndroidManifest.xml'
DEBUG: ..got package=None, version=7.12.87, vercode=941
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/app/src/fdroid/AndroidManifest.xml'
DEBUG: ..got package=None, version=None, vercode=None
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/Builder/build.gradle'
DEBUG: ..got package=None, version=None, vercode=None
DEBUG: Parsing manifest at 'build/com.foobnix.pro.pdf.reader/Builder/libre/bin/AndroidManifest.xml'
DEBUG: ..got package=None, version=None, vercode=None

And I tried to build 8.1.269-fdroid but it failed with the following errors:

> Task :app:compileFdroidReleaseJavaWithJavac
/home/vagrant/build/com.foobnix.pro.pdf.reader/app/src/main/java/com/foobnix/ui2/BooksService.java:38: error: cannot find symbol
import com.google.api.client.googleapis.extensions.android.gms.auth.UserRecoverableAuthIOException;
                                                                   ^
  symbol:   class UserRecoverableAuthIOException
  location: package com.google.api.client.googleapis.extensions.android.gms.auth
/home/vagrant/build/com.foobnix.pro.pdf.reader/app/src/main/java/com/foobnix/pdf/info/AppsConfig.java:10: error: cannot find symbol
import com.google.android.gms.common.ConnectionResult;
                                    ^
  symbol:   class ConnectionResult
  location: package com.google.android.gms.common
/home/vagrant/build/com.foobnix.pro.pdf.reader/app/src/main/java/com/foobnix/pdf/info/AppsConfig.java:11: error: cannot find symbol
import com.google.android.gms.common.GoogleApiAvailability;
                                    ^
  symbol:   class GoogleApiAvailability
  location: package com.google.android.gms.common
/home/vagrant/build/com.foobnix.pro.pdf.reader/app/src/main/java/com/foobnix/ui2/BooksService.java:145: error: cannot find symbol
                    } catch (UserRecoverableAuthIOException e) {
                             ^
  symbol:   class UserRecoverableAuthIOException
  location: class BooksService
/home/vagrant/build/com.foobnix.pro.pdf.reader/app/src/main/java/com/foobnix/pdf/info/AppsConfig.java:49: error: cannot find symbol
        GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
        ^
  symbol:   class GoogleApiAvailability
  location: class AppsConfig
/home/vagrant/build/com.foobnix.pro.pdf.reader/app/src/main/java/com/foobnix/pdf/info/AppsConfig.java:49: error: cannot find symbol
        GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
                                                      ^
  symbol:   variable GoogleApiAvailability
  location: class AppsConfig
/home/vagrant/build/com.foobnix.pro.pdf.reader/app/src/main/java/com/foobnix/pdf/info/AppsConfig.java:51: error: cannot find symbol
        return resultCode == ConnectionResult.SUCCESS;
                             ^
  symbol:   variable ConnectionResult
  location: class AppsConfig
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 errors

Do you know what can cause this?

foobnix commented 5 years ago

Please try on master branch, I will create new tag for fdroid

foobnix commented 5 years ago

@Rudloff Please try with 8.1.275 tag

Rudloff commented 5 years ago

I added a build entry for 8.1.275-fdroid: https://gitlab.com/fdroid/fdroiddata/merge_requests/5444

IzzySoft commented 5 years ago

Thanks @Rudloff! So @foobnix still needs to ping us for each update it seems – or is there a custom check we could establish against that codeNumber and versionNumber?

Rudloff commented 5 years ago

I enabled update checks with the HTTP method: https://gitlab.com/fdroid/fdroiddata/merge_requests/5455