Skip to content

Commit ce4b9f5

Browse files
authored
fix: Backend fails to start on GrapheneOS in 6.5.1 (#3106)
* Standardize build config fields to boolean * Remove call to `free` because it breaks the backend on graphene
1 parent 1e8dd0f commit ce4b9f5

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

packages/mobile/android/app/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,10 @@ android {
216216
}
217217
}
218218
buildTypes.each {
219-
it.buildConfigField("String", "SHOULD_RUN_BACKEND_WORKER", "\"true\"")
220-
it.buildConfigField("String", "QSS_ALLOWED", "\"false\"")
219+
it.buildConfigField("Boolean", "SHOULD_RUN_BACKEND_WORKER", "true")
220+
it.buildConfigField("Boolean", "QSS_ALLOWED", "false")
221221
it.buildConfigField("String", "QSS_ENDPOINT", "\"\"")
222+
it.buildConfigField("Boolean", "DEBUG", "false")
222223
}
223224
buildTypes {
224225
debug {

packages/mobile/android/app/src/main/cpp/own-native-lib.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ Java_com_quietmobile_Backend_BackendWorker_startNodeWithArguments(
203203
current_args_position += strlen(current_args_position) + 1;
204204
}
205205

206-
free(args_buffer);
206+
// NOTE: this works on android but breaks on GrapheneOS which uses its own hardened version of calloc/malloc/free
207+
// free(args_buffer);
207208

208209
rn_register_bridge_cb(&rcv_message);
209210

packages/mobile/android/app/src/main/java/com/quietmobile/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class MainActivity : ReactActivity() {
4444
val intent = intent
4545
checkAgainstIntentUpdate(intent)
4646

47-
if (BuildConfig.SHOULD_RUN_BACKEND_WORKER === "true") {
47+
if (BuildConfig.SHOULD_RUN_BACKEND_WORKER) {
4848
val context = applicationContext
4949
BackendWorkManager(context).enqueueRequests()
5050
}

0 commit comments

Comments
 (0)