Skip to content

Commit 5a1d8e3

Browse files
authored
Merge branch 'permissionlesstech:main' into main
2 parents 26a845f + 5dc6369 commit 5a1d8e3

File tree

119 files changed

+8960
-1356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+8960
-1356
lines changed
Lines changed: 19 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
name: Android CI
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches: [ "main", "develop" ]
67
pull_request:
78
branches: [ "main", "develop" ]
89

910
jobs:
10-
test:
11+
verify:
12+
name: Test & Lint
1113
runs-on: ubuntu-latest
12-
14+
1315
steps:
1416
- name: Checkout code
1517
uses: actions/checkout@v4
@@ -39,7 +41,10 @@ jobs:
3941
- name: Run unit tests
4042
run: ./gradlew testDebugUnitTest
4143

42-
- name: Upload Test Reports (xml+html)
44+
- name: Run lint
45+
run: ./gradlew lintDebug
46+
47+
- name: Upload test reports
4348
if: always()
4449
uses: actions/upload-artifact@v4
4550
with:
@@ -48,47 +53,6 @@ jobs:
4853
**/build/test-results/
4954
**/build/reports/tests/
5055
51-
- name: Upload test results
52-
uses: actions/upload-artifact@v4
53-
if: always()
54-
with:
55-
name: test-results
56-
path: |
57-
**/build/test-results/
58-
**/build/reports/tests/
59-
60-
lint:
61-
runs-on: ubuntu-latest
62-
63-
steps:
64-
- name: Checkout code
65-
uses: actions/checkout@v4
66-
67-
- name: Set up JDK 17
68-
uses: actions/setup-java@v4
69-
with:
70-
java-version: '17'
71-
distribution: 'temurin'
72-
73-
- name: Setup Gradle
74-
uses: gradle/gradle-build-action@v3
75-
76-
- name: Grant execute permission for gradlew
77-
run: chmod +x gradlew
78-
79-
- name: Cache Gradle packages
80-
uses: actions/cache@v3
81-
with:
82-
path: |
83-
~/.gradle/caches
84-
~/.gradle/wrapper
85-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
86-
restore-keys: |
87-
${{ runner.os }}-gradle-
88-
89-
- name: Run lint
90-
run: ./gradlew lintDebug
91-
9256
- name: Upload lint results
9357
uses: actions/upload-artifact@v4
9458
if: always()
@@ -97,9 +61,13 @@ jobs:
9761
path: '**/build/reports/lint-results-*.html'
9862

9963
build:
64+
name: Build ${{ matrix.variant }}
10065
runs-on: ubuntu-latest
101-
needs: [test, lint]
102-
66+
needs: verify
67+
strategy:
68+
matrix:
69+
variant: [Debug, Release]
70+
10371
steps:
10472
- name: Checkout code
10573
uses: actions/checkout@v4
@@ -126,20 +94,11 @@ jobs:
12694
restore-keys: |
12795
${{ runner.os }}-gradle-
12896
129-
- name: Build debug APK
130-
run: ./gradlew assembleDebug
131-
132-
- name: Build release APK
133-
run: ./gradlew assembleRelease
134-
135-
- name: Upload debug APK
136-
uses: actions/upload-artifact@v4
137-
with:
138-
name: debug-apk
139-
path: app/build/outputs/apk/debug/*.apk
97+
- name: Build ${{ matrix.variant }} APK
98+
run: ./gradlew assemble${{ matrix.variant }}
14099

141-
- name: Upload release APK
100+
- name: Upload ${{ matrix.variant }} APK
142101
uses: actions/upload-artifact@v4
143102
with:
144-
name: release-apk
145-
path: app/build/outputs/apk/release/*.apk
103+
name: ${{ matrix.variant }}-apk
104+
path: app/build/outputs/apk/**/*.apk

.github/workflows/release.yml

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
distribution: temurin
2121
java-version: 17
22-
22+
2323
- name: Setup Gradle
2424
uses: gradle/gradle-build-action@v2
2525
with:
@@ -38,32 +38,32 @@ jobs:
3838
- name: Grant execute permission for Gradlew
3939
run: chmod +x ./gradlew
4040

