Files
FridaBox/Bcore/build.gradle
T
vivek 8051eddc97 fix: Android 15+ network, anti-detect bypass, Windows AIDL build
1. Network permission fix (Android 15/16):
   - Add NetworkPermissionCompat to disable framework permission cache
   - Hook checkPermission/checkPermissionForDevice in IActivityManagerProxy
   - Grant INTERNET and related network permissions for virtual apps
   - Fixes WebView blockedNetworkLoads on Android 15+

2. Anti-virtual-detection bypass:
   - Skip known anti-detect ContentProviders in BActivityThread.installProviders()
   - Covers Meituan HadesContentProvider (com.ztuni), Douyin SecurityGuard, etc.
   - App continues running instead of calling System.exit()

3. Windows AIDL build fix:
   - Strip AIDL-generated 'Using:' comment lines that contain backslash paths
   - Prevents Java compiler 'illegal Unicode escape' error on Windows

Refs: fixes #44 (partial)
2026-07-04 22:51:41 +08:00

114 lines
3.0 KiB
Groovy

apply plugin: 'com.android.library'
android {
namespace 'top.niunaijun.blackbox'
compileSdk rootProject.ext.compileSdkVersion
aidlPackagedList "android/app/IServiceConnection.aidl"
aidlPackagedList "android/accounts/IAccountManagerResponse.aidl"
buildFeatures {
aidl true
}
buildFeatures {
prefab true
}
defaultConfig {
minSdkVersion rootProject.ext.minSdk
consumerProguardFiles "consumer-rules.pro"
ndk {
abiFilters 'arm64-v8a' , 'armeabi-v7a'
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
ndkBuild {
path 'src/main/cpp/Android.mk'
}
ndkVersion = "29.0.13846066"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:-deprecation" << "-Xlint:-unchecked" << "-Xlint:-rawtypes"
options.fork = true
options.forkOptions.jvmArgs << "-Xmx2048m"
}
testOptions {
unitTests.returnDefaultValues = true
}
packagingOptions {
jniLibs {
useLegacyPackaging true
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
warningsAsErrors false
disable "UnusedResources", 'RestrictedApi'
textOutput "stdout"
textReport false
checkOnly 'NewApi', 'InlinedApi'
}
}
// Strip the AIDL-generated "Using: ..." comment line which contains backslash sequences
// that Java's compiler mis-parses as Unicode escapes on Windows paths.
tasks.matching { it.name.startsWith('compileReleaseJavaWithJavac') || it.name.startsWith('compileDebugJavaWithJavac') }.all {
doFirst {
def aidlOut = file("$buildDir/generated/aidl_source_output_dir")
if (aidlOut.exists()) {
aidlOut.eachFileRecurse { f ->
if (f.name.endsWith('.java')) {
def content = f.text
if (content.contains(' * Using:')) {
content = content.replaceAll(/(?m)^ \* Using:.*$/, '')
f.text = content
}
}
}
}
}
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
implementation 'com.google.android.material:material:1.3.0'
implementation(project(":black-reflection"))
annotationProcessor(project(":compiler"))
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.moandjiezana.toml:toml4j:0.7.2'
implementation 'com.github.tiann:FreeReflection:3.2.2'
}