Compare commits
7 Commits
f870fd1c2a
...
v4.11.81
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
044631b05d | ||
| 4bc5b4d790 | |||
| da52ec84b7 | |||
|
|
f758796d83 | ||
| 77d4071728 | |||
| ca855a6945 | |||
|
|
a56662ab69 |
@@ -23,6 +23,11 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
applicationVariants.all { variant ->
|
||||||
|
variant.outputs.all { output ->
|
||||||
|
outputFileName = "Paarrot-${variant.versionName}.apk"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -143,10 +143,11 @@ class MatrixSyncService : Service() {
|
|||||||
val nm = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
val nm = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||||
ensureMessageChannel(nm)
|
ensureMessageChannel(nm)
|
||||||
|
|
||||||
joinedRooms.keys().forEach { roomId ->
|
val roomIds = joinedRooms.keys().asSequence().toList()
|
||||||
|
for (roomId in roomIds) {
|
||||||
val timeline = joinedRooms.optJSONObject(roomId)
|
val timeline = joinedRooms.optJSONObject(roomId)
|
||||||
?.optJSONObject("timeline") ?: return@forEach
|
?.optJSONObject("timeline") ?: continue
|
||||||
val events = timeline.optJSONArray("events") ?: return@forEach
|
val events = timeline.optJSONArray("events") ?: continue
|
||||||
|
|
||||||
for (i in 0 until events.length()) {
|
for (i in 0 until events.length()) {
|
||||||
val event = events.optJSONObject(i) ?: continue
|
val event = events.optJSONObject(i) ?: continue
|
||||||
@@ -157,7 +158,7 @@ class MatrixSyncService : Service() {
|
|||||||
if (eventId.isNotBlank() && !shownEventIds.add(eventId)) continue
|
if (eventId.isNotBlank() && !shownEventIds.add(eventId)) continue
|
||||||
|
|
||||||
val content = event.optJSONObject("content") ?: continue
|
val content = event.optJSONObject("content") ?: continue
|
||||||
val body = content.optString("body").ifBlank { continue }
|
val body = content.optString("body").takeIf { it.isNotBlank() } ?: continue
|
||||||
val sender = event.optString("sender")
|
val sender = event.optString("sender")
|
||||||
val senderName = sender.substringAfter("@").substringBefore(":")
|
val senderName = sender.substringAfter("@").substringBefore(":")
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "paarrot",
|
"name": "paarrot",
|
||||||
"version": "4.11.78",
|
"version": "4.11.81",
|
||||||
"description": "Paarrot - A Matrix client based on Cinny",
|
"description": "Paarrot - A Matrix client based on Cinny",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0"
|
"node": ">=18.0.0"
|
||||||
|
|||||||
@@ -120,7 +120,23 @@ if (!existsSync(androidJunction)) {
|
|||||||
console.log(` android/ link already exists, skipping`);
|
console.log(` android/ link already exists, skipping`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7. Write android/local.properties with the current machine's Android SDK path
|
// 8. Sync version from root package.json into android/app/build.gradle
|
||||||
|
console.log('[apply-overlay] Syncing version into build.gradle...');
|
||||||
|
const rootPkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8'));
|
||||||
|
const version = rootPkg.version ?? '1.0.0';
|
||||||
|
const parts = version.split('.').map(Number);
|
||||||
|
// versionCode: major*10000 + minor*100 + patch (e.g. 4.11.78 -> 41178)
|
||||||
|
const versionCode = (parts[0] ?? 0) * 10000 + (parts[1] ?? 0) * 100 + (parts[2] ?? 0);
|
||||||
|
|
||||||
|
const buildGradlePath = join(androidTarget, 'app', 'build.gradle');
|
||||||
|
let buildGradle = readFileSync(buildGradlePath, 'utf8');
|
||||||
|
buildGradle = buildGradle
|
||||||
|
.replace(/versionCode\s+\d+/, `versionCode ${versionCode}`)
|
||||||
|
.replace(/versionName\s+"[^"]+"/, `versionName "${version}"`);
|
||||||
|
writeFileSync(buildGradlePath, buildGradle, 'utf8');
|
||||||
|
console.log(` versionName "${version}", versionCode ${versionCode}`);
|
||||||
|
|
||||||
|
// 9. Write android/local.properties with the current machine's Android SDK path
|
||||||
const androidHome = process.env.ANDROID_HOME || process.env.ANDROID_SDK_ROOT;
|
const androidHome = process.env.ANDROID_HOME || process.env.ANDROID_SDK_ROOT;
|
||||||
if (androidHome) {
|
if (androidHome) {
|
||||||
console.log('[apply-overlay] Writing android/local.properties...');
|
console.log('[apply-overlay] Writing android/local.properties...');
|
||||||
|
|||||||
Reference in New Issue
Block a user