Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(WIP): make shareable and scan shared file & Update Gradle/Dependencies #38

Draft
wants to merge 26 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: "temurin"
cache: 'gradle'

Expand Down
28 changes: 28 additions & 0 deletions android-env.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# see https://github.com/tadfisher/android-nixpkgs
# run with `nix-shell android-env.nix`
{ pkgs ? import <nixpkgs> { config.android_sdk.accept_license = true; } }:

let
android-nixpkgs = pkgs.callPackage <android-nixpkgs> {
# Default; can also choose "beta", "preview", or "canary".
channel = "stable";
};

androidSdk = android-nixpkgs.sdk (sdkPkgs: with sdkPkgs; [
cmdline-tools-latest
build-tools-34-0-0
platform-tools
platforms-android-34
# emulator
]);

in
pkgs.mkShell {
buildInputs = with pkgs; [
androidSdk
glibc
];

# Override the aapt2 that gradle uses with the nix-shipped version
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/share/android-sdk/build-tools/34.0.0/aapt2";
}
18 changes: 14 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 33
compileSdkVersion 34
namespace 'us.spotco.malwarescanner'

defaultConfig {
applicationId "org.maintainteam.hypatia"
resValue "string", "app_name", "Hypatia"
minSdkVersion 16
targetSdkVersion 32
minSdkVersion 21
targetSdkVersion 34
versionCode 314
versionName "3.14"
resConfigs 'en', 'ar', 'bg', 'cs', 'de', 'es', 'et', 'fi', 'fr', 'gl', 'hr', 'in', 'it', 'ja', 'pt', 'pt-rBR', 'ro', 'ru', 'sk', 'ta', 'tr', 'uk', 'zh-rCN', 'zh-rTW'
Expand All @@ -28,7 +30,6 @@ android {
resValue "string", "app_name", "Hypatia " + workingBranch
}

minifyEnabled true
zipAlignEnabled true

}
Expand All @@ -49,12 +50,21 @@ android {
exclude 'org/bouncycastle/x509/CertPathReviewerMessages.properties'
exclude 'org/bouncycastle/x509/CertPathReviewerMessages_de.properties'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
encoding 'utf-8'
}
buildFeatures {
buildConfig = true
}
}

dependencies {
implementation 'commons-io:commons-io:2.5'
implementation 'org.bouncycastle:bcpg-jdk15to18:1.77'
implementation 'com.google.guava:guava:33.0.0-jre'
implementation 'androidx.appcompat:appcompat:1.6.1'
}

static String getGitWorkingBranch() {
Expand Down
3 changes: 3 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@

# Disable obfuscation
-dontobfuscate

-keep class androidx.appcompat.app.** { *; }
-keep class androidx.appcompat.widget.** { *; }
18 changes: 14 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="us.spotco.malwarescanner">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
Expand All @@ -24,24 +23,26 @@

<application
android:allowBackup="true"
android:name=".Hypatia"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@android:style/Theme.DeviceDefault">
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar">
<activity
android:name=".NotificationPromptActivity"
android:exported="false"
android:launchMode="singleInstance"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:theme="@style/Theme.AppCompat.Translucent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:noHistory="true"
android:excludeFromRecents="true" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:configChanges="orientation|keyboardHidden"
android:exported="true"
android:screenOrientation="portrait">
Expand All @@ -51,6 +52,15 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ShareScanner"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>

<service
android:name=".MalwareScannerService"
Expand Down
Loading