41-
- name: Build APK
41+
- name: Build Release APKs (with architecture splits)
4242
run: ./gradlew assembleRelease --no-daemon --stacktrace
43-
43+
4444
- name: List APK files
4545
run: |
4646
echo "APK files built:"
47-
find app/build/outputs/apk/release -name "*.apk" -type f
47+
find app/build/outputs/apk/release -name "*.apk" -type f -exec ls -lh {} \;
4848
49-
- name: Rename APK
49+
- name: Rename APKs for GitHub Release
5050
run: |
51-
mv app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/apk/release/bitchat.apk
52-
51+
cd app/build/outputs/apk/release
52+
[ -f "app-arm64-v8a-release-unsigned.apk" ] && mv app-arm64-v8a-release-unsigned.apk bitchat-android-arm64.apk
53+
[ -f "app-x86_64-release-unsigned.apk" ] && mv app-x86_64-release-unsigned.apk bitchat-android-x86_64.apk
54+
[ -f "app-universal-release-unsigned.apk" ] && mv app-universal-release-unsigned.apk bitchat-android-universal.apk
55+
5356
- name: DEBUG
5457
run: |
5558
set -x
56-
5759
pwd
58-
5960
ls -all
60-
6161
cd app/build/outputs/
6262
ls -all
63-
tree
64-
65-
# Optional: Sign APK (requires secrets)
66-
# - name: Sign APK
63+
tree || ls -R
64+
65+
# Optional: Sign APKs (uncomment and configure secrets when ready)
66+
# - name: Sign APKs
6767
# uses: r0adkll/sign-android-release@v1
6868
# with:
6969
# releaseDirectory: app/build/outputs/apk/release
@@ -72,10 +72,10 @@ jobs:
7272
# keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
7373
# keyPassword: ${{ secrets.KEY_PASSWORD }}
7474

75-
- name: Upload APK as artifact
75+
- name: Upload APKs as artifacts
7676
uses: actions/upload-artifact@v4
7777
with:
78-
name: bitchat-release-apk-${{ github.ref_name }}
78+
name: bitchat-android-release-${{ github.ref_name }}
7979
path: app/build/outputs/apk/release/*.apk
8080
retention-days: 30
8181
if-no-files-found: error
@@ -85,16 +85,23 @@ jobs:
8585
runs-on: ubuntu-latest
8686

8787
steps:
88-
- name: Download APK artifact
88+
- name: Download release artifacts
8989
uses: actions/download-artifact@v4
9090
with:
91-
name: bitchat-release-apk-${{ github.ref_name }}
92-
path: .
91+
name: bitchat-android-release-${{ github.ref_name }}
92+
path: release
9393

9494
- name: Create GitHub Release
9595
uses: softprops/action-gh-release@v2
9696
with:
97-
files: bitchat.apk
97+
files: |
98+
release/bitchat-android-arm64.apk
99+
release/bitchat-android-x86_64.apk
100+
release/bitchat-android-universal.apk
98101
name: Release ${{ github.ref_name }}
102+
body: |
103+
**bitchat-android-arm64.apk** - ARM64 (most phones)
104+
**bitchat-android-x86_64.apk** - x86_64 (Chromebooks, tablets)
105+
**bitchat-android-universal.apk** - All architectures (fallback)
99106
env:
100107
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ dependency-reduced-pom.xml
4343
# Other
4444
*.log
4545
.cxx/
46-
*build/
46+
# Gradle/Android build directories (but not tools/arti-build/)
47+
**/build/
48+
!tools/arti-build/
4749
out/
4850
gen/
4951
*~
@@ -57,3 +59,7 @@ google-services.json
5759
# Keystore files
5860
*.jks
5961
*.keystore
62+
63+
# Arti build artifacts (cloned repo and Rust build cache)
64+
tools/arti-build/.arti-source/
65+
tools/arti-build/target/

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ The app requires the following permissions (automatically requested):
102102

103103
- **Bluetooth**: Core BLE functionality
104104
- **Location**: Required for BLE scanning on Android
105+
- **Network**: Expand your mesh through public internet relays
105106
- **Notifications**: Message alerts and background updates
106107

107108
### Hardware Requirements

app/build.gradle.kts

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ android {
1313
applicationId = "com.bitchat.droid"
1414
minSdk = libs.versions.minSdk.get().toInt()
1515
targetSdk = libs.versions.targetSdk.get().toInt()
16-
versionCode = 26
17-
versionName = "1.5.1"
16+
versionCode = 30
17+
versionName = "1.6.0"
1818

1919
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2020
vectorDrawables {
@@ -30,6 +30,12 @@ android {
3030
}
3131

3232
buildTypes {
33+
debug {
34+
ndk {
35+
// Include x86_64 for emulator support during development
36+
abiFilters += listOf("arm64-v8a", "x86_64")
37+
}
38+
}
3339
release {
3440
isMinifyEnabled = true
3541
isShrinkResources = true
@@ -39,6 +45,18 @@ android {
3945
)
4046
}
4147
}
48+
49+
// APK splits for GitHub releases - creates arm64, x86_64, and universal APKs
50+
// AAB for Play Store handles architecture distribution automatically
51+
splits {
52+
abi {
53+
isEnable = true
54+
reset()
55+
include("arm64-v8a", "x86_64")
56+
isUniversalApk = true // For F-Droid and fallback
57+
}
58+
}
59+
4260
compileOptions {
4361
sourceCompatibility = JavaVersion.VERSION_1_8
4462
targetCompatibility = JavaVersion.VERSION_1_8
@@ -73,12 +91,22 @@ dependencies {
7391

7492
// Lifecycle
7593
implementation(libs.bundles.lifecycle)
94+
implementation(libs.androidx.lifecycle.process)
7695

7796
// Navigation
7897
implementation(libs.androidx.navigation.compose)
7998

8099
// Permissions
81100
implementation(libs.accompanist.permissions)
101+
102+
// QR
103+
implementation(libs.zxing.core)
104+
implementation(libs.mlkit.barcode.scanning)
105+
106+
// CameraX
107+
implementation(libs.androidx.camera.camera2)
108+
implementation(libs.androidx.camera.lifecycle)
109+
implementation(libs.androidx.camera.compose)
82110

83111
// Cryptography
84112
implementation(libs.bundles.cryptography)
@@ -95,8 +123,11 @@ dependencies {
95123
// WebSocket
96124
implementation(libs.okhttp)
97125

98-
// Arti (Tor in Rust) Android bridge - use published AAR with native libs
99-
implementation("info.guardianproject:arti-mobile-ex:1.2.3")
126+
// Arti (Tor in Rust) Android bridge - custom build from latest source
127+
// Built with rustls, 16KB page size support, and onio//un service client
128+
// Native libraries are in src/tor/jniLibs/ (extracted from arti-custom.aar)
129+
// Only included in tor flavor to reduce APK size for standard builds
130+
// Note: AAR is kept in libs/ for reference, but libraries loaded from jniLibs/
100131

101132
// Google Play Services Location
102133
implementation(libs.gms.location)

app/lint-baseline.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -243,17 +243,6 @@
243243
column="35"/>
244244
</issue>
245245

246-
<issue
247-
id="OldTargetApi"
248-
message="Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details."
249-
errorLine1=" targetSdk = 34"
250-
errorLine2=" ~~~~~~~~~~~~~~">
251-
<location
252-
file="build.gradle.kts"
253-
line="14"
254-
column="9"/>
255-
</issue>
256-
257246
<issue
258247
id="RedundantLabel"
259248
message="Redundant label can be removed"

app/proguard-rules.pro

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@
1717
-keep class com.bitchat.android.nostr.** { *; }
1818
-keep class com.bitchat.android.identity.** { *; }
1919

20-
# Arti (Tor) ProGuard rules
20+
# Keep Tor implementation (always included)
21+
-keep class com.bitchat.android.net.RealTorProvider { *; }
22+
23+
# Arti (Custom Tor implementation in Rust) ProGuard rules
2124
-keep class info.guardianproject.arti.** { *; }
22-
-keep class org.torproject.jni.** { *; }
23-
-keepnames class org.torproject.jni.**
25+
-keep class org.torproject.arti.** { *; }
26+
-keepnames class org.torproject.arti.**
2427
-dontwarn info.guardianproject.arti.**
25-
-dontwarn org.torproject.jni.**
28+
-dontwarn org.torproject.arti.**

0 commit comments

Comments
 (0)