Other articles


  1. The Implementation Details of Android's force-stop

    基于AOSP 8.0.1源码分析force-stop的实现细节。

    使用 force-stop

    am force-stop com.example
    

    com.example 是应用程序包名。

    am命令

    cat /system/bin/am
    #!/system/bin/sh
    if [ "$1" != "instrument" ] ; then
        cmd activity "$@"
    else
        base=/system
        export CLASSPATH=$base/framework/am.jar
        exec app_process $base/bin com …
    read more
  2. Debug Android Framework with Android Studio

    背景

    在阅读Android Framework代码时,有时需要动态调试加深理解,或者想调试某个API的实现原理(如startActivity)时,希望可以使用Android Studio调试,且可以对应到源码的每一行 …

    read more
  3. Android 智能指针

    相关源码

    http://androidxref.com/6.0.1_r10/xref/system/core/include/utils/StrongPointer.h http://androidxref.com/6.0.1_r10/xref/system/core/include/utils/RefBase.h http://androidxref.com/6.0.1_r10/xref/system/core/libutils/RefBase.cpp

    StrongPointer

    INITIAL_STRONG_VALUE 为什么不是0 …

    read more
  4. Android 源码开发

    Title: Android 源码开发 Date: 2019-05-23 15:20:41 Modified: 2019-05-23 15:20:41 Category: Android Tags: Android Slug: build-android-sourcecode

    准备开发环境

    使用docker-aosp搭建

    编译步骤

    source build/envsetup.sh 
    including device/asus/deb/vendorsetup.sh
    including device/asus/flo/vendorsetup …
    read more
  5. Android ClassLoader

    Class

    // http://androidxref.com/6.0.1_r10/xref/libcore/libart/src/main/java/java/lang/Class.java
    public final class Class<T> implements Serializable, AnnotatedElement, GenericDeclaration, Type {
        static native Class<?> classForName(String className, boolean shouldInitialize,
            ClassLoader classLoader) throws ClassNotFoundException;
    }
    

    VMClassLoader

    // http://androidxref.com/6.0.1_r10/xref/libcore/libart/src …
    read more
  6. Android ProgressBar Circle

    Shape

    <?xml version="1.0" encoding="utf-8"?>
    <shape
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape=["rectangle" | "oval" | "line" | "ring"] 
        android:innerRadius="integer"
        android:innerRadiusRatio="integer"
        android:thickness="integer"
        android:thicknessRatio="integer"
        android:useLevel="boolean"
        >
        <corners
            android:radius="integer"
            android:topLeftRadius="integer"
            android:topRightRadius="integer"
            android:bottomLeftRadius …
    read more
  7. hacking android app with frida

    环境安装

    • frida-server
    • frida-tools
    pip3 install frida
    pip3 install frida-tools
    

    基础用法

    frida-ps -U
    frida-trace -U -i "recvfrom" com.android.chrome
    

    Javascript example 1

    Java.enumerateLoadedClasses(
      {
      "onMatch": function(className){ 
            console.log(className) 
        },
      "onComplete":function(){}
      }
    )
    

    Javascript example 2:chrome.js

    Java.perform(function () {
        var Activity = Java.use …
    read more
  8. Android traceview 原理分析

    使用方法

    目标进程需要打开调试开关,android:debuggable=true

    adb shell am profile start com.tencent.mm /data/local/tmp/1.trace
    adb shell am profile stop com.tencent.mm
    adb pull /data/local/tmp/1.trace
    ~/adt-2014/sdk/tools …
    read more

links

social