Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Updates #8

Closed
wants to merge 8 commits into from
Closed
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* text=auto eol=lf
*.bat text eol=crlf
*.jar binary
*.jks binary
35 changes: 21 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,35 @@ on: [ push, pull_request ]

jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
name: Build
runs-on: ubuntu-latest

steps:

- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'

- name: Cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: ${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}

- name: Build with Gradle
run: |
./gradlew assemble
./gradlew --stop
./gradlew assemble --no-daemon
echo "commit=$(echo ${{ github.sha }} | cut -c-7)" >> $GITHUB_ENV

- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-artifact
path: app/build/outputs
name: VpnDialogs(${{ env.commit }})
path: app/build/outputs/apk/**/app-*.apk
14 changes: 4 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
*.iml
.gradle
/.gradle/
/local.properties
/.idea
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
*.class
/.idea/
build/
bin/
1 change: 0 additions & 1 deletion app/.gitignore

This file was deleted.

Binary file added app/android.jks
Binary file not shown.
51 changes: 31 additions & 20 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
plugins {
id("com.android.application")
id 'com.android.application'
}

android {
namespace = "com.android.vpndialogs"
namespace 'com.android.vpndialogs'
compileSdk 33
buildToolsVersion = '33.0.2'
buildToolsVersion '34.0.0'

defaultConfig {
minSdk 32
minSdk 33
targetSdk 33
versionCode = 33
versionName = '13'
versionCode 33
versionName '13'
proguardFiles += "proguard-rules.pro"
multiDexEnabled false
}

signingConfigs {
android {
storeFile file('android.jks')
storePassword 'android'
keyAlias 'android'
keyPassword 'android'
}
}

buildTypes {
debug {
minifyEnabled false
signingConfig signingConfigs.android
}
release {
minifyEnabled = true
shrinkResources = true
signingConfig = signingConfigs.debug
proguardFiles += "proguard-rules.pro"
minifyEnabled true
shrinkResources true
signingConfig signingConfigs.android
}
}

Expand All @@ -28,22 +43,18 @@ android {
}
}

buildFeatures {
buildConfig = false
}


compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

lint {
checkReleaseBuilds false
}
}

dependencies {
compileOnly(project(":hidden"))
compileOnly(project(":stub"))
implementation(project(":bridge"))
compileOnly project(':hidden')
compileOnly project(':stub')
implementation project(':bridge')
}
1 change: 1 addition & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-ignorewarnings
19 changes: 7 additions & 12 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
<?xml version="1.0" encoding="utf-8"?><!--suppress AndroidDomInspection -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="ProtectedPermissions,QueryAllPackagesPermission,DataExtractionRules,MissingApplicationIcon">

<uses-permission
android:name="android.permission.CONTROL_VPN"
tools:ignore="ProtectedPermissions" />
<uses-permission
android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"
tools:ignore="ProtectedPermissions" />
<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
<uses-permission android:name="android.permission.CONTROL_VPN" />
<uses-permission android:name="android.permission.CONTROL_ALWAYS_ON_VPN" />
<uses-permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

<application
android:allowBackup="false"
android:label="VpnDialogs"
android:usesNonSdkApi="true"
tools:ignore="DataExtractionRules,MissingApplicationIcon">
android:usesNonSdkApi="true">

<activity
android:name=".ConfirmDialog"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class AlwaysOnDisconnectedDialog extends AlertActivity

private String mVpnPackage;

@Deprecated
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -53,7 +54,6 @@ public void onCreate(Bundle savedInstanceState) {
setupAlert();

Bridge.Window_setCloseOnTouchOutside(getWindow(), false);
//noinspection deprecation
getWindow().setType(android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
getWindow().addFlags(FLAG_ALT_FOCUSABLE_IM);
Bridge.Window_addPrivateFlags(getWindow(), SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public Drawable getDrawable(String source) {
return icon;
}

@Deprecated
@Override
public void onBackPressed() {
}
Expand Down
1 change: 0 additions & 1 deletion bridge/.gitignore

This file was deleted.

8 changes: 4 additions & 4 deletions bridge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
id("java-library")
id 'java-library'
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

dependencies {
compileOnly(project(":stub"))
compileOnly project(':stub')
}
Empty file removed build.gradle
Empty file.
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
android.useAndroidX=true
android.nonTransitiveRClass=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
35 changes: 22 additions & 13 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +80,11 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
21 changes: 11 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -42,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
1 change: 0 additions & 1 deletion hidden/.gitignore

This file was deleted.

16 changes: 8 additions & 8 deletions hidden/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
plugins {
id("com.android.library")
id 'com.android.library'
}

android {
namespace = "com.android.vpndialogs.stub"
compileSdk = 33
buildToolsVersion = '33.0.2'
namespace 'com.android.vpndialogs.stub'
compileSdk 33
buildToolsVersion '34.0.0'
defaultConfig {
minSdk = 32
targetSdk = 33
minSdk 33
targetSdk 33
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
Loading