Skip to content

Commit 982d6a6

Browse files
committed
fix(security): disable backup, exclude ssh_known_hosts, remove legacy storage flag
1 parent 327d4ce commit 982d6a6

4 files changed

Lines changed: 7 additions & 43 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -76,44 +76,3 @@ jobs:
7676
name: debug-apk
7777
path: app/build/outputs/apk/debug/app-debug.apk
7878
retention-days: 5
79-
80-
build-release:
81-
name: Build Release APK
82-
runs-on: ubuntu-latest
83-
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/'))
84-
needs: [lint]
85-
steps:
86-
- name: Checkout
87-
uses: actions/checkout@v6
88-
89-
- name: Set up JDK
90-
uses: actions/setup-java@v5
91-
with:
92-
java-version: ${{ env.JAVA_VERSION }}
93-
distribution: 'temurin'
94-
95-
- name: Setup Gradle
96-
uses: gradle/actions/setup-gradle@v6
97-
with:
98-
cache-cleanup: 'never'
99-
100-
- name: Fix gradlew permissions
101-
run: chmod +x ./gradlew
102-
103-
- name: Decode keystore
104-
run: echo "${{ secrets.RELEASE_KEYSTORE_BASE64 }}" | base64 -d > release.jks
105-
106-
- name: Build release APK
107-
run: ./gradlew assembleRelease --no-daemon --parallel
108-
env:
109-
RELEASE_STORE_FILE: release.jks
110-
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }}
111-
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
112-
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
113-
114-
- name: Upload release APK
115-
uses: actions/upload-artifact@v7
116-
with:
117-
name: release-apk
118-
path: app/build/outputs/apk/release/app-release.apk
119-
retention-days: 30

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111

1212
<application
1313
android:name=".di.FuwaGitApplication"
14-
android:allowBackup="true"
14+
android:allowBackup="false"
1515
android:dataExtractionRules="@xml/data_extraction_rules"
1616
android:fullBackupContent="@xml/backup_rules"
1717
android:icon="@mipmap/ic_launcher"
1818
android:label="@string/app_name"
1919
android:roundIcon="@mipmap/ic_launcher_round"
2020
android:supportsRtl="true"
2121
android:theme="@style/Theme.FuwaGit"
22-
android:requestLegacyExternalStorage="true"
2322
tools:targetApi="33">
2423
<activity
2524
android:name=".MainActivity"

app/src/main/res/xml/backup_rules.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
<!-- Exclude sensitive credential data and master key wrapping info from older API backup -->
44
<exclude domain="file" path="credential_data.json"/>
55
<exclude domain="sharedpref" path="credential_key_store.xml"/>
6+
<!-- Exclude SSH known hosts (contains server fingerprints) -->
7+
<exclude domain="file" path="ssh_known_hosts"/>
68
</full-backup-content>

app/src/main/res/xml/data_extraction_rules.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
<!-- Exclude sensitive credential data and master key wrapping info from cloud backup -->
55
<exclude domain="file" path="credential_data.json"/>
66
<exclude domain="sharedpref" path="credential_key_store.xml"/>
7+
<!-- Exclude SSH known hosts (contains server fingerprints) -->
8+
<exclude domain="file" path="ssh_known_hosts"/>
79
</cloud-backup>
810
<device-transfer>
911
<!-- Exclude sensitive credential data and master key wrapping info from device-to-device transfer -->
1012
<exclude domain="file" path="credential_data.json"/>
1113
<exclude domain="sharedpref" path="credential_key_store.xml"/>
14+
<!-- Exclude SSH known hosts (contains server fingerprints) -->
15+
<exclude domain="file" path="ssh_known_hosts"/>
1216
</device-transfer>
1317
</data-extraction-rules>

0 commit comments

Comments
 (0)