Questions tagged [dalvik]
Dalvik is a virtual machine used by Google's Android operating system.
1,026
questions
0
votes
0
answers
20
views
What is the Memory model of DVM or ART in Android
I could not find any docs related to Memory model of DVM or ART. Since DVM is based on register instead of stack so there should be some difference in Memory Model too.
Please explain the memory model ...
-1
votes
1
answer
299
views
android.content.res.Resources$NotFoundException: Unable to find resource ID #0xffffffff?
I'm trying to repair an old android app that I've been using for years (not the original developer). I've got all the other issues fixed (yay! By pure luck almost) and I'm running into this issue, ...
0
votes
0
answers
199
views
Why we getting user agent as Dalvik instead of android?
On certain Android devices, I receive the user agent as shown below, and on other devices, the user agent is Android. Does this device depend on anything else?
Dalvik/x.x.x (Linux; U; Android x.x.x; &...
1
vote
0
answers
291
views
Why a Scala 2.13 app is trying to use `JavaClassValue` on Android if it is not available, then triggering `java.lang.NoClassDefFoundError`?
I'm running a Scala app on Android using https://github.com/dsvdsv/scala-android-plugin and Scala 2.13.8 and I get these weird stack traces on the logs:
07-19 11:46:26.057 3647 3647 I zygote64: ...
1
vote
1
answer
79
views
Does calling Java's JVM instance-altering functions have any affects in an Android application?
For example, in Java's Locale class documentation it says that Locale.setDefault()
Sets the default locale for this instance of the Java Virtual Machine.
This does not affect the host locale.
Since ...
0
votes
0
answers
246
views
class loaded via dalvik.system.PathClassLoader cannot resolve dependencies on classes in the app
I am loading a class using dalvik.system.PathClassLoader and by reflection creating newInstance from the constructor. This works fine if the loaded class contains only the "standard" java ...
1
vote
0
answers
130
views
why a field named "$r8$clinit" was generated in an interface in its smali code?
I have an interface A.kt like this in an Android app:
interface A {
fun f1(defaultValue: String): String
fun f2(defaultValue: Boolean): Boolean
private class B(context: Context) : A {
...
2
votes
0
answers
125
views
Dalvik crash on Oneplus on Android 12
I've got an app in the play store, and have just started seeing the following crash on crashlytics as we're releasing a new version:
Fatal Exception: java.lang.VerifyError: Verifier rejected class app....
2
votes
2
answers
4k
views
Android - failed to generate Javadoc with Android Studio Bumblebee
I'm trying to generate Javadoc using latest Android Studio via built in tool:
Tools=>Generate Javadoc...
Whatever I choose from a tool's parameters window there are a lot of errors thrown, ...
2
votes
1
answer
479
views
how to locate the register problem in Android after modifying some smali code of an APK?
I would like to add something to an app, so I added some lines to a smali file (decompiled the apk using apktools) and then repackaged and ran it on a real device.
It shows
10121 10211 E ...
1
vote
0
answers
150
views
Problem when update targetSdkVersion to 30 Dalvik, Javafx,
The problem occurs after changing targetSdkVersion to 30 - the application does not start on Android 11 phones (it works properly on others). If I have targetSdkVersion set to 29, everything works ...
1
vote
1
answer
108
views
Why Dalvik register-based, but use stack, what is differnce?
Many articles tell about that Dalvik is register-based VM, but also many articles tell that Dalvik use stack for threads where saved methods and cached variables. Maybe I confuse this with keeping ...
0
votes
1
answer
45
views
Does Dalvik create stacks to manage threads
Unlike JVMs, which are simple stack-based machines, the Dalvik VM uses a register-based — which requires fewer instructions, avoids unnecessary memory access — resulting in better performance code.
...
0
votes
0
answers
124
views
Is there a way to install an Android application by copying files / only modifying the file system?
I was wondering if there is a way to install an Android application by just copying files and making a few changes on the filesystem?
Let's say we have Rooted Phone 1 and Rooted Phone 2. We control ...
2
votes
1
answer
120
views
`java.lang.NoClassDefFoundError: android/view/View` while trying to build 'HelloWorld' project from android-kawa in Termux
I've been trying to employ Kawa Scheme for developing Android project. I've found two repositories on GitHub: one called 'android-kawa', and another called 'KawaDroid'. They're both a bit dated (last ...
5
votes
1
answer
198
views
How come the same static field has two different ids in dalvik?
I'm writing my own toy Dalvik VM, and I can't seem to figure out how dalvik handles inherited static fields.
Consider the following java code:
class Parent { static int parent_int = 10; }
class MyCode ...
1
vote
0
answers
212
views
What does "loading a class" mean with the Android Runtime (ART) when using reflection?
I try to understand the process of ART when using reflection. As it can be seen in the simple example below, the DexClassLoader is used to load a class from the DEX-file. The question now is what is ...
0
votes
1
answer
644
views
Confused about the `move-result-wide` smali instruction
The following smali codes, trying to move a 64-bit result to the register v4. But the size of the v4 is 32-bit. So how does the v4 store the value?
invoke-virtual {v0}, Landroid/location/Location;->...
0
votes
1
answer
110
views
Can I rebuild the Dalvik VM for my Android device?
I am wishing to rebuild the Dalvik VM on my android device for my application analysis work. Specifically, I want when I run an apk file on my android device if it makes an HTTP connection to a ...
3
votes
0
answers
144
views
Android Exception in FingerprintService
dalvik.system.VMStack.getThreadStackTrace VMStack.java, line -2
android.os.RemoteException: Remote stack trace: at com.android.server.fingerprint.FingerprintService.isForegroundActivity(...
0
votes
1
answer
813
views
Is it possible to run classes.dex without apk in Android Runtime like Dalvik?
I know how to run classes.dex on DalvikVM via adb using command adb shell dalvikvm -cp /sdcard/App.zip HelloWorld where App.zip contains classes.dex, or adb shell app_process -Djava.class.path=/sdcard/...
0
votes
1
answer
418
views
Start Android Java VM from native C code NDK (ffmpeg mediacodec use)
I managed to cross-compile ffmpeg using the NDK for armv8a api 27 with MediaCodec hardware acceleration support.
Using root after setting permissions, folders and setting properly LD_LIBRARY_PATH etc. ...
0
votes
1
answer
49
views
Which component passes the events and intents to our application if not zygote?
I am confused of how the actual lifecycle flow is implemented.
When a user clicks on an application icon, that click goes to a special application called Zygote which then forks a new process for the ...
1
vote
0
answers
248
views
Accessing parts of odex file dynamically
I want to access parts of the odex file of my android app. Better yet, the odex file of another application ( when it has for example configured my app permitting access to its odex file). From what I'...
1
vote
1
answer
198
views
Why command line dalvikvm uses standard Java security libraries (keystore) instead of using the Android version
I am performing an experiment: using Android keystore in a command-line Java application. I have an Activity hello world example of the keystore:
https://github.com/phanirajabhandari/android-keystore-...
0
votes
1
answer
872
views
programmatically / dynamically include classes.dex into jar file
I am looking for a way to programmatically load some classes and other files from a jar file into my Android application at its runtime.
The purpose of this is, so the functionality of the application ...
3
votes
1
answer
747
views
Java GC: How does Java GC clears WeakReference object?
First of all I want to let you know that this is more theoretical question than practical, I'm just curious how weakly referenced objects are deallocated. Let's quickly remember what weak reference is ...
3
votes
0
answers
3k
views
Smali: modify methods to return True
I've been struggling reverse engineering an apk for a few hours and now I think I'm stuck.
I have a few methods to modify in order to always return True. For one I managed to simply set a constant an ...
1
vote
1
answer
236
views
dalvik bytecode verification - dex2oat
I have instrumented an app at bytecode level and getting the following verification error from dex2oat:
2020-09-23 19:39:04.005 4864-4864/? W/dex2oat: Verification error in int a.d.cg.b(byte[], int, ...
0
votes
1
answer
122
views
E/dalvikvm: JNI ERROR (app bug): local reference table overflow (max=512)
I made an app that simply read data with NFC and writes back the data after modification. After tapping card for about 100 times, the newIntent is not being registered and I'm getting this in logcat
...
1
vote
0
answers
484
views
Android JNI retrieve current number of local references?
I'm aware of the fact that you can dump the local reference table using the method illustrated here.
jclass vm_class = env->FindClass("dalvik/system/VMDebug");
jmethodID dump_mid = env-&...
0
votes
2
answers
183
views
Android Multidex method invocation
I have a question regarding Multidex in Android. Given an application that consists of multiple Dex files (classes.dex, classes2.dex), how does invocation work in the bytecode?
Since the methods IDs ...
1
vote
0
answers
1k
views
How do you use the framework.jar from a target system in AndroidStudio?
I want to develop an application, in AndroidStudio, for a target system with a custom /system/app/framework.jar
The SDK for JellyBean 4.2, in ...\Android\Sdk\platforms\android-17 has an
android....
1
vote
0
answers
118
views
Class loader subsystem in Dalvik and ART
From all the google I/O and blogs that I have read on Dalvik and ART I get to know info on how Dalvik is different from JVM in terms of ability to run multiple VMs, how JIT and AOT compiler makes ...
1
vote
0
answers
324
views
Dalvik bytecode and compare to 0 jumps
In dalvik, there is no ifnull or ifnonnull like in java bytecode. There is only if-eqz and if-nez. They can be used to compare int values to (int) 0, or object values to (Object) null. Is it also ...
0
votes
2
answers
218
views
Determine which garbage collection (ART, Dalvik...) is used on my Android phone?
I am currently exploring garbage collection on Android. I want to know which garbage collection exactly (ART or Dalvik or whatever else) is used on my phone (Pixel 2, Android 10) so I can read up on ...
1
vote
1
answer
208
views
Running into LinearAlloc overflows midway through integration tests
This is for a largish 3-4 year running Android project, running on Gradle 5.4.1. Integration testing is with Mockito, espresso and dagger.
I have run into an issue where we are adding a Pendo library ...
1
vote
1
answer
896
views
Why one more parameter is passed in a method in smali code
In a piece of smali code that I decoded via apktool, I found a method call passes one more argument than these are declared in then method definition. That extra argument is definitely not used at all....
0
votes
0
answers
61
views
Android - Dalvik virtual machine processes
I would like to investigate the behavior of processes on a dalvik virtual machine. I wonder if I can run the machine itself on a linux environment? How to manage such a machine? Can new processes be ...
2
votes
2
answers
197
views
Storing MongoDB database credentials inside Android app
I have developed an android app that directly interacts with the MongoDB for insertion and fetching the data.
I have credentials stored inside a config file of android app that I read inside the app.
...
0
votes
1
answer
1k
views
Smali invoke-virtual/range for String
I am studying the smali code from my decompiled apk. I am not used to this but I am getting the hang of it. I have now been stuck for some time at this line:
invoke-virtual/range {p1 .. p1}, Ljava/...
0
votes
1
answer
104
views
When this new Thread() is GC'ed in Android?
I'm having a util class where I'm trying to write to secure setting like,
public static void putIntInSS(final ContentResolver resolver, final String key,
...
1
vote
0
answers
4k
views
How to fix 'org.gradle.api.tasks.TaskExecutionException: Execution failed for task :app:mergeExtDexDebug' in Android Studio?
I'm updating my app to androidx, but I got this error when trying to build the app with the new Android Studio:
Multiple annotations of type `dalvik.annotation.EnclosingClass`
I used the Migrate to ...
0
votes
1
answer
2k
views
What are the purpose of checksum and signature in android dex file header?
As we know, all android dex file has a dex file header located at the beginning of the dex file which can be described as DexHeader, but why are there checksum and signature, what are the purpose of ...
2
votes
2
answers
2k
views
Compiling Kotlin file to Dex generates ClassNotFoundException (kotlin.jvm.internal.Intrinsics)
I'm trying to create a command line script to run on my Android device. I'm following this answer to run the compiled kotlin file with Dalvik VM, but I'm getting the following error when I run ...
1
vote
1
answer
85
views
Why my application suddenly getting stopped? [duplicate]
My apps unfortunately stopped after right I put the OnClickListener
My problem shows :
at com.example.whatisthat.Dashboard.onCreate(Dashboard.java:23)
Error :
LoginBtn.setOnClickListener(this);
...
3
votes
1
answer
327
views
Questions about using the smali library
I have a smali file and I want to know how to convert the smali file into an org.jf.dexlib2.iface.ClassDef object via the smali library.
I have an idea now: The dex file of the smali file will be ...
3
votes
2
answers
604
views
How to swap method bodies under Android
In pure Java, using intrumentation and java agents, there is a way to replace the body of a method at runtime.
Unfrotunately java.lang.instrument.Instrumentation is not available under Android.
I ...
0
votes
1
answer
391
views
Dalvik bytecode instrumentation - register type merging
I am doing some sort of dalvik bytecode instrumentation using dexlib2.
However, there are a couple of remaining issues.
The register type merging that seems to happen after goto instructions
and catch ...
0
votes
1
answer
239
views
Format of .dex files for Android 2.1 (Eclair), i.e. API level 7
I'm writing an assembler for Android/Dalvik .dex files. The official Android docs seem to only describe the newest version of the .dex format (apparently 038 as of May 2019), with a few short notes ...