Comments (6)
Currently using a very annoying workaround where I strip the duplicated classes from the aar file, and then include it as a local dependency:
# Download original
curl http://central.maven.org/maven2/com/facebook/conceal/conceal/2.0.2/conceal-2.0.2.aar > conceal-2.0.2.aar
# Unpack aar
unzip conceal-2.0.2.aar -d temp-folder
# Strip duplicate so files
rm jni/*/libfb.so
# Unpack classes
cd temp-folder
unzip classes.jar -d temp-folder
# Strip duplicate classes
rm -r temp-folder/com/facebook/{jni,proguard,soloader}
# Pack classes
jar cvf classes.jar -C temp-folder/ .
rm -r temp-folder
# Pack aar
cd ..
jar cvf conceal-2.0.2-stripped.aar -C temp-folder/ .
rm -r temp-folder
from conceal.
configurations {
repack { transitive = false }
}
ext.concealVersion = "2.0.2"
dependencies {
/* https://github.com/facebook/conceal/releases */
repack "com.facebook.conceal:conceal:${concealVersion}"
}
task repackConcealv2(dependsOn: configurations.repack) {
def generation = "${project.buildDir}/intermediates/repack"
def conceal = "com.facebook.conceal@${concealVersion}"
def destination = "${generation}/${conceal}"
doLast {
copy {
from { zipTree(configurations.repack.singleFile) }
into "${destination}"
}
copy {
from zipTree("${destination}/classes.jar")
into "${destination}/classes"
}
}
task recreateConcealAarv2(type: Zip) {
archiveFileName = "com.facebook.conceal-${concealVersion}-patched.aar"
destinationDirectory = file("${generation}")
from("${destination}") {
exclude '**/jni/*/libfb.so'
exclude '**/classes'
exclude 'classes.jar'
rename('classes-patched.jar', 'classes.jar')
}
}
task recreateConcealClassesJarv2(type: Zip) {
archiveFileName = "classes-patched.jar"
destinationDirectory = file("${destination}")
from("${destination}/classes") {
exclude '**/facebook/jni/'
exclude '**/facebook/proguard/'
exclude '**/facebook/soloader/'
}
finalizedBy recreateConcealAarv2
}
finalizedBy recreateConcealClassesJarv2
}
preBuild.dependsOn(repackConcealv2)
dependencies {
implementation fileTree(dir: "${project.buildDir}/intermediates/repack", include: ["*-patched.aar"])
}
Outputs:
.
├── com.facebook.conceal-2.0.2-patched.aar
└── [email protected]
├── AndroidManifest.xml
├── aidl
├── assets
├── classes
│ └── com
│ └── facebook
│ ├── android
│ │ └── crypto
│ │ └── keychain
│ │ ├── AndroidConceal.class
│ │ ├── AndroidCryptoLibrary.class
│ │ ├── SecureRandomFix$LinuxPRNGSecureRandom.class
│ │ ├── SecureRandomFix$LinuxPRNGSecureRandomProvider.class
│ │ ├── SecureRandomFix$LocalSecureRandom.class
│ │ ├── SecureRandomFix.class
│ │ └── SharedPrefsBackedKeyChain.class
│ ├── cipher
│ │ ├── Cipher$DecryptStream.class
│ │ ├── Cipher$EncryptStream.class
│ │ ├── Cipher.class
│ │ ├── IntegrityException.class
│ │ ├── Mac$DecryptStream.class
│ │ ├── Mac$EncryptStream.class
│ │ ├── Mac.class
│ │ └── jni
│ │ ├── CipherHybrid.class
│ │ ├── DecryptHybrid.class
│ │ ├── EncryptHybrid.class
│ │ ├── MacDecoderHybrid.class
│ │ ├── MacEncoderHybrid.class
│ │ └── PBKDF2Hybrid.class
│ ├── crypto
│ │ ├── BuildConfig.class
│ │ ├── CheckedKeyChain.class
│ │ ├── Conceal.class
│ │ ├── Crypto.class
│ │ ├── CryptoConfig.class
│ │ ├── Entity.class
│ │ ├── MacConfig.class
│ │ ├── VersionCodes.class
│ │ ├── exception
│ │ │ ├── CryptoInitializationException.class
│ │ │ └── KeyChainException.class
│ │ ├── keychain
│ │ │ └── KeyChain.class
│ │ ├── keygen
│ │ │ └── PasswordBasedKeyDerivation.class
│ │ ├── proguard
│ │ │ └── annotations
│ │ │ ├── DoNotStrip.class
│ │ │ ├── InternalBuildOnly.class
│ │ │ └── KeepGettersAndSetters.class
│ │ ├── streams
│ │ │ ├── BetterCipherInputStream.class
│ │ │ └── TailInputStream.class
│ │ └── util
│ │ ├── Assertions.class
│ │ ├── NativeCryptoLibrary.class
│ │ └── SystemNativeCryptoLibrary.class
│ ├── jni
│ │ ├── Countable.class
│ │ ├── CpuCapabilitiesJni.class
│ │ ├── DestructorThread$1.class
│ │ ├── DestructorThread$Destructor.class
│ │ ├── DestructorThread$DestructorList.class
│ │ ├── DestructorThread$DestructorStack.class
│ │ ├── DestructorThread$Terminus.class
│ │ ├── DestructorThread.class
│ │ ├── HybridClassBase.class
│ │ ├── HybridData$Destructor.class
│ │ ├── HybridData.class
│ │ ├── IteratorHelper.class
│ │ ├── JniTerminateHandler.class
│ │ ├── MapIteratorHelper.class
│ │ ├── NativeRunnable.class
│ │ └── ThreadScopeSupport.class
│ ├── proguard
│ │ └── annotations
│ │ ├── DoNotStrip.class
│ │ └── KeepGettersAndSetters.class
│ └── soloader
│ ├── Api18TraceUtils.class
│ ├── ApkSoSource$ApkUnpacker.class
│ ├── ApkSoSource.class
│ ├── DirectorySoSource.class
│ ├── DoNotOptimize.class
│ ├── Elf32_Dyn.class
│ ├── Elf32_Ehdr.class
│ ├── Elf32_Phdr.class
│ ├── Elf32_Shdr.class
│ ├── Elf64_Dyn.class
│ ├── Elf64_Ehdr.class
│ ├── Elf64_Phdr.class
│ ├── Elf64_Shdr.class
│ ├── ExoSoSource$1.class
│ ├── ExoSoSource$ExoUnpacker$FileBackedInputDsoIterator.class
│ ├── ExoSoSource$ExoUnpacker.class
│ ├── ExoSoSource$FileDso.class
│ ├── ExoSoSource.class
│ ├── ExtractFromZipSoSource$1.class
│ ├── ExtractFromZipSoSource$ZipDso.class
│ ├── ExtractFromZipSoSource$ZipUnpacker$ZipBackedInputDsoIterator.class
│ ├── ExtractFromZipSoSource$ZipUnpacker.class
│ ├── ExtractFromZipSoSource.class
│ ├── FileLocker.class
│ ├── MergedSoMapping.class
│ ├── MinElf$ElfError.class
│ ├── MinElf.class
│ ├── NativeLibrary.class
│ ├── NoopSoSource.class
│ ├── SoFileLoader.class
│ ├── SoLoader$1.class
│ ├── SoLoader$Api14Utils.class
│ ├── SoLoader$WrongAbiError.class
│ ├── SoLoader.class
│ ├── SoSource.class
│ ├── SysUtil$LollipopSysdeps.class
│ ├── SysUtil.class
│ ├── SystemLoadLibraryWrapper.class
│ ├── UnpackingSoSource$1.class
│ ├── UnpackingSoSource$Dso.class
│ ├── UnpackingSoSource$DsoManifest.class
│ ├── UnpackingSoSource$InputDso.class
│ ├── UnpackingSoSource$InputDsoIterator.class
│ ├── UnpackingSoSource$Unpacker.class
│ └── UnpackingSoSource.class
├── classes-patched.jar
├── classes.jar
├── jni
│ ├── arm64-v8a
│ │ ├── libconcealjni.so
│ │ └── libfb.so
│ ├── armeabi
│ │ ├── libconcealjni.so
│ │ └── libfb.so
│ ├── armeabi-v7a
│ │ ├── libconcealjni.so
│ │ └── libfb.so
│ ├── x86
│ │ ├── libconcealjni.so
│ │ └── libfb.so
│ └── x86_64
│ ├── libconcealjni.so
│ └── libfb.so
├── libs
└── res
from conceal.
Any Update on this..?
from conceal.
@OleksandrKucherenko , I followed your approach but after that native library loading is failing.
Throwing "libconcealjni.so" file is not found. Did you face any such issue..?
from conceal.
Throwing "libconcealjni.so" file is not found. Did you face any such issue..?
Yes, I saw that before... it happens due to the not properly found @aar file.
The workaround is to divide the build process into two steps:
- repack and compose a patched aar
- copy patched aar into project folder and include it directly (issue is in gradle android plugin that cannot recognize aar archive, it only understands well JARs)
from conceal.
We had patched the aar according to @LinusU. But still facing the error. By the way, we are using conceal 2.0.2
from conceal.
Related Issues (20)
- Why not think about using the cpu feature like ANDROID_CPU_ARM64_FEATURE_AES?
- Native Crash!!! HOT 6
- [Question] Password based key derivation usage HOT 5
- native crash and app can't pickup the exception,Can this exception wrap with java exception,then i can catch it
- native crash on Samsung HOT 1
- README.md refers to deprecated crypto.getCipherOutputStream
- What do I need to know in order to encrypt elsewhere for Conceal to decrypt? HOT 3
- The speed of decrypting the file is twice faster than the speed of encrypting the same file
- How to save encrypted file to internal folder ?
- App crashed in native method
- Conflicts using in React Native project due to com.facebook.jni.DestructorThread HOT 3
- showing NoSuchMethodException on Android P when initialing the SoLoader HOT 10
- Incompatibility with the Facebook library Flipper
- Subpar PBKDF2 performance
- PHP Implementation HOT 1
- signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) Native Crash in Google Play Console HOT 5
- App crashes when running as 64 bit version: `libfb.so is 64-bit instead of 32-bit` HOT 1
- Fatal signal 11 (SIGSEGV), code 2 upon file decryption.
- Native crash (conceal version 2.0.2) java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfb.so HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conceal.