Skip to content

Commit

Permalink
Merge dev into master (#163) for release 4.20.1-beta
Browse files Browse the repository at this point in the history
* Replace acra with Countly (#162)

* fix double credentials collection crash

* replaced acra with countly

* removed overlay settings

was needed for acra

* disable internal countly logging

* split mainactivity for release and debug flavor

Avoid adding countly to the release version

* added search plugin

close #161

* added search plugin for max-rls

* moved html formatting to the start of the parsing

* added bitrise search plugin

* updated dependencies

* Update README.md

* removed unused layout

* added  android:exported="true" to main activity

* fix recursive auth loop

not 100% tested

* moved versions to variables

* added content description to bottom menu

* moved dependencies to own file

* updated target to api 31

* moved navigation back to stable

* Use a state machine for authentication (#165)

* added fsm library

* Added fsm_authentication.drawio

* added credentials check after move from db

* fix dependency name

* added state machine

* added auth machine (WIP)

* updated AuthenticationFragment with the auth machine

* moved constants

* update private token with auth machine

* updated the user fragment with the auth machine

* updated wrong flow result check

* renamed file

* update list fragment with auth machine

* more auth state checks

* added new auth machine to new download fragment

* added extra options for missing countly credentials

useful for developers cloning my repo

* added layout preview

* fixed wrong value check

* updated main activities with auth machine

* formatted code

* fixed wrong package name

* code fixes

* fix wrong value check

* changed protostore dependency

* Updated login flow

* fix crash with logout button

* fixed private token login

* fixed wrong package name

* check and delay operations when starting the app from link/file

* refactored code

* added missing string translations

* fixed linting errors

* removed the credentials table and related files

* code formatting

* removed circleci config files

* updated linter on github actions

* Translated using Weblate (Italian)

Currently translated at 100.0% (300 of 300 strings)

Translation: Unchained for Android/strings
Translate-URL: https://localization.professiona.li/projects/unchained-for-android/strings/it/

* Translated using Weblate (French)

Currently translated at 100.0% (300 of 300 strings)

Translation: Unchained for Android/strings
Translate-URL: https://localization.professiona.li/projects/unchained-for-android/strings/fr/

* Added translation using Weblate (Tagalog)

* Deleted translation using Weblate (Tagalog)

* updated version for  release

* fix lint

* Wrong token is not reset (#167)

* added token functions to parse API errors

* use != null instead of ?.let

* better transition validity check

* added onParseCallFailure function

parses the auth api fail reason

* added missing transition to reset wrong token

* Check for updates on current dependencies (#168)

* added plugin to check for updates

* updated dependencies

* bumped version for release

versionCode was already updated, this just adds the latest login fix

Co-authored-by: LivingWithHippos <[email protected]>
Co-authored-by: alfred ruizol salavedra <[email protected]>
  • Loading branch information
3 people authored Oct 11, 2021
1 parent 3e900c8 commit f36dac2
Show file tree
Hide file tree
Showing 71 changed files with 2,720 additions and 1,119 deletions.
43 changes: 0 additions & 43 deletions .circleci/config.yml

This file was deleted.

24 changes: 19 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,33 @@ defaults:
# github does not appreciate ~ as home indicator. Prefer the full path.
working-directory: /home/runner/work/unchained-android/unchained-android/app
jobs:
test:
name: Run Tests
lint-debug:
name: Run Debug Linter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run tests
run: ./gradlew lint test
- name: Save test reports
run: ./gradlew lintDebug
- name: Save lint reports
uses: actions/upload-artifact@v2
# artifacts are zipped together in the end
with:
name: test-report
name: lint-debug-report
path: /home/runner/work/unchained-android/unchained-android/app/app/build/reports/
lint-release:
name: Run Release Linter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run tests
run: ./gradlew lintRelease
- name: Save lint reports
uses: actions/upload-artifact@v2
# artifacts are zipped together in the end
with:
name: lint-release-report
path: /home/runner/work/unchained-android/unchained-android/app/app/build/reports/
build:
runs-on: ubuntu-latest
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Unchained for Android

[![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Kotlin Version](https://img.shields.io/badge/kotlin-1.5.10-blue)](http://kotlinlang.org/) [![Android Studio](https://img.shields.io/badge/Android%20Studio-4.1%2B-brightgreen)](https://developer.android.com/studio) [![API](https://img.shields.io/badge/API-22%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=22) [![Build Status](https://img.shields.io/github/workflow/status/LivingWithHippos/unchained-android/Build)](https://github.com/LivingWithHippos/unchained-android/actions) [![Play Store](https://img.shields.io/badge/play%20store-available-brightgreen)](https://play.google.com/store/apps/details?id=com.github.livingwithhippos.unchained) [![translated](https://localization.professiona.li/widgets/unchained-for-android/-/strings/svg-badge.svg)](https://localization.professiona.li/engage/unchained-for-android/)
[![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Kotlin Version](https://img.shields.io/badge/kotlin-1.5.30-blue)](http://kotlinlang.org/) [![API](https://img.shields.io/badge/API-22%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=22) [![Build Status](https://img.shields.io/github/workflow/status/LivingWithHippos/unchained-android/Build)](https://github.com/LivingWithHippos/unchained-android/actions) [![Play Store](https://img.shields.io/badge/play%20store-available-brightgreen)](https://play.google.com/store/apps/details?id=com.github.livingwithhippos.unchained) [![translated](https://localization.professiona.li/widgets/unchained-for-android/-/strings/svg-badge.svg)](https://localization.professiona.li/engage/unchained-for-android/)



Expand All @@ -15,17 +15,15 @@ App to interact with [Real Debrid](https://real-debrid.com/) APIs.
Real Debrid is a service to download files from hosting websites and the torrent network.
Files are downloaded directly on their servers that you can then use for your downloads.
They provide high speeds without premium accounts for a lot of services like Mega and RapidGator
and can also convert downloads of media files into streams. It offers a cheap premium service.
and can also stream media files directly. It offers a cheap premium service.

### Features :memo:

You can take a look at the project [here](https://github.com/LivingWithHippos/unchained-android/projects/1) for general status.

- [x] login with a temporary open-source token (it has some API limitations)
- [x] login with permanent [private API key](https://real-debrid.com/apitoken) (recommended)
- [x] user info
- [x] themes support
- [x] unrestrict links
- [x] hoster support
- [x] containers support
- [x] magnets support
- [x] torrent support
Expand Down Expand Up @@ -53,15 +51,18 @@ You have multiple options to install Unchained for Android:

### Developing and Contributing :writing_hand:

At the moment, the app is under heavy development under Android Studio beta. Contributions are welcome.

Contributions are welcome. You can use the [discussion tab](https://github.com/LivingWithHippos/unchained-android/discussions) to ask for help setting up the project.

The dev branch is the one where the developement happens, it gets merged into master when a release is ready.

A debug version is available, it reports automatically any crash information, it can be useful to help me debug errors.

This app is written in Kotlin and uses the following architectures/patterns/libraries:

MVVM architectural pattern, Dagger-Hilt for dependency injection, Data Binding for managing ui-data relations, Navigation, Moshi, Retrofit, OkHTTP, Room, Coroutines, Flow, Livedata, Coil

The app is available in English, Italian and French, you can contribute to those or add a new language [here](https://localization.professiona.li/engage/unchained-for-android/) (much appreciated)
The app is available in English, Italian and French, you can contribute to those or add a new language [here](https://localization.professiona.li/engage/unchained-for-android/) (much appreciated!)

There's a work in progress [wiki page](https://github.com/LivingWithHippos/unchained-android/wiki/Search-Engine) for creating search plugins.

Expand Down
149 changes: 60 additions & 89 deletions app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ apply plugin: 'com.google.protobuf'

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.17.3"
artifact = deps.protobuf.protoc
}

generateProtoTasks {
Expand Down Expand Up @@ -35,15 +35,15 @@ if (apiPropertiesFile.exists()) {

android {

compileSdkVersion 30
compileSdkVersion 31
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "com.github.livingwithhippos.unchained"
minSdkVersion 22
targetSdkVersion 30
versionCode 25
versionName "4.18.4-beta"
targetSdkVersion 31
versionCode 26
versionName "4.20.1-beta"
// limit resources for a list of locales
// resConfigs "en", "it"

Expand Down Expand Up @@ -106,21 +106,22 @@ android {
signingConfig signingConfigs.debug

if (apiPropertiesFile.exists()) {
buildConfigField("String", "ACRA_URL", apiProperties['ACRA_URL'])
buildConfigField("String", "ACRA_LOGIN", apiProperties['ACRA_LOGIN'])
buildConfigField("String", "ACRA_PASSWORD", apiProperties['ACRA_PASSWORD'])
buildConfigField("String", "COUNTLY_APP_KEY", apiProperties['COUNTLY_APP_KEY'])
buildConfigField("String", "COUNTLY_URL", apiProperties['COUNTLY_URL'])
} else {
buildConfigField("String", "ACRA_URL", "\""+System.getenv("ACRA_URL")+"\"")
buildConfigField("String", "ACRA_LOGIN", "\""+System.getenv("ACRA_LOGIN")+"\"")
buildConfigField("String", "ACRA_PASSWORD", "\""+System.getenv("ACRA_PASSWORD")+"\"")
// use a random key and localhost if the env are missing
def countlyKey = System.getenv("COUNTLY_APP_KEY") ?: "pDJz4WrY9XeBotXAaL9MYrraSwZNyDqfAPy8p38c"
def countlyHost = System.getenv("COUNTLY_URL") ?: "http://localhost"
buildConfigField("String", "COUNTLY_APP_KEY", "\""+countlyKey+"\"")
buildConfigField("String", "COUNTLY_URL", "\""+countlyHost+"\"")
}
}

release {

buildConfigField("String", "ACRA_URL", "\"" + "not for production" + "\"")
buildConfigField("String", "ACRA_LOGIN", "\"" + "not for production" + "\"")
buildConfigField("String", "ACRA_PASSWORD", "\"" + "not for production" + "\"")
// with the separated release/debug files this could be unnecessary now
buildConfigField("String", "COUNTLY_APP_KEY", "\"" + "not for production" + "\"")
buildConfigField("String", "COUNTLY_URL", "\"" + "not for production" + "\"")

signingConfig signingConfigs.release

Expand Down Expand Up @@ -179,113 +180,83 @@ clean.mustRunAfter copyPlugins
*/
dependencies {

// def leakcanary_version = '2.4'
def acra_version = "5.8.4"
def androidx_core_version = "1.6.0"
def appcompat_version = "1.3.1"
def coil_version = '1.3.2'
def constraint_layout_version = '2.1.0'
def coroutines_version = "1.5.1"
def datastore_version = "1.0.0"
def flexbox_version = "3.0.0"
def fragment_version = '1.3.6'
def jsoup_version = '1.14.2'
def lifecycle_version = "2.3.1"
def material_version = '1.4.0'
def moshi_version = '1.12.0'
def okhttp_version = '4.9.1'
def paging_version = '3.0.1'
def preferences_version = '1.1.1'
def recyclerview_version = '1.1.0'
def retrofit_version = '2.9.0'
def room_version = "2.3.0"
def swipe_version = "1.1.0"
def timber_version = "5.0.1"

implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.core:core-ktx:$androidx_core_version"
implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "androidx.constraintlayout:constraintlayout:$constraint_layout_version"
implementation "androidx.fragment:fragment-ktx:$fragment_version"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:$swipe_version"
implementation "androidx.preference:preference-ktx:$preferences_version"
implementation "androidx.recyclerview:recyclerview-selection:$recyclerview_version"
implementation deps.kotlin.stdlib
implementation deps.kotlin.reflect
implementation deps.core_ktx
implementation deps.app_compat
implementation deps.constraint_layout
implementation deps.fragment.runtime_ktx
implementation deps.swiperefreshlayout
implementation deps.preference_ktx
implementation deps.recyclerview.recyclerview
implementation deps.recyclerview.selection

// datastore
implementation "androidx.datastore:datastore-preferences:$datastore_version"
implementation "com.google.protobuf:protobuf-javalite:3.17.3"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
// implementation deps.datastore.preferences
implementation deps.datastore.datastore
implementation deps.protobuf.javalite

implementation "com.google.android.flexbox:flexbox:$flexbox_version"
implementation deps.flexbox

// moshi
implementation "com.squareup.moshi:moshi-kotlin:$moshi_version"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
implementation deps.moshi.runtime
kapt deps.moshi.kapt

// retrofit
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version"
implementation deps.retrofit.runtime
implementation deps.retrofit.moshi

//okhttp
implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"
implementation "com.squareup.okhttp3:okhttp-dnsoverhttps:$okhttp_version"
implementation deps.okhttp.runtime
implementation deps.okhttp.logging_interceptor
implementation deps.okhttp.doh

// navigation
implementation "androidx.navigation:navigation-fragment-ktx:$rootProject.nav_version"
implementation "androidx.navigation:navigation-runtime-ktx:$rootProject.nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$rootProject.nav_version"
implementation deps.navigation.runtime_ktx
implementation deps.navigation.fragment_ktx
implementation deps.navigation.ui_ktx

// room
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"
implementation deps.room.runtime
implementation deps.room.ktx
kapt deps.room.compiler

//coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation deps.coroutines.android
implementation deps.coroutines.core

// material design
implementation "com.google.android.material:material:$material_version"
implementation deps.material

// Lifecycle stuff
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-service:$lifecycle_version"

// Annotation processor
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
implementation deps.lifecycle.viewmodel_ktx
implementation deps.lifecycle.viewmodel_savedstate
implementation deps.lifecycle.livedata_ktx
implementation deps.lifecycle.service
implementation deps.lifecycle.java8

// coil
implementation "io.coil-kt:coil:$coil_version"
implementation deps.coil

//hilt
implementation "com.google.dagger:hilt-android:$rootProject.hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$rootProject.hilt_version"
implementation deps.dagger.hilt_android
kapt deps.dagger.hilt_compiler

// paging
implementation "androidx.paging:paging-runtime-ktx:$paging_version"
implementation deps.paging_runtime

// arrow
// implementation "io.arrow-kt:arrow-core:$arrow_version"
// kapt "io.arrow-kt:arrow-meta:$arrow_version"
// state-machine
implementation deps.statemachine

// timber
implementation "com.jakewharton.timber:timber:$timber_version"
implementation deps.timber

//jsoup
implementation "org.jsoup:jsoup:$jsoup_version"

// leak canary
// debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanary_version"
implementation deps.jsoup

// acra
debugImplementation "ch.acra:acra-http:$acra_version"
debugImplementation "ch.acra:acra-toast:$acra_version"
// countly
debugImplementation deps.countly
}

kapt {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"formatVersion": 1,
"database": {
"version": 4,
"identityHash": "40132ab5533d389dc1aa44b798dec21e",
"entities": [
{
"tableName": "host_regex",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`regex` TEXT NOT NULL, `type` INTEGER NOT NULL, PRIMARY KEY(`regex`))",
"fields": [
{
"fieldPath": "regex",
"columnName": "regex",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"regex"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '40132ab5533d389dc1aa44b798dec21e')"
]
}
}
Loading

0 comments on commit f36dac2

Please sign in to comment.