From 003ae9c15fff4a6db6f0463a320c2e3f190aead6 Mon Sep 17 00:00:00 2001 From: Vishal Bhat Soori Date: Thu, 5 Mar 2026 17:06:40 +0000 Subject: [PATCH 1/4] trying to fix a missing argument YaraRuleEngine in the test --- .github/workflows/qa.yml | 89 +++++++++++++------ .../av/engine/AntivirusEngineTest.kt | 2 +- 2 files changed, 61 insertions(+), 30 deletions(-) diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index e3bd394..1f79d1b 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -5,9 +5,11 @@ on: branches: [main, develop] pull_request: branches: [main, develop] + workflow_dispatch: jobs: - test: + # this checks the code quality very quickly + detekt: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -19,20 +21,10 @@ jobs: distribution: 'temurin' cache: gradle - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Run unit tests - run: ./gradlew testReleaseUnitTest --no-daemon - - - name: Upload test report - uses: actions/upload-artifact@v4 - if: always() - with: - name: test-report - path: '**/build/reports/tests/testReleaseUnitTest/' - - detekt: + - name: Run Detekt + run: ./gradlew detekt --no-daemon + # here we test and build the app in the same github runner so that no extra runner is used and saves time in setting up the environment again during build + test-and-build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -44,21 +36,60 @@ jobs: distribution: 'temurin' cache: gradle - - name: Run detekt - run: ./gradlew detekt --no-daemon + - name: Grant execute permission for gradlew + run: chmod +x gradlew - build: - runs-on: ubuntu-latest - needs: [test] - steps: - - uses: actions/checkout@v4 + - name: Inject Mock Google Services JSON + run: | + echo '{ + "project_info": { + "project_number": "1", + "project_id": "mock-project-id", + "storage_bucket": "mock-project-id.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1", + "android_client_info": { + "package_name": "com.deepfakeshield" + } + }, + "api_key": [ + { + "current_key": "mock-api-key" + } + ] + } + ] + }' > app/google-services.json + + - name: Generate Dummy Keystore + run: | + keytool -genkey -v -keystore release.keystore -alias mock-alias -keyalg RSA -keysize 2048 -validity 10000 -storepass mock-password -keypass mock-password -dname "CN=Mock, OU=Mock, O=Mock, L=Mock, S=Mock, C=Mock" - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - cache: gradle + - name: Run Unit Tests + run: ./gradlew testReleaseUnitTest --info - - name: Build release + - name: Build Release APK + env: + RELEASE_BUILD: "1" + KEYSTORE_PASSWORD: "mock-password" + KEYSTORE_FILE: "../release.keystore" + KEY_ALIAS: "mock-alias" + KEY_PASSWORD: "mock-password" run: ./gradlew assembleRelease --no-daemon + + - name: Upload Test Report + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-report + path: '**/build/reports/tests/testReleaseUnitTest/' + + - name: Upload Release APK + uses: actions/upload-artifact@v4 + if: success() + with: + name: release-apk + path: '**/build/outputs/apk/release/*.apk' \ No newline at end of file diff --git a/av/src/test/kotlin/com/deepfakeshield/av/engine/AntivirusEngineTest.kt b/av/src/test/kotlin/com/deepfakeshield/av/engine/AntivirusEngineTest.kt index 5e2b82b..3b137d9 100644 --- a/av/src/test/kotlin/com/deepfakeshield/av/engine/AntivirusEngineTest.kt +++ b/av/src/test/kotlin/com/deepfakeshield/av/engine/AntivirusEngineTest.kt @@ -23,7 +23,7 @@ class AntivirusEngineTest { context = ApplicationProvider.getApplicationContext() val signatureDb = MalwareSignatureDatabase(context) val heuristicAnalyzer = HeuristicMalwareAnalyzer(context) - engine = AntivirusEngine(context, signatureDb, heuristicAnalyzer, CloudHashChecker()) + engine = AntivirusEngine(context, signatureDb, heuristicAnalyzer, CloudHashChecker(), YaraRuleEngine()) } @Test From 5f09a5e27ba26a3abab2d93c4cefc3b09b77f757 Mon Sep 17 00:00:00 2001 From: Vishal Bhat Soori Date: Thu, 5 Mar 2026 17:08:37 +0000 Subject: [PATCH 2/4] added the argument YaraRuleEngine() in the AntiVirusEngine --- .github/workflows/qa.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 1f79d1b..30fa641 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -5,7 +5,6 @@ on: branches: [main, develop] pull_request: branches: [main, develop] - workflow_dispatch: jobs: # this checks the code quality very quickly From a837a006eb1e129263a6868921947f1b053f3b68 Mon Sep 17 00:00:00 2001 From: Vishal Bhat Soori Date: Thu, 5 Mar 2026 17:22:52 +0000 Subject: [PATCH 3/4] added workflow_dispatch for debugging --- .github/workflows/qa.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 30fa641..1f79d1b 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -5,6 +5,7 @@ on: branches: [main, develop] pull_request: branches: [main, develop] + workflow_dispatch: jobs: # this checks the code quality very quickly From 9de8da60003778fa5900e0dd615509dedbeed2ac Mon Sep 17 00:00:00 2001 From: Vishal Bhat Soori Date: Thu, 5 Mar 2026 18:11:04 +0000 Subject: [PATCH 4/4] excluded uploadCrashlyticsMappingFileRelease in the build stage because this is trying to connect to firebase using the mock data --- .github/workflows/qa.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 1f79d1b..a5f8d63 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -78,7 +78,7 @@ jobs: KEYSTORE_FILE: "../release.keystore" KEY_ALIAS: "mock-alias" KEY_PASSWORD: "mock-password" - run: ./gradlew assembleRelease --no-daemon + run: ./gradlew assembleRelease --no-daemon -x uploadCrashlyticsMappingFileRelease - name: Upload Test Report uses: actions/upload-artifact@v4