From 35a25faeaf7b21d43caf331be16f637fa593e339 Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Thu, 10 Apr 2025 12:47:50 +0600 Subject: [PATCH 01/17] Create main.yml --- .github/workflows/main.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..2f633b6 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,26 @@ +name: Android CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build From 0ffb5022263279c4f3f84478265fec3a583217f5 Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Thu, 10 Apr 2025 12:49:10 +0600 Subject: [PATCH 02/17] Add files via upload --- .github/workflows/android.yml.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/android.yml.txt diff --git a/.github/workflows/android.yml.txt b/.github/workflows/android.yml.txt new file mode 100644 index 0000000..2f633b6 --- /dev/null +++ b/.github/workflows/android.yml.txt @@ -0,0 +1,26 @@ +name: Android CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build From d4ed753f021bfbd1a3cc5c3ee2f9364c1716688f Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Mon, 14 Apr 2025 15:30:58 +0600 Subject: [PATCH 03/17] Update main.yml From 2d2081988c584f4bbed7ecf4f56f9bdce4905a9c Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Mon, 14 Apr 2025 15:34:12 +0600 Subject: [PATCH 04/17] Add files via upload --- build.gradle.txt | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 build.gradle.txt diff --git a/build.gradle.txt b/build.gradle.txt new file mode 100644 index 0000000..2b3d359 --- /dev/null +++ b/build.gradle.txt @@ -0,0 +1,44 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + ext.kotlin_version = "1.5.21" + repositories { + jcenter() + mavenCentral() + google() + maven { url 'https://jitpack.io' } + } + dependencies { + classpath "com.android.tools.build:gradle:7.0.2" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + jcenter() + mavenCentral() + google() + maven { url 'https://jitpack.io' } + maven { url "https://raw.githubusercontent.com/andvipgroup/CameraLib/master" } + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} + +ext { + minSdkVersion = 24 + compileSdkVersion = 33 + targetSdkVersion = 31 + buildToolsVersion = "31.0.0" + javaVersion = JavaVersion.VERSION_1_8 + abiFilters = "armeabi-v7a,arm64-v8a" + localTest = false + isMasterPkg = true + hackJarName = "hack.jar" + versionCode = 100 + versionName = "1.0.0" + masterPkg = "virtual.camera.app" + assistPkg = "virtual.camera.app.assist" +} \ No newline at end of file From 1fe0564379c40c17a6e66fca23e8278b011ac5f9 Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Mon, 14 Apr 2025 15:34:59 +0600 Subject: [PATCH 05/17] Update main.yml --- .github/workflows/main.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2f633b6..8b13789 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,26 +1 @@ -name: Android CI -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: set up JDK 11 - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'temurin' - cache: gradle - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build From 55896a2bfdd512048e970950af34eb892a6081ee Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Mon, 14 Apr 2025 15:38:21 +0600 Subject: [PATCH 06/17] Add files via upload From 9f55e3522fc8952a973e2cf270368cd7bd938169 Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Mon, 14 Apr 2025 15:39:53 +0600 Subject: [PATCH 07/17] Update main.yml --- .github/workflows/main.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8b13789..2f633b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1 +1,26 @@ +name: Android CI +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build From 67c8b4497dfebf52b045f5e19a7ba27312460b84 Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Mon, 14 Apr 2025 16:12:29 +0600 Subject: [PATCH 08/17] Update main.yml --- .github/workflows/main.yml | 55 +++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2f633b6..87d5ecb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,11 @@ -name: Android CI +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Java CI with Gradle on: push: @@ -10,17 +17,51 @@ jobs: build: runs-on: ubuntu-latest + permissions: + contents: read steps: - uses: actions/checkout@v4 - - name: set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '17' distribution: 'temurin' - cache: gradle - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle + # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - name: Setup Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + + - name: Build with Gradle Wrapper run: ./gradlew build + + # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). + # If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version. + # + # - name: Setup Gradle + # uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + # with: + # gradle-version: '8.9' + # + # - name: Build with Gradle 8.9 + # run: gradle build + + dependency-submission: + + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. + # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 From 93983bcb075ec557c6e8292d1f2d09541667429a Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Mon, 14 Apr 2025 16:16:46 +0600 Subject: [PATCH 09/17] Create android.yml --- .github/workflows/android.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 0000000..2f633b6 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,26 @@ +name: Android CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build From b65242768f91c2097a80fd7973bb7fb0f6039502 Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Mon, 14 Apr 2025 23:44:53 +0600 Subject: [PATCH 10/17] Update native-lib.cpp --- check_env_demo/code/native-lib.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/check_env_demo/code/native-lib.cpp b/check_env_demo/code/native-lib.cpp index 1cb3958..aece0ec 100755 --- a/check_env_demo/code/native-lib.cpp +++ b/check_env_demo/code/native-lib.cpp @@ -1,13 +1,20 @@ #include #include -#include -# include -# include -#include +#include extern "C" JNIEXPORT jint JNICALL Java_check_env_MainActivity_isPathReallyExist(JNIEnv *env, jobject, jstring path) { + // Convert the Java string to a C-style string const char *cpath = env->GetStringUTFChars(path, nullptr); - int result1 = syscall(__NR_faccessat,AT_FDCWD, cpath, F_OK, 0); - return result1; + if (cpath == nullptr) { + return -1; // Return error if the conversion fails + } + + // Check if the path exists using access + int result = access(cpath, F_OK); + + // Release the memory allocated for the C-style string + env->ReleaseStringUTFChars(path, cpath); + + return result; // Return 0 if the path exists, -1 otherwise } \ No newline at end of file From 267476cfc04f2ccbe30e018d31891aca63556369 Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Tue, 15 Apr 2025 00:02:48 +0600 Subject: [PATCH 11/17] Update AndroidManifest.xml --- app/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b43ace5..f160127 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,7 +2,7 @@ - + From 458084954f3eeca15b7155214078b9677c5f7ea4 Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Thu, 17 Apr 2025 00:41:31 +0600 Subject: [PATCH 12/17] Delete .github/workflows/android.yml --- .github/workflows/android.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml deleted file mode 100644 index 2f633b6..0000000 --- a/.github/workflows/android.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Android CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: set up JDK 11 - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'temurin' - cache: gradle - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build From ec457570607bf8a7f452ff680e48bff3ae3deb2c Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Thu, 17 Apr 2025 00:41:48 +0600 Subject: [PATCH 13/17] Delete .github/workflows/android.yml.txt --- .github/workflows/android.yml.txt | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/workflows/android.yml.txt diff --git a/.github/workflows/android.yml.txt b/.github/workflows/android.yml.txt deleted file mode 100644 index 2f633b6..0000000 --- a/.github/workflows/android.yml.txt +++ /dev/null @@ -1,26 +0,0 @@ -name: Android CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: set up JDK 11 - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'temurin' - cache: gradle - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build From 8ac74875b7aaa61e13968eb87f72dd397241be49 Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Thu, 17 Apr 2025 00:42:08 +0600 Subject: [PATCH 14/17] Delete .github/workflows/main.yml --- .github/workflows/main.yml | 67 -------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 87d5ecb..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,67 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle - -name: Java CI with Gradle - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. - # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md - - name: Setup Gradle - uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 - - - name: Build with Gradle Wrapper - run: ./gradlew build - - # NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html). - # If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version. - # - # - name: Setup Gradle - # uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 - # with: - # gradle-version: '8.9' - # - # - name: Build with Gradle 8.9 - # run: gradle build - - dependency-submission: - - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. - # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md - - name: Generate and submit dependency graph - uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 From d58020f58d9261e7bcc9665b9a0542acc29a9c3f Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Thu, 17 Apr 2025 15:14:33 +0600 Subject: [PATCH 15/17] Create main.yml --- .github/workflows/main.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ec6a6a7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,32 @@ +package virtual.camera.app.app + +import android.annotation.SuppressLint +import android.app.Application +import android.content.Context +import com.hack.opensdk.HackApplication + +/** + * + * @Description: + * @Author: wukaicheng + * @CreateDate: 2021/4/29 21:21 + */ +class App : HackApplication() { + + companion object { + + @SuppressLint("StaticFieldLeak") + @Volatile + private lateinit var mContext: Context + + @JvmStatic + fun getContext(): Context { + return mContext + } + } + + override fun attachBaseContext(base: Context?) { + super.attachBaseContext(base) + mContext = base!! + } +} From f3879d52f1b9093eefa75f5c373eee03cc7ab4e5 Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Thu, 24 Apr 2025 23:11:21 -0700 Subject: [PATCH 16/17] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec6a6a7..eb7f29d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,8 +8,8 @@ import com.hack.opensdk.HackApplication /** * * @Description: - * @Author: wukaicheng - * @CreateDate: 2021/4/29 21:21 + * @Author: M9nshisf + * @CreateDate: 2025/4/25 21:21 */ class App : HackApplication() { From f0f2e92d0867738dfc74c6fb8f0475c7aa69ef67 Mon Sep 17 00:00:00 2001 From: M9nshisf Date: Thu, 24 Apr 2025 23:18:48 -0700 Subject: [PATCH 17/17] Update main.yml --- .github/workflows/main.yml | 48 +++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eb7f29d..2f633b6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,32 +1,26 @@ -package virtual.camera.app.app +name: Android CI -import android.annotation.SuppressLint -import android.app.Application -import android.content.Context -import com.hack.opensdk.HackApplication +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] -/** - * - * @Description: - * @Author: M9nshisf - * @CreateDate: 2025/4/25 21:21 - */ -class App : HackApplication() { +jobs: + build: - companion object { + runs-on: ubuntu-latest - @SuppressLint("StaticFieldLeak") - @Volatile - private lateinit var mContext: Context + steps: + - uses: actions/checkout@v4 + - name: set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle - @JvmStatic - fun getContext(): Context { - return mContext - } - } - - override fun attachBaseContext(base: Context?) { - super.attachBaseContext(base) - mContext = base!! - } -} + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build