Display dns use by android:
-getprop net.dns1
-getprop net.dns2
Set dns to use by android
-setprop net.dns1 113.113.113.113
Application tag, and just about it. Forget about activities, receivers, services and go on.-keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.content.ContentProvider -keep public class * extends android.view.View { public(android.content.Context); public (android.content.Context, android.util.AttributeSet); public (android.content.Context, android.util.AttributeSet, int); public void set*(...); } -keepclasseswithmembers class * { public (android.content.Context, android.util.AttributeSet); } -keepclasseswithmembers class * { public (android.content.Context, android.util.AttributeSet, int); } -keepclassmembers class * extends android.content.Context { public void *(android.view.View); public void *(android.view.MenuItem); } -keepclassmembers class * implements android.os.Parcelable { static ** CREATOR; } -keepclassmembers class **.R$* { public static ; } -keepclassmembers class * { @android.webkit.JavascriptInterface ; }
Q. how does zygote exactly fork Dalvik VM?
init.rc is parsed and native services are started. With this, the /system/bin/app_process (Source code:frameworks/base/cmds/app_process/app_main.cpp) is run. This eventually calls AndroidRuntime.start() function (Source code: frameworks/base/core/jni/AndroidRuntime.cpp), passing it the parameters com.android.internal.os.ZygoteInit and start-system-server.AndroidRuntime.start() starts the Java VM, then calls ZygoteInit.main() (Source code:frameworks/base/core/java/com/android/internal/os/ZygoteInit.java), passing it the parameter start-system-server.ZygoteInit.main() first registers the zygote socket (the zygote process listens to a socket for incoming commands, and on receiving new command, spawns a new process as requested). Next thing that happens is, it preloads a lot of classes (which is listed in frameworks/base/preloaded-classes, last I checked, 2307 lines, in android 4.0.4) and all the system-wide resources like drawables, xmls, etc. Then it calls startSystemServer() which forks a new process for com.android.server.SystemServer(Source code: frameworks/base/services/java/com/android/server/SystemServer.java). Forking of system server is a special case, because in all other cases, zygote process listens to a socket and forks for new commands, as we will see soon.runSelectLoopMode() is called. This is a while(true) loop which basically establishes a ZygoteConnection with the zygote socket and waits for commands on it. When a command is received, ZygoteConnection.runOnce() is called (Source code:frameworks/base/core/java/com/android/internal/os/ZygoteConnection.java)ZygoteConnection.runOnce() calls Zygote.forkAndSpecialize() (Source code:libcore/dalvik/src/main/java/dalvik/system/Zygote.java) which simply calls a natvie function to do the fork. Thus, like in the case of SystemServer, a child process is created which has a pre-warmed up Dalvik for itself.Q. why it is not possible to run multiple applications in the same Dalvik VM?
cat manifests.git/config[core]repositoryformatversion = 0filemode = true[remote "origin"]url = /usr/local/aosp/mirror/platform/manifest.gitfetch = +refs/heads/*:refs/remotes/origin/*[branch "default"]remote = originmerge = android-4.4.2_r1[user]email = siperdana@gmail.com
/usr/local/aosp/mirror. The first step is to create and sync the mirror itself, which uses close to 13GB of network bandwidth and a similar amount of disk space. Notice the --mirror flag, which can only be specified when creating a new client:$ mkdir -p /usr/local/aosp/mirror $ cd /usr/local/aosp/mirror $ repo init -u https://android.googlesource.com/mirror/manifest --mirror $ repo sync
$ mkdir -p /usr/local/aosp/kitkat $ cd /usr/local/aosp/kitkat $ repo init -u /usr/local/aosp/mirror/platform/manifest.git -b android-4.4.4 $ repo sync
$ cd /usr/local/aosp/mirror $ repo sync $ cd /usr/local/aosp/kitkat $ repo sync