Skip to content

Commit

Permalink
Update for Trilium Next
Browse files Browse the repository at this point in the history
  • Loading branch information
FliegendeWurst committed Dec 4, 2024
1 parent 42aa9a8 commit 7f24d2f
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 25 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.idea
*.iml
.gradle
/local.properties
Expand All @@ -14,3 +15,5 @@
.cxx
local.properties
/gradle/wrapper/gradle-wrapper.jar
/app/release
/signing_key.jks
24 changes: 12 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ plugins {
}

android {
compileSdkVersion 34
buildToolsVersion "34.0.0"

defaultConfig {
applicationId "kellerar.triliumdroid"
minSdkVersion 26
targetSdkVersion 34
compileSdk 35
targetSdkVersion 35
versionCode 1
versionName "0.59.4"

Expand All @@ -28,6 +26,9 @@ android {

buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"
}
debug {
applicationIdSuffix ".debug"
}
}
buildFeatures {
viewBinding true
Expand All @@ -44,18 +45,17 @@ android {
}

dependencies {
implementation 'androidx.core:core-ktx:1.10.1'
def nav_version = "2.7.1"
def nav_version = "2.8.4"

implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.20"
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib:2.0.20"
implementation 'androidx.core:core-ktx:1.15.0'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
implementation "androidx.fragment:fragment-ktx:1.6.1"
implementation 'com.google.android.material:material:1.9.0'
implementation "androidx.fragment:fragment-ktx:1.8.5"
implementation 'com.google.android.material:material:1.12.0'
implementation "androidx.preference:preference-ktx:1.2.1"
implementation "com.squareup.okhttp3:okhttp:4.10.0"
implementation "com.squareup.okhttp3:okhttp:4.12.0"

implementation "org.wordpress:aztec:v1.7.0"

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<provider
android:name=".TriliumFileProvider"
android:authorities="eu.fliegendewurst.fileprovider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
Expand Down
9 changes: 6 additions & 3 deletions app/src/main/kotlin/eu/fliegendewurst/triliumdroid/Cache.kt
Original file line number Diff line number Diff line change
Expand Up @@ -965,23 +965,26 @@ object Cache {
// TODO: do something here
}

// see https://github.com/TriliumNext/Notes/tree/develop/db
// and https://github.com/TriliumNext/Notes/blob/develop/src/services/app_info.ts
companion object {
const val DATABASE_VERSION_0_59_4 = 213
const val DATABASE_VERSION_0_60_4 = 214
const val DATABASE_VERSION_0_61_5 = 225
const val DATABASE_VERSION_0_62_3 = 227
const val DATABASE_VERSION_0_63_3 = 228
const val DATABASE_VERSION_0_63_3 = 228 // same up to 0.90.12
const val SYNC_VERSION_0_59_4 = 29
const val SYNC_VERSION_0_60_4 = 29
const val SYNC_VERSION_0_62_3 = 31
const val SYNC_VERSION_0_63_3 = 32
const val SYNC_VERSION_0_90_12 = 33

const val DATABASE_VERSION = DATABASE_VERSION_0_63_3
const val DATABASE_NAME = "Document.db"

// sync version is largely irrelevant
const val SYNC_VERSION = SYNC_VERSION_0_63_3
const val APP_VERSION = "0.63.3"
const val SYNC_VERSION = SYNC_VERSION_0_90_12
const val APP_VERSION = "0.90.12"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ class MainActivity : AppCompatActivity() {
f.writeBytes(note.content!!)
val contentUri = FileProvider.getUriForFile(
this@MainActivity,
"eu.fliegendewurst.fileprovider",
applicationContext.packageName + ".provider",
f.toFile()
)
clipData = ClipData.newRawUri("", contentUri)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import androidx.preference.PreferenceManager
import eu.fliegendewurst.triliumdroid.databinding.ActivitySetupBinding

class SetupActivity : AppCompatActivity() {
companion object {
private const val TAG: String = "SetupActivity"
}
private lateinit var binding: ActivitySetupBinding
private lateinit var prefs: SharedPreferences

Expand All @@ -20,7 +23,7 @@ class SetupActivity : AppCompatActivity() {
binding.password.setText(
prefs.getString(
"password",
"UNGHXdk0Ln22nDeIy98k4pDES9FBbrry8POEMMrkx4ovZLNyFGEDxCCE0yOHwP52riSTwCP5vhU7DbOkpdUOpelQJlJVwvA1u0k63pybca1yWBQFAFqEJ1NVT8iGDrIIdRmuVsod5v7gFQGRZCnxrtle3FHDUywufUNSROxrZfeT3gzqszsmn1yHFAJh6xqqSSKT6Ako9SqeDXmRIs8rfV8NmYom5Rur3TY4IlHxE2dKmldU9V7ii8vR9mNLHX4H"
""
)
)
}
Expand Down Expand Up @@ -52,7 +55,8 @@ class SetupActivity : AppCompatActivity() {
handler.post {
finish()
}
}, {
}, { error ->
Log.e(TAG, "failed to connect to server", error)
// TODO
})
}
Expand Down
6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.2'
classpath 'com.android.tools.build:gradle:8.7.3'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -19,8 +19,4 @@ allprojects {
mavenCentral()
maven { url "https://a8c-libs.s3.amazonaws.com/android" }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 7f24d2f

Please sign in to comment.