dalvik

Why stack-based VM? Why not queue-based VM?

╄→гoц情女王★ 提交于 2019-12-08 08:51:00
问题 As I investigated, there are 2 major ways to implement process VM: stack-based, such as JVM, CLR, etc. or register-based, such as Lua, Dalvik, etc. Register-based approach mimics the architecture of physical processors. But for the stack-based approach, there are many other data structures. I think which approach to choose mainly depends on how we want to store/fetch operands. So why choose stack? How about queue-based VM? Or other options such as linked list? 回答1: StackOverflow is really not

using libssl.so in native Android app

谁说我不能喝 提交于 2019-12-08 03:38:01
问题 I'm writing a native lib (mylib.so) for Android, using the NDK. Mylib.so depends on libssl.so. The Android NDK doc tells me I shouldn't use libssl.so from system/lib, because it's not part of the stable API. Instead I should cross-compile libssl myself and add it to the NDK. But I see that mylib.so get automatically linked with system/lib/libssl.so because the dalvik vm (which is loading mylib.so) already depends on libssl.so. $ readelf -d /system/bin/dalvikvm | grep Shared 0x00000001 (NEEDED

Android recommended way of safely supporting newer apis has error if the class implements a newer interface. Why?

孤者浪人 提交于 2019-12-07 16:14:13
问题 In order to support different Api Levels, I am using the technique described here: http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html Here is the example from the article: public static VersionedGestureDetector newInstance(Context context, OnGestureListener listener) { final int sdkVersion = Integer.parseInt(Build.VERSION.SDK); VersionedGestureDetector detector = null; if (sdkVersion < Build.VERSION_CODES.ECLAIR) { detector = new CupcakeDetector(); }

Android Framework原理

纵饮孤独 提交于 2019-12-07 12:10:38
App启动过程 点击桌面App图标,Launcher进程采用Binder IPC向system_server进程发起startActivity请求 system_server进程接收到请求后,向zygote进程发送创建进程的请求 Zygote进程fork出新的子进程,即App进程 App进程,通过Binder IPC向sytem_server进程发起attachApplication请求 system_server进程在收到请求后,进行一系列准备工作后,再通过binder IPC向App进程发送scheduleLaunchActivity请求 App进程的binder线程(ApplicationThread)在收到请求后,通过handler向主线程发送LAUNCH_ACTIVITY消息 主线程在收到Message后,通过反射机制创建目标Activity,并回调Activity.onCreate()等方法 App便正式启动,开始进入Activity生命周期,执行完onCreate/onStart/onResume方法,UI渲染结束后便可以看到App的主界面 Android开机流程 Android开机流程 BootLoader引导 当按开机键的时候,引导芯片开始从固化在ROM的预设代码开始执行,然后加载引导程序到RAM BootLoader,又称为引导程序

Eclipse, Android: Unexpected Unable to execute dex: Multiple dex files define

放肆的年华 提交于 2019-12-07 01:56:22
问题 The problem: I can't built my project. When I try the following sign is shown in the Console: [2014-09-28 23:49:30 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/annotation/AnimRes; [2014-09-28 23:49:30 - Shop] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/annotation/AnimRes; I lost hours of searching for a solution for this problem, but no result.. I tried to clean the project, to delete the bin folder

Why stack-based VM? Why not queue-based VM?

*爱你&永不变心* 提交于 2019-12-06 19:20:32
As I investigated, there are 2 major ways to implement process VM: stack-based, such as JVM, CLR, etc. or register-based, such as Lua, Dalvik, etc. Register-based approach mimics the architecture of physical processors. But for the stack-based approach, there are many other data structures. I think which approach to choose mainly depends on how we want to store/fetch operands. So why choose stack? How about queue-based VM? Or other options such as linked list? StackOverflow is really not for opinion-based surveying; it's likely to be closed. However, it's key to realise that processor-specific

Terminal run dalvikvm with am.jar

孤街浪徒 提交于 2019-12-06 15:05:24
I'm trying to start an installed app with dalvikvm in terminal. It doesn't work if I try to do this just so: dalvikvm -cp /system/app/Calculator.apk com.android.calculator2/.Calculator Then comes failure message : dalvikvm cannot find a main class So I tried to run an "am start" in dalvikvm: dalvikvm -cp system/framework/am.jar com.android.commands.am.Am It really works. But if I trying then to start an app: dalvikvm -cp system/framework/am.jar com.android.commands.am.Am start -n com.android.calculator2/.Calculator it doesn't work. Can somebody help me please? A couple of points: You cannot

Jabber.net on Unity/Android error (No JNI_OnLoad found in /system/lib/libc.so, skipping init)

人走茶凉 提交于 2019-12-06 13:01:28
问题 I am trying to create a Jabber (Jabber.net) chat client using Unity3D(Mono/C#) for iOS and Android. I got the client working in iOS (also runs well in Unity simulator). However, when running it on a Nexus 7 or HTC Desire it does not work. It does not crash, but does not connect either. It just produces the following error: D/dalvikvm(9368): No JNI_OnLoad found in /system/lib/libc.so 0x413b7270, skipping init This error is connected to the Connect method of my Jabber.net client: jc = new

using libssl.so in native Android app

不打扰是莪最后的温柔 提交于 2019-12-06 09:14:36
I'm writing a native lib (mylib.so) for Android, using the NDK. Mylib.so depends on libssl.so. The Android NDK doc tells me I shouldn't use libssl.so from system/lib, because it's not part of the stable API. Instead I should cross-compile libssl myself and add it to the NDK. But I see that mylib.so get automatically linked with system/lib/libssl.so because the dalvik vm (which is loading mylib.so) already depends on libssl.so. $ readelf -d /system/bin/dalvikvm | grep Shared 0x00000001 (NEEDED) Shared library: [libdvm.so] 0x00000001 (NEEDED) Shared library: [libssl.so] 0x00000001 (NEEDED)

Android 逆向分析(一) 之 Smali语法

ぃ、小莉子 提交于 2019-12-06 08:33:07
Smali 语法 引言 大家都知道apk安装包其实就是个zip包,我们通过解压软件解压出来会看到里面的架构 assets META_INF 存放签名信息 lib arm ... res AndroidManifest.xml classes.dex Java代码编译得到的Dalvik VM能直接执行的文件 resources.arsc asset和res资源目录的不同在于: 1. res目录下的资源文件在编译时会自动生成索引文件(R.java),assets的资源文件不需要生成索引,在Java代码中需要用AssetManager来访问 2. 一般来说,除了音频和视频资源(需要放在raw或asset下),使用Java开发的Android工程使用到的资源文件都会放在res下;使用C++游戏引擎(或使用Lua binding等)的资源文件均需要放在assets下。 Dalvik Dalvik虚拟机是Google等厂商合作开发的Android移动设备平台的核心组成部分之一。 它可以支持已转换为 .dex格式的Java应用程序的运行,.dex格式是专为Dalvik设计的一种压缩格式,适合内存和处理器速度有限的系统。 Dalvik 经过优化,允许在有限的内存中同时运行多个虚拟机的实例,并且每一个Dalvik 应用作为一个独立的Linux 进程执行