Skip to content

Commit 898fbf1

Browse files
Merge pull request #464 from dekusms/dev
Dev
2 parents 5bd99eb + c210e33 commit 898fbf1

31 files changed

+137
-384
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Reproducible Build Check
2+
3+
on:
4+
pull_request:
5+
branches: [ "staging" ]
6+
types: [ closed ]
7+
8+
jobs:
9+
reproducible-build:
10+
name: Verify Reproducible Build
11+
runs-on: ubuntu-latest
12+
if: github.event.pull_request.merged == true
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Build Docker image
19+
working-directory: ci
20+
run: docker build -t deku_rep_build_release .
21+
22+
- name: First build
23+
run: |
24+
docker run --rm \
25+
-v "$(pwd)":/project \
26+
-w /project \
27+
--user "$(id -u):$(id -g)" \
28+
deku_rep_build_release \
29+
./gradlew assembleRelease \
30+
--no-daemon \
31+
--max-workers=2 \
32+
--console=plain \
33+
-Dorg.gradle.jvmargs="-Xmx1024m -Xms256m -XX:MaxMetaspaceSize=384m -Dfile.encoding=UTF-8" \
34+
-Dkotlin.daemon.jvm.options="-Xmx512m,-Xss1m" \
35+
-Dkotlin.compiler.execution.strategy=in-process
36+
37+
- name: Hash first APK
38+
id: sha1
39+
run: |
40+
hash=$(sha256sum app/build/outputs/apk/release/app-release-unsigned.apk)
41+
echo "value=$hash" >> "$GITHUB_OUTPUT"
42+
echo "First build: $hash"
43+
44+
- name: Remove first APK
45+
run: rm app/build/outputs/apk/release/app-release-unsigned.apk
46+
47+
- name: Second build
48+
run: |
49+
docker run --rm \
50+
-v "$(pwd)":/project \
51+
-w /project \
52+
--user "$(id -u):$(id -g)" \
53+
deku_rep_build_release \
54+
./gradlew assembleRelease \
55+
--no-daemon \
56+
--max-workers=2 \
57+
--console=plain \
58+
-Dorg.gradle.jvmargs="-Xmx1024m -Xms256m -XX:MaxMetaspaceSize=384m -Dfile.encoding=UTF-8" \
59+
-Dkotlin.daemon.jvm.options="-Xmx512m,-Xss1m" \
60+
-Dkotlin.compiler.execution.strategy=in-process
61+
62+
- name: Hash second APK
63+
id: sha2
64+
run: |
65+
hash=$(sha256sum app/build/outputs/apk/release/app-release-unsigned.apk)
66+
echo "value=$hash" >> "$GITHUB_OUTPUT"
67+
echo "Second build: $hash"
68+
69+
- name: Compare hashes
70+
run: |
71+
SHA1="${{ steps.sha1.outputs.value }}"
72+
SHA2="${{ steps.sha2.outputs.value }}"
73+
echo "Build 1: $SHA1"
74+
echo "Build 2: $SHA2"
75+
if [ "$SHA1" = "$SHA2" ]; then
76+
echo "Reproducible build verified — hashes match."
77+
else
78+
echo "Build is NOT reproducible — hashes differ! Run diffoscope"
79+
exit 1
80+
fi

.github/workflows/staging-version-bump.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: Run bump_version.py
5555
id: bump
5656
run: |
57-
python bump_version.py \
57+
python ci/bump_version.py \
5858
"${{ steps.previoustag.outputs.tag }}" \
5959
"${{ steps.branch.outputs.name }}" \
6060
> /tmp/version_bumped.properties
@@ -86,12 +86,12 @@ jobs:
8686
if gh pr create \
8787
--base master \
8888
--head "${{ steps.branch.outputs.name }}" \
89-
--title "chore: bump version (${{ steps.previoustag.outputs.tag }} → ${{ steps.branch.outputs.name }})" \
89+
--title "release: bump version (${{ steps.previoustag.outputs.tag }} → ${{ steps.branch.outputs.name }})" \
9090
--body "$PR_BODY"; then
9191
echo "PR created"
9292
else
9393
echo "PR already exists, updating body..."
9494
gh pr edit "${{ steps.branch.outputs.name }}" \
95-
--title "chore: bump version (${{ steps.previoustag.outputs.tag }} → ${{ steps.branch.outputs.name }})" \
95+
--title "release: bump version (${{ steps.previoustag.outputs.tag }} → ${{ steps.branch.outputs.name }})" \
9696
--body "$PR_BODY"
9797
fi

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 0 additions & 136 deletions
This file was deleted.

apk-outputs/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ android {
115115
}
116116

117117
dependencies {
118-
implementation 'com.github.smswithoutborders:lib_smsmms_android:-SNAPSHOT'
118+
implementation 'com.github.smswithoutborders:lib_smsmms_android:73432ef'
119119
implementation 'com.github.smswithoutborders:lib_signal_double_ratchet_java:ad727a5'
120120

121121
implementation libs.androidx.room.testing

app/src/main/AndroidManifest.xml

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@
6262
<data android:scheme="mmsto" />
6363
</intent-filter>
6464
</activity>
65-
<activity
66-
android:name="com.afkanerd.deku.Router.Settings.GatewayServerSettingsActivity"
67-
android:exported="false"
68-
android:parentActivityName="com.afkanerd.deku.Router.GatewayServers.GatewayServerRoutedActivity" />
6965

7066
<service
7167
android:name="androidx.appcompat.app.AppLocalesMetadataHolderService"
@@ -84,14 +80,6 @@
8480
android:name="com.afkanerd.deku.Images.Images.ImageViewActivity"
8581
android:exported="false"/>
8682

87-
<activity
88-
android:name="com.afkanerd.deku.Router.GatewayServers.GatewayServerListingActivity"
89-
android:exported="false"
90-
android:parentActivityName="com.afkanerd.deku.Router.GatewayServers.GatewayServerRoutedActivity" />
91-
<activity
92-
android:name="com.afkanerd.deku.Router.GatewayServers.GatewayServerRoutedActivity"
93-
android:exported="false"/>
94-
9583
<service
9684
android:name="com.afkanerd.deku.MainActivity"
9785
android:exported="true"
@@ -117,15 +105,15 @@
117105
</intent-filter>
118106
</service>
119107

120-
<provider
121-
android:name="androidx.startup.InitializationProvider"
122-
android:authorities="${applicationId}.androidx-startup"
123-
android:exported="false"
124-
tools:node="merge">
125-
<meta-data
126-
android:name="com.afkanerd.deku.RemoteListeners.RemoteListenerConnectionServiceInitializer"
127-
android:value="androidx.startup" />
128-
</provider>
108+
<!-- <provider-->
109+
<!-- android:name="androidx.startup.InitializationProvider"-->
110+
<!-- android:authorities="${applicationId}.androidx-startup"-->
111+
<!-- android:exported="false"-->
112+
<!-- tools:node="merge">-->
113+
<!-- <meta-data-->
114+
<!-- android:name="com.afkanerd.deku.RemoteListeners.RemoteListenerConnectionServiceInitializer"-->
115+
<!-- android:value="androidx.startup" />-->
116+
<!-- </provider>-->
129117

130118
<provider
131119
android:name="androidx.core.content.FileProvider"

app/src/main/java/com/afkanerd/deku/Datastore.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.afkanerd.deku
22

33
import android.content.Context
4+
import androidx.annotation.NonNull
45
import androidx.room.AutoMigration
56
import androidx.room.Database
67
import androidx.room.DeleteColumn
@@ -9,6 +10,7 @@ import androidx.room.RenameTable
910
import androidx.room.Room.databaseBuilder
1011
import androidx.room.RoomDatabase
1112
import androidx.room.migration.AutoMigrationSpec
13+
import androidx.sqlite.db.SupportSQLiteDatabase
1214
import com.afkanerd.deku.Datastore.Migrate16To17
1315
import com.afkanerd.deku.Datastore.Migrate19To20
1416
import com.afkanerd.deku.Datastore.Migrate20To21
@@ -25,6 +27,7 @@ import com.afkanerd.smswithoutborders_libsmsmms.data.Cryptography.getDatabasePas
2527
import net.zetetic.database.sqlcipher.SupportOpenHelperFactory
2628
import kotlin.concurrent.Volatile
2729

30+
2831
@Database(
2932
entities = [GatewayServer::class, RemoteListenersQueues::class, RemoteListeners::class],
3033
version = 31,
@@ -122,7 +125,7 @@ abstract class Datastore : RoomDatabase() {
122125
companion object {
123126
@Volatile
124127
private var datastore: Datastore? = null
125-
private const val dbKeystoreAlias = "afkanerd.smswithoutborders.sms_mms_keystore_alias"
128+
private const val dbKeystoreAlias = "afkanerd.smswithoutborders.deku.sms_mms_keystore_alias"
126129
@JvmField
127130
var databaseName: String = "afkanerd.smswithoutborders.dekusms.db"
128131

@@ -136,10 +139,9 @@ abstract class Datastore : RoomDatabase() {
136139
}
137140

138141
private fun create(context: Context): Datastore {
139-
val password = getDatabasePassword(context, dbKeystoreAlias)
140-
141142
val databaseFile = context.getDatabasePath(databaseName)
142-
val factory = SupportOpenHelperFactory(password)
143+
val factory = SupportOpenHelperFactory(
144+
getDatabasePassword(context, dbKeystoreAlias))
143145
return databaseBuilder(
144146
context,
145147
Datastore::class.java,
@@ -148,9 +150,6 @@ abstract class Datastore : RoomDatabase() {
148150
.enableMultiInstanceInvalidation()
149151
.openHelperFactory(factory)
150152
.build()
151-
// return Room.databaseBuilder(context, Datastore.class, databaseName)
152-
// .enableMultiInstanceInvalidation()
153-
// .build();
154153
}
155154
}
156155
}

0 commit comments

Comments
 (0)