apply plugin: 'com.android.application' //apply plugin: 'com.android.library' android { namespace "com.pdlive.plugins" compileSdk rootProject.ext.android.compileSdkVersion packagingOptions { pickFirst "lib/armeabi/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/armeabi-v7a/libyuvutils.so" pickFirst "lib/armeabi/libyuvtools.so" pickFirst "lib/arm64-v8a/libyuvtools.so" pickFirst "lib/armeabi-v7a/libyuvtools.so" exclude "lib/arm64-v8a/libmmcv_api_handgesture.so" exclude "lib/arm64-v8a/libmmcv_api_express.so" exclude "lib/arm64-v8a/libMediaEncoder.so" exclude "lib/arm64-v8a/libarcore_sdk_c.so" exclude "lib/arm64-v8a/libmediadecoder.so" exclude "lib/arm64-v8a/libMediaMuxer.so" exclude "lib/arm64-v8a/libarcore_sdk_jni.so" exclude "lib/arm64-v8a/libMediaUtils.so" exclude "lib/arm64-v8a/libcosmosffmpeg.so" //旧美颜so exclude 'lib/arm64-v8a/libxeengine.so' exclude 'lib/arm64-v8a/libmmcv_base.so' exclude 'lib/arm64-v8a/libmmcrypto.so' exclude 'lib/arm64-v8a/libMNN.so' exclude 'lib/arm64-v8a/libc++_shared.so' exclude 'lib/arm64-v8a/libmmcv_api_base.so' exclude 'lib/arm64-v8a/libmmcv_api_beauty.so' exclude 'lib/arm64-v8a/libmmcv_api_bodylandmark.so' exclude 'lib/arm64-v8a/libmmcv_api_express.so' exclude 'lib/arm64-v8a/libmmcv_api_faceattributes.so' exclude 'lib/arm64-v8a/libmmcv_api_facefeatures.so' exclude 'lib/arm64-v8a/libmmcv_api_faceprocessor.so' exclude 'lib/arm64-v8a/libmmcv_api_facerecognition.so' exclude 'lib/arm64-v8a/libmmcv_api_handgesture.so' exclude 'lib/arm64-v8a/libmmcv_api_imagequality.so' exclude 'lib/arm64-v8a/libmmcv_api_objectdetect.so' exclude 'lib/arm64-v8a/libmmcv_api_segmentation.so' exclude 'lib/arm64-v8a/libmmcv_api_videoprocessor.so' exclude 'lib/arm64-v8a/libmmlic.so' exclude 'lib/arm64-v8a/libMNN_CL.so' exclude 'lib/arm64-v8a/libMNN_Express.so' exclude 'lib/armeabi-v7a/libxeengine.so' exclude 'lib/armeabi-v7a/libmmcv_base.so' exclude 'lib/armeabi-v7a/libmmcrypto.so' exclude 'lib/armeabi-v7a/libMNN.so' exclude 'lib/armeabi-v7a/libc++_shared.so' exclude 'lib/armeabi-v7a/libmmcv_api_base.so' exclude 'lib/armeabi-v7a/libmmcv_api_beauty.so' exclude 'lib/armeabi-v7a/libmmcv_api_bodylandmark.so' exclude 'lib/armeabi-v7a/libmmcv_api_express.so' exclude 'lib/armeabi-v7a/libmmcv_api_faceattributes.so' exclude 'lib/armeabi-v7a/libmmcv_api_facefeatures.so' exclude 'lib/armeabi-v7a/libmmcv_api_faceprocessor.so' exclude 'lib/armeabi-v7a/libmmcv_api_facerecognition.so' exclude 'lib/armeabi-v7a/libmmcv_api_handgesture.so' exclude 'lib/armeabi-v7a/libmmcv_api_imagequality.so' exclude 'lib/armeabi-v7a/libmmcv_api_objectdetect.so' exclude 'lib/armeabi-v7a/libmmcv_api_segmentation.so' exclude 'lib/armeabi-v7a/libmmcv_api_videoprocessor.so' exclude 'lib/armeabi-v7a/libmmlic.so' exclude 'lib/armeabi-v7a/libMNN_CL.so' exclude 'lib/armeabi-v7a/libMNN_Express.so' } applicationVariants.all { variant -> String variantName = variant.name.capitalize() def processManifestTask = project.tasks.getByName("process${variantName}Manifest") processManifestTask.doLast { pm -> String manifestPath = "build/intermediates/bundle_manifest/release/bundle-manifest/AndroidManifest.xml" def isGooglePlay = rootProject.ext.manifestPlaceholders.isGooglePlay if (file(manifestPath).exists() && isGooglePlay) { def manifestContent = file(manifestPath).getText() manifestContent = manifestContent.replace('', '') file(manifestPath).write(manifestContent) } else { print "not Exists = " + manifestPath } } variant.mergeAssetsProvider.configure { doLast { delete(fileTree(dir: outputDir, includes: [ 'model/ai_bgseg_green.bundle', 'model/ai_face_processor.bundle', //'model/ai_face_processor_lite.bundle', 'model/ai_hairseg.bundle', 'model/ai_hand_processor.bundle', 'model/ai_human_processor.bundle', 'model/ai_human_processor_gpu.bundle', 'model/ai_human_processor_mb_fast.bundle', 'graphics/body_slim.bundle', 'graphics/controller_cpp.bundle', //'graphics/face_beautification.bundle', 'graphics/face_makeup.bundle', 'graphics/fuzzytoonfilter.bundle', 'graphics/fxaa.bundle', 'graphics/tongue.bundle', //旧美颜 'model-all.zip', 'filterData.zip', 'KSYResource/*', 'Resources/*', 'Asset/*', 'image_effect_shaders/*', 'internal/*', ])) } } } defaultConfig { applicationId "com.pdlive.plugins" minSdkVersion rootProject.ext.android.minSdkVersion targetSdkVersion rootProject.ext.android.targetSdkVersion versionCode rootProject.ext.android.versionCode versionName rootProject.ext.android.versionName manifestPlaceholders = rootProject.ext.manifestPlaceholders ndk { abiFilters "armeabi-v7a", "arm64-v8a" } } aaptOptions { cruncherEnabled = false useNewCruncher = false } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_18 targetCompatibility JavaVersion.VERSION_18 } sourceSets { main { jniLibs.srcDirs = ['libs'] } } } repositories { flatDir { dirs 'libs', '../libs' } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.faceunity:core:8.3.1' implementation 'com.faceunity:model:8.3.1' //implementation 'com.faceunity:nama:8.3.1' //底层库-标准版 }