Android App Digital Persona couldn't find "libdpfr6.so" - android

I am developing an Android App that uses fingerprint reader Digital Persona 4500 UareU.
When I trying to get the readers I get this error:
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError:
dalvik.system.PathClassLoader[DexPathList
[[zip file "/data/app/com.zaimella.enrollment-1/base.apk"],
nativeLibraryDirectories=[
/data/app/com.zaimella.enrollment-1/lib/arm,
/system/lib,
/vendor/lib]]]
couldn't find "libdpfr6.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:984)
at java.lang.System.loadLibrary(System.java:1567)
at com.digitalpersona.uareu.jni.Dpfpdd.<init>(Dpfpdd.java:43)
at com.digitalpersona.uareu.dpfpdd.ReaderCollectionImpl.<init>(ReaderCollectionImpl.java:24)
at java.lang.Class.newInstance(Native Method)
at com.digitalpersona.uareu.UareUGlobal.GetReaderCollection(UareUGlobal.java:39)
Please HELP !!!
Thanks.

The SOLUTION !!!
1.- Install DigitalPersona SDK
2.- Get jniLibs from the installation: DigitalPersona\U.are.U SDK\Android\bin\android-21
3.- You must include the jniLibs folder into your project. See picture 1
4.- Build -> Make Project
5.- Be sure that jniLibs are included into your apk file. See picture 2
6.- Install the App using "adb install"
7.- BE HAPPY !!!
jniLibs folder into your project
jniLibs folder into your apk file

Related

Trying to build PDF reader using MuPDF library, app crashing while opening PDF

Good Day,
I'm trying to build PDF reader using MuPDF.
Everytime when I try opening pdf in app its showing libmupdf_java.so not found and application crashed. I'm using mupdf.aar bundle, I opened bundle & checked found libmupdf_java.so in it.
created jniLibs folder in main & copied armeabi-v7a & x86 .so files in it but still facing same issue. How to sort it? I'm stuck here from many weeks. please help me.
I'm using samsung S10+ for android app simulation.
LOGCAT
2022-05-17 17:32:25.140 7620-7620/ak.wp.meto E/AndroidRuntime: FATAL EXCEPTION: main
Process: ak.wp.meto, PID: 7620
java.lang.UnsatisfiedLinkError: dlopen failed: library "libmupdf_java.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
at java.lang.System.loadLibrary(System.java:1664)
at com.artifex.mupdfdemo.MuPDFCore.<clinit>(MuPDFCore.java:15)
enter image description here
You add them to jniLibs directory under src/main. And it will work.

Nondeterministic class loading problem in jar library of android cordova plugin

I am developing an Android Cordova plugin with local JAR libraries.
The JAR libraries are copied by Cordova into my app/libs folder (following the answer to this question: How do I properly include an external jar file for a cordova plugin?)
The Cordova app builds and runs but one class (ContextFactory), which is present in a local JAR file, fails to load:
java.io.IOException: Can't read Device Description(Provider ae.com.sun.xml.bind.v2.ContextFactory
not found / Cause: java.lang.ClassNotFoundException: Didn't find class
"ae.com.sun.xml.bind.v2.ContextFactory" on path: DexPathList[[directory
"."],nativeLibraryDirectories=[/system/lib, /system/vendor/lib, /system/lib, /system/vendor/lib]]
At first, I had the plugin run in the standard WebCore thread. After switching to a seperate thread (via cordova.getThreadPool().execute()) the class sometimes loads (non-deterministically) but only when I debug with several break points active.
By debugging into the relevant place (java.lang.ClassLoader), the AndroidStudio debugger informs me that the classLoader is
dalvik.system.PathClassLoader[DexPathList[[directory "."],nativeLibraryDirectories=[/system/lib, /system/vendor/lib, /system/lib, /system/vendor/lib]]]
More specifically, in the AndroidStudio-decompiled bytecode of (java.lang.ClassLoader from SDK Android 29), the method call
url = findResource(name); (line 793) finds a resource non-deterministically. If url remains null, the exception will be thrown, if a url is found, the class loads successfully. (url in the good case evaluates to jar:file:/data/app/name.of.my.app-1/base.apk!/META-INF/services/ae.javax.xml.bind.JAXBContext where ae.javax.xml.bind.JAXBContext is another class in the JAR file)
I assume that the "." directory refers to /app/ and so I wonder if I have to configure my project to include /app/libs/ somehow as well. If so, how can I do that?
Apparently, the library can be loaded if I run the plugin on the UI thread. cordova.getActivity().runOnUiThread()

Error at installing my app on mobile for testing

my package name is com.example.project name but to upload it on google console for publishing it.I change it to com.ahsan.project name, now when i am trying to run it on my mobile it is showing me this error....
already have tried to revert back to old changes but it is not working.still getting the same result.
Run Window
Unknown failure: Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown package: com.example.ethlon
at com.android.server.pm.Settings.getInstallerPackageNameLPr(Settings.java:5051)
at com.android.server.pm.PackageManagerService.getInstallerPackageName(PackageManagerService.java:27786)
at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:27792)
at com.android.server.pm.PackageManagerService.deletePackageVersioned(PackageManagerService.java:23919)
at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:993)
at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:912)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:134)
at android.os.ShellCommand.exec(ShellCommand.java:96)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:28572)
at android.os.Binder.shellCommand(Binder.java:581)
at android.os.Binder.onTransact(Binder.java:481)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:3209)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:5078)
at android.os.Binder.execTransact(Binder.java:682)
Error while Installing APKs
this error happen because
your package name not the same in all project
search and update your package to be the same
Most of the time this error came due to Changes in file location in Project folder.
To solve this problem you just have to open whole project again as a new Project.
Steps-
File-Export To Zip File (save as new zip file).
Unzip the zip file.
Go to Open and select the location of unzip file.
Now try to run app on device.

how to execute the baksmali.jar in an android device

For the purpose of developing an Anti-malware on Android, I need to have the smali representation of an APK.
I'm trying to execute the the baksmali.jar directly on the device. I asked the author of the tool GitHub: Executing baksmali on an Android device.
I followed the steps according to the post
Stack overflow: How to execute the dex file in android with command?
I downloaded the v2.2b4 version
dx --dex --output=classes.dex baksmali.jar I used the dx tool from android/Sdk/build-tools/25.0.2
zip baksmali.zip classes.dex
adb push baksmali.zip /sdcard/ I'm using a genymotion emulator custom phone-4.4.4 API 19
adb shell mkdir /sdcard/dalvik-cache
adb shell ANDROID_DATA=/sdcard dalvikvm -cp /sdcard/baksmali.zip org.jf.baksmali.Main
After that, I'm getting this error message Unable to locate class 'org/jf/baksmali/Main'
Precisely
Unable to locate class 'org/jf/baksmali/Main'
java.lang.NoClassDefFoundError: org/jf/baksmali/Main
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jf.baksmali.Main" on path: DexPathList[[zip file "/sdcard/baksmali.zip"],nativeLibraryDirectories=[/system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
... 1 more
Suppressed: java.io.IOException: unable to open DEX file
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:296)
at dalvik.system.DexFile.<init>(DexFile.java:80)
at dalvik.system.DexFile.<init>(DexFile.java:59)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:263)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:230)
at dalvik.system.DexPathList.<init>(DexPathList.java:112)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:38)
at java.lang.ClassLoader.createSystemClassLoader(ClassLoader.java:116)
at java.lang.ClassLoader.access$000(ClassLoader.java:65)
at java.lang.ClassLoader$SystemClassLoader.<clinit>(ClassLoader.java:81)
at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:125)
... 1 more
I don't understand this error, the classe path is correct.
How can I fix this ?
Thank you in advance.
After moving around, I finally found the solution to the following problem:
" execute the baksmali.jar in an android device, ideally the execution is launched by an application targeting another application."
So, lets say we wont to develop an application that is able to "baksmali" (disassemble) another application, without requiring any special permission.
These are the steps to get the job done:
download the baksmali.jar v1.2.3
add the jar to the app/libs directory of the android studio project
right click on the jar and select the option "Add it as a Library"
(use the "Project->project" view to see the libs directory, you may not see it in the "Project->android" view)
you can use the org.jf.baksmali.main.mainmethode by passing the CLIarguments to that method using a String[]
Here is a helloWorld App illustrating the use cas:
GitHub: Baksmali Hello world
After launchig the application you should see folders in the /data/data/com.example.bartman.baksmalihelloworld/<name_of_baksmali_output>

error when unzip apk file in ant

I use ant to unzip an apk file, but it occurred an error like this:
<unzip src="test.apk" dest="testdir" >
error message:
java.lang.RuntimeException: data starting at 0 is in unknown format
i googled it, and add attribute encoding="native-encoding" , it still error.
great thanks for any help!
ok,finally I wrote a custom ant task using java ziputil to unzip an apk files. It does work well.

Categories

Resources