Full Code of didi/VirtualAPK for AI

master b1a778a06688 cached
211 files
640.5 KB
148.5k tokens
906 symbols
1 requests
Download .txt
Showing preview only (705K chars total). Download the full file or copy to clipboard to get everything.
Repository: didi/VirtualAPK
Branch: master
Commit: b1a778a06688
Files: 211
Total size: 640.5 KB

Directory structure:
gitextract__l3v4sn5/

├── .gitignore
├── AndroidStub/
│   ├── README.md
│   ├── build.gradle
│   ├── gradle.properties
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── aidl/
│           │   └── android/
│           │       ├── app/
│           │       │   ├── IActivityManager.aidl
│           │       │   ├── IApplicationThread.aidl
│           │       │   ├── INotificationManager.aidl
│           │       │   └── IServiceConnection.aidl
│           │       └── content/
│           │           ├── IIntentReceiver.aidl
│           │           └── IIntentSender.aidl
│           └── java/
│               ├── android/
│               │   ├── app/
│               │   │   ├── ActivityManagerNative.java
│               │   │   ├── ActivityThread.java
│               │   │   ├── ApplicationThreadNative.java
│               │   │   ├── Instrumentation.java
│               │   │   ├── LoadedApk.java
│               │   │   └── ResourcesManager.java
│               │   ├── content/
│               │   │   ├── ContentResolver.java
│               │   │   ├── IContentProvider.java
│               │   │   ├── pm/
│               │   │   │   ├── ManifestDigest.java
│               │   │   │   ├── PackageParser.java
│               │   │   │   ├── PackageUserState.java
│               │   │   │   └── VerifierInfo.java
│               │   │   └── res/
│               │   │       ├── CompatibilityInfo.java
│               │   │       ├── Resources.java
│               │   │       ├── ResourcesImpl.java
│               │   │       └── ResourcesKey.java
│               │   ├── databinding/
│               │   │   ├── DataBinderMapper.java
│               │   │   └── DataBindingComponent.java
│               │   ├── os/
│               │   │   ├── ServiceManager.java
│               │   │   └── SystemProperties.java
│               │   └── util/
│               │       └── Singleton.java
│               └── com/
│                   └── android/
│                       └── internal/
│                           └── R.java
├── CONTRIBUTING.md
├── CoreLibrary/
│   ├── .gitignore
│   ├── build.gradle
│   ├── gradle.properties
│   ├── proguard-rules.pro
│   ├── src/
│   │   ├── androidTest/
│   │   │   └── java/
│   │   │       └── com/
│   │   │           └── didi/
│   │   │               └── virtualapk/
│   │   │                   └── core/
│   │   │                       └── ApplicationTest.java
│   │   ├── main/
│   │   │   ├── AndroidManifest.xml
│   │   │   ├── java/
│   │   │   │   ├── android/
│   │   │   │   │   ├── content/
│   │   │   │   │   │   └── ContentResolverWrapper.java
│   │   │   │   │   └── databinding/
│   │   │   │   │       └── DataBinderMapperProxy.java
│   │   │   │   └── com/
│   │   │   │       └── didi/
│   │   │   │           └── virtualapk/
│   │   │   │               ├── PluginManager.java
│   │   │   │               ├── delegate/
│   │   │   │               │   ├── ActivityManagerProxy.java
│   │   │   │               │   ├── IContentProviderProxy.java
│   │   │   │               │   ├── LocalService.java
│   │   │   │               │   ├── RemoteContentProvider.java
│   │   │   │               │   ├── RemoteService.java
│   │   │   │               │   └── StubActivity.java
│   │   │   │               ├── internal/
│   │   │   │               │   ├── ActivityLifecycleCallbacksProxy.java
│   │   │   │               │   ├── ComponentsHandler.java
│   │   │   │               │   ├── Constants.java
│   │   │   │               │   ├── LoadedPlugin.java
│   │   │   │               │   ├── PluginContentResolver.java
│   │   │   │               │   ├── PluginContext.java
│   │   │   │               │   ├── ResourcesManager.java
│   │   │   │               │   ├── StubActivityInfo.java
│   │   │   │               │   ├── VAInstrumentation.java
│   │   │   │               │   └── utils/
│   │   │   │               │       ├── DexUtil.java
│   │   │   │               │       ├── PackageParserCompat.java
│   │   │   │               │       ├── PluginUtil.java
│   │   │   │               │       └── Settings.java
│   │   │   │               └── utils/
│   │   │   │                   ├── Reflector.java
│   │   │   │                   ├── RunUtil.java
│   │   │   │                   └── ZipVerifyUtil.java
│   │   │   └── res/
│   │   │       └── values/
│   │   │           └── strings.xml
│   │   └── test/
│   │       └── java/
│   │           └── com/
│   │               └── didi/
│   │                   └── virtualapk/
│   │                       └── core/
│   │                           └── ExampleUnitTest.java
│   └── upload.gradle
├── LICENSE
├── PluginDemo/
│   ├── app/
│   │   ├── build.gradle
│   │   ├── gradle.properties
│   │   ├── proguard-rules.pro
│   │   └── src/
│   │       └── main/
│   │           ├── AndroidManifest.xml
│   │           ├── aidl/
│   │           │   └── com/
│   │           │       └── didi/
│   │           │           └── virtualapk/
│   │           │               └── demo/
│   │           │                   ├── aidl/
│   │           │                   │   ├── Book.aidl
│   │           │                   │   ├── IBookManager.aidl
│   │           │                   │   └── IOnNewBookArrivedListener.aidl
│   │           │                   ├── binderpool/
│   │           │                   │   ├── IBinderPool.aidl
│   │           │                   │   ├── ICompute.aidl
│   │           │                   │   └── ISecurityCenter.aidl
│   │           │                   └── manualbinder/
│   │           │                       └── Book.aidl
│   │           ├── java/
│   │           │   └── com/
│   │           │       └── didi/
│   │           │           └── virtualapk/
│   │           │               └── demo/
│   │           │                   ├── MainActivity.java
│   │           │                   ├── MyApplication.java
│   │           │                   ├── SecondActivity.java
│   │           │                   ├── ThirdActivity.java
│   │           │                   ├── aidl/
│   │           │                   │   ├── Book.java
│   │           │                   │   ├── BookManagerActivity.java
│   │           │                   │   └── BookManagerService.java
│   │           │                   ├── binderpool/
│   │           │                   │   ├── BinderPool.java
│   │           │                   │   ├── BinderPoolActivity.java
│   │           │                   │   ├── BinderPoolService.java
│   │           │                   │   ├── ComputeImpl.java
│   │           │                   │   └── SecurityCenterImpl.java
│   │           │                   ├── manager/
│   │           │                   │   ├── BookManager.java
│   │           │                   │   └── UserManager.java
│   │           │                   ├── manualbinder/
│   │           │                   │   ├── Book.java
│   │           │                   │   ├── BookManagerImpl.java
│   │           │                   │   └── IBookManager.java
│   │           │                   ├── messenger/
│   │           │                   │   ├── MessengerActivity.java
│   │           │                   │   └── MessengerService.java
│   │           │                   ├── model/
│   │           │                   │   └── User.java
│   │           │                   ├── provider/
│   │           │                   │   ├── BookProvider.java
│   │           │                   │   ├── DbOpenHelper.java
│   │           │                   │   └── ProviderActivity.java
│   │           │                   ├── socket/
│   │           │                   │   ├── TCPClientActivity.java
│   │           │                   │   └── TCPServerService.java
│   │           │                   └── utils/
│   │           │                       ├── MyConstants.java
│   │           │                       └── MyUtils.java
│   │           └── res/
│   │               ├── drawable/
│   │               │   └── edit.xml
│   │               ├── layout/
│   │               │   ├── activity_binder_pool.xml
│   │               │   ├── activity_book_manager.xml
│   │               │   ├── activity_main.xml
│   │               │   ├── activity_messenger.xml
│   │               │   ├── activity_provider.xml
│   │               │   ├── activity_second.xml
│   │               │   ├── activity_tcpclient.xml
│   │               │   └── activity_third.xml
│   │               └── values/
│   │                   ├── colors.xml
│   │                   ├── strings.xml
│   │                   └── styles.xml
│   ├── build.gradle
│   ├── gradle/
│   │   └── wrapper/
│   │       ├── gradle-wrapper.jar
│   │       └── gradle-wrapper.properties
│   ├── gradlew
│   ├── gradlew.bat
│   ├── make.sh
│   └── settings.gradle
├── README.md
├── RELEASE-NOTES.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── didi/
│       │               └── virtualapk/
│       │                   └── ApplicationTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── didi/
│       │   │           └── virtualapk/
│       │   │               ├── MainActivity.java
│       │   │               └── VAApplication.java
│       │   └── res/
│       │       ├── layout/
│       │       │   └── activity_main.xml
│       │       ├── values/
│       │       │   ├── colors.xml
│       │       │   ├── dimens.xml
│       │       │   ├── strings.xml
│       │       │   └── styles.xml
│       │       ├── values-en/
│       │       │   └── strings.xml
│       │       └── values-w820dp/
│       │           └── dimens.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── didi/
│                       └── virtualapk/
│                           └── ExampleUnitTest.java
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── keystore/
│   ├── test.cer
│   └── test.keystore
├── settings.gradle
└── virtualapk-gradle-plugin/
    ├── build.gradle
    ├── gradle/
    │   └── wrapper/
    │       ├── gradle-wrapper.jar
    │       └── gradle-wrapper.properties
    ├── gradle.properties
    ├── gradlew
    ├── gradlew.bat
    ├── src/
    │   └── main/
    │       ├── groovy/
    │       │   └── com.didi.virtualapk/
    │       │       ├── BasePlugin.groovy
    │       │       ├── Constants.groovy
    │       │       ├── VAExtention.groovy
    │       │       ├── VAHostPlugin.groovy
    │       │       ├── VAPlugin.groovy
    │       │       ├── aapt/
    │       │       │   ├── AXmlEditor.groovy
    │       │       │   ├── Aapt.groovy
    │       │       │   ├── ArscEditor.groovy
    │       │       │   ├── AssetEditor.groovy
    │       │       │   ├── CppHexEditor.groovy
    │       │       │   ├── ResAttr.groovy
    │       │       │   ├── ResStringFlag.groovy
    │       │       │   ├── ResStringPoolSpan.groovy
    │       │       │   ├── ResTableEntry.groovy
    │       │       │   ├── ResTableType.groovy
    │       │       │   ├── ResType.groovy
    │       │       │   ├── ResValueDataType.groovy
    │       │       │   ├── SymbolParser.groovy
    │       │       │   └── packageinfo
    │       │       ├── collector/
    │       │       │   ├── HostClassAndResCollector.groovy
    │       │       │   ├── HostJniLibsCollector.groovy
    │       │       │   ├── ResourceCollector.groovy
    │       │       │   ├── dependence/
    │       │       │   │   ├── AarDependenceInfo.groovy
    │       │       │   │   ├── DependenceInfo.groovy
    │       │       │   │   └── JarDependenceInfo.groovy
    │       │       │   └── res/
    │       │       │       ├── ResourceEntry.groovy
    │       │       │       └── StyleableEntry.groovy
    │       │       ├── hooker/
    │       │       │   ├── DxTaskHooker.groovy
    │       │       │   ├── GradleTaskHooker.groovy
    │       │       │   ├── MergeAssetsHooker.groovy
    │       │       │   ├── MergeJniLibsHooker.groovy
    │       │       │   ├── MergeManifestsHooker.groovy
    │       │       │   ├── PrepareDependenciesHooker.groovy
    │       │       │   ├── ProcessResourcesHooker.groovy
    │       │       │   ├── ProguardHooker.groovy
    │       │       │   ├── ShrinkResourcesHooker.groovy
    │       │       │   └── TaskHookerManager.groovy
    │       │       ├── tasks/
    │       │       │   └── AssemblePlugin.groovy
    │       │       ├── transform/
    │       │       │   ├── StripClassAndResTransform.groovy
    │       │       │   └── TransformWrapper.groovy
    │       │       └── utils/
    │       │           ├── CheckList.groovy
    │       │           ├── FileBinaryCategory.groovy
    │       │           ├── FileUtil.groovy
    │       │           ├── PackagingUtils.java
    │       │           ├── Reflect.java
    │       │           └── ZipUtil.groovy
    │       ├── java/
    │       │   └── com/
    │       │       └── didi/
    │       │           └── virtualapk/
    │       │               ├── databinding/
    │       │               │   └── annotationprocessor/
    │       │               │       └── ProcessDataBinding.java
    │       │               └── utils/
    │       │                   └── Log.java
    │       └── resources/
    │           └── META-INF/
    │               ├── gradle-plugins/
    │               │   ├── com.didi.virtualapk.host.properties
    │               │   └── com.didi.virtualapk.plugin.properties
    │               └── services/
    │                   └── javax.annotation.processing.Processor
    └── upload.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# Generated by MacOSX
.DS_Store

# Generated by VIM
.*.swp

# Generated by IntelliJ
.idea/
*.iml
/*/*.iml
/*/*/*.iml

# PluginDemo
PluginDemo/.idea/
PluginDemo/.gradle/
PluginDemo/build/
PluginDemo/*.iml
PluginDemo/local.properties
PluginDemo/host/

# Generated by Gradle
.gradle
build/

# Generated by Eclipse
.metadata
.settings
.project
.classpath

# Files generated by Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties

local.properties
buildSrc


================================================
FILE: AndroidStub/README.md
================================================
# Android Framework Stub

该库主要是针对在 app 中无法直接调用 Android Framework 中很多隐藏的 API 而创造的一系列 stub 类用来欺骗编译器,从而避免了使用反射去调用造成性能损失


================================================
FILE: AndroidStub/build.gradle
================================================
group = 'com.didichuxing.foundation'
version = '0.0.5'

apply plugin: 'com.android.library'

android {
    compileSdkVersion VERSION_COMPILE_SDK
    buildToolsVersion VERSION_BUILD_TOOLS

    defaultConfig {
        minSdkVersion VERSION_MIN_SDK
        targetSdkVersion VERSION_TARGET_SDK
        versionCode 1
        versionName "1.0"
    }
    compileOptions {
        sourceCompatibility SOURCE_COMPATIBILITY
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        abortOnError false
    }
}

android.libraryVariants.all  { variant ->
    def jarTask = project.tasks.create("jar${variant.name.capitalize()}", Jar)
    jarTask.excludes = [
        'android/BuildConfig.class',
        'android/R.class'
    ]
    jarTask.dependsOn variant.javaCompile
    jarTask.from variant.javaCompile.destinationDir
    artifacts.add('archives', jarTask)
}

apply plugin: 'maven'

uploadArchives {
    repositories {
        mavenDeployer {
            pom.project {
                groupId project.group
                artifactId 'android-framework'
                version project.version
                description project.description ?: ''
                packaging 'jar'
            }
            repository(url: MAVEN_RELEASES_REPOSITORY_URL) {
                authentication(userName: MAVEN_USERNAME, password: MAVEN_PASSWORD)
            }
            snapshotRepository(url: MAVEN_SNAPSHOTS_REPOSITORY_URL) {
                authentication(userName: MAVEN_USERNAME, password: MAVEN_PASSWORD)
            }
        }
    }
}

dependencies {
    api 'com.android.support:support-annotations:22.2.0'
    api 'com.android.databinding:library:1.3.1'
    api 'com.android.databinding:baseLibrary:3.0.0'
}

================================================
FILE: AndroidStub/gradle.properties
================================================
MAVEN_RELEASES_REPOSITORY_URL=
MAVEN_SNAPSHOTS_REPOSITORY_URL=
MAVEN_USERNAME=test
MAVEN_PASSWORD=test


================================================
FILE: AndroidStub/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/johnson/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}


================================================
FILE: AndroidStub/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="android">

    <application />

</manifest>


================================================
FILE: AndroidStub/src/main/aidl/android/app/IActivityManager.aidl
================================================
package android.app;

import android.app.IApplicationThread;
import android.app.IServiceConnection;
import android.content.ComponentName;
import android.content.Intent;
import android.content.IIntentSender;
import android.os.IBinder;
import android.os.IInterface;

/**
 * @author johnsonlee
 */
interface IActivityManager {

    ComponentName startService(in IApplicationThread caller, in Intent service, in String resolvedType, in String callingPackage, in int userId);

    int stopService(in IApplicationThread caller, in Intent service, in String resolvedType, in int userId);

    boolean stopServiceToken(in ComponentName className, in IBinder token, in int startId);

    void setServiceForeground(in ComponentName className, in IBinder token, in int id, in Notification notification, in boolean keepNotification);

    int bindService(in IApplicationThread caller, in IBinder token, in Intent service, in String resolvedType, in IServiceConnection connection, in int flags, in String callingPackage, in int userId);

    boolean unbindService(in IServiceConnection connection);

    void publishService(in IBinder token, in Intent intent, in IBinder service);

    void unbindFinished(in IBinder token, in Intent service, in boolean doRebind);

    IIntentSender getIntentSender(in int type, in String packageName, in IBinder token, in String resultWho, int requestCode, in Intent[] intents, in String[] resolvedTypes, in int flags, in Bundle options, in int userId);

    void cancelIntentSender(in IIntentSender sender);

    String getPackageForIntentSender(in IIntentSender sender);

    int getUidForIntentSender(in IIntentSender sender);

}


================================================
FILE: AndroidStub/src/main/aidl/android/app/IApplicationThread.aidl
================================================
package android.app;

interface IApplicationThread {
}


================================================
FILE: AndroidStub/src/main/aidl/android/app/INotificationManager.aidl
================================================
/*
 * Copyright 2007, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.app;
import android.app.Notification;
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;

interface INotificationManager
{
    void cancelAllNotifications(String pkg, int userId);
    void enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id, in Notification notification, inout int[] idReceived, int userId);
    void cancelNotificationWithTag(String pkg, String tag, int id, int userId);
    void setNotificationsEnabledForPackage(String pkg, int uid, boolean enabled);
    boolean areNotificationsEnabledForPackage(String pkg, int uid);
    boolean areNotificationsEnabled(String pkg);
}


================================================
FILE: AndroidStub/src/main/aidl/android/app/IServiceConnection.aidl
================================================
/* //device/java/android/android/app/IServiceConnection.aidl
**
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/

package android.app;

import android.content.ComponentName;

/** @hide */
oneway interface IServiceConnection {
//    void connected(in ComponentName name, IBinder service);

    /** Added in Android O */
    void connected(in ComponentName name, IBinder service, boolean dead);
}


================================================
FILE: AndroidStub/src/main/aidl/android/content/IIntentReceiver.aidl
================================================
/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.content;

import android.content.Intent;
import android.os.Bundle;

/**
 * System private API for dispatching intent broadcasts.  This is given to the
 * activity manager as part of registering for an intent broadcasts, and is
 * called when it receives intents.
 */
oneway interface IIntentReceiver {
    void performReceive(in Intent intent, int resultCode, String data, in Bundle extras, boolean ordered, boolean sticky, int sendingUser);
}


================================================
FILE: AndroidStub/src/main/aidl/android/content/IIntentSender.aidl
================================================
/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.content;

import android.content.IIntentReceiver;
import android.content.Intent;
import android.os.Bundle;

oneway interface IIntentSender {

    void send(int code, in Intent intent, String resolvedType, IIntentReceiver finishedReceiver, String requiredPermission, in Bundle options);

}

================================================
FILE: AndroidStub/src/main/java/android/app/ActivityManagerNative.java
================================================
package android.app;

import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;

/**
 * @author johnsonlee
 */
public abstract class ActivityManagerNative extends Binder implements IActivityManager {

    public static IActivityManager getDefault() {
        throw new RuntimeException("Stub!");
    }

    public static boolean isSystemReady() {
        throw new RuntimeException("Stub!");
    }

    public static void broadcastStickyIntent(final Intent intent, final String permission, final int userId) {
        throw new RuntimeException("Stub!");
    }

    static public IActivityManager asInterface(IBinder obj) {
        throw new RuntimeException("Stub!");
    }

    public ActivityManagerNative() {
        throw new RuntimeException("Stub!");
    }
}


================================================
FILE: AndroidStub/src/main/java/android/app/ActivityThread.java
================================================
package android.app;

import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;

/**
 * @author johnsonlee
 */
public final class ActivityThread {

    public static ActivityThread currentActivityThread() {
        throw new RuntimeException("Stub!");
    }

    public static boolean isSystem() {
        throw new RuntimeException("Stub!");
    }

    public static String currentOpPackageName() {
        throw new RuntimeException("Stub!");
    }

    public static String currentPackageName() {
        throw new RuntimeException("Stub!");
    }

    public static String currentProcessName() {
        throw new RuntimeException("Stub!");
    }

    public static Application currentApplication() {
        throw new RuntimeException("Stub!");
    }

    public ApplicationThread getApplicationThread() {
        throw new RuntimeException("Stub!");
    }

    public Instrumentation getInstrumentation() {
        throw new RuntimeException("Stub!");
    }

    public Looper getLooper() {
        throw new RuntimeException("Stub!");
    }

    public Application getApplication() {
        throw new RuntimeException("Stub!");
    }

    public String getProcessName() {
        throw new RuntimeException("Stub!");
    }

    public final ActivityInfo resolveActivityInfo(final Intent intent) {
        throw new RuntimeException("Stub!");
    }

    public final Activity getActivity(final IBinder token) {
        throw new RuntimeException("Stub!");
    }

    final Handler getHandler() {
        throw new RuntimeException("Stub!");
    }

    private class ApplicationThread extends ApplicationThreadNative {


    }
}


================================================
FILE: AndroidStub/src/main/java/android/app/ApplicationThreadNative.java
================================================
package android.app;

import android.os.Binder;
import android.os.IBinder;

/**
 * @author johnsonlee
 */
public abstract class ApplicationThreadNative extends Binder implements IApplicationThread {

    @Override
    public IBinder asBinder() {
        throw new RuntimeException("Stub!");
    }

}


================================================
FILE: AndroidStub/src/main/java/android/app/Instrumentation.java
================================================
package android.app;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.IBinder;
import android.os.PersistableBundle;

/**
 * Created by qiaopu on 2018/5/7.
 */
public class Instrumentation {
    
    public Application newApplication(ClassLoader cl, String className, Context context) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
        throw new RuntimeException("Stub!");
    }
    
    public void callApplicationOnCreate(Application app) {
        throw new RuntimeException("Stub!");
    }
    
    public Activity newActivity(ClassLoader cl, String className, Intent intent) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
        throw new RuntimeException("Stub!");
    }
    
    public void callActivityOnCreate(Activity activity, Bundle icicle) {
        throw new RuntimeException("Stub!");
    }
    
    public void callActivityOnCreate(Activity activity, Bundle icicle, PersistableBundle persistentState) {
        throw new RuntimeException("Stub!");
    }
    
    public ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode) {
        throw new RuntimeException("Stub!");
    }
    
    public ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode, Bundle options) {
        throw new RuntimeException("Stub!");
    }
    
    public ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, Fragment target, Intent intent, int requestCode, Bundle options) {
        throw new RuntimeException("Stub!");
    }
    
    public ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, String target, Intent intent, int requestCode, Bundle options) {
        throw new RuntimeException("Stub!");
    }
    
    public Context getContext() {
        throw new RuntimeException("Stub!");
    }
    
    public Context getTargetContext() {
        throw new RuntimeException("Stub!");
    }
    
    public ComponentName getComponentName() {
        throw new RuntimeException("Stub!");
    }
    
    public static final class ActivityResult {
        public ActivityResult(int resultCode, Intent resultData) {
            throw new RuntimeException("Stub!");
        }
    }
}


================================================
FILE: AndroidStub/src/main/java/android/app/LoadedApk.java
================================================
package android.app;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.IIntentReceiver;
import android.content.pm.ApplicationInfo;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.os.Handler;

import java.io.File;

/**
 * Created by johnson on 24/8/16.
 */
public final class LoadedApk {

    public String getPackageName() {
        throw new RuntimeException("Stub!");
    }

    public ApplicationInfo getApplicationInfo() {
        throw new RuntimeException("Stub!");
    }

    public ClassLoader getClassLoader() {
        throw new RuntimeException("Stub!");
    }

    public String getAppDir() {
        throw new RuntimeException("Stub!");
    }

    public String getLibDir() {
        throw new RuntimeException("Stub!");
    }

    public String getResDir() {
        throw new RuntimeException("Stub!");
    }

    public String[] getSplitAppDirs() {
        throw new RuntimeException("Stub!");
    }

    public String[] getSplitResDirs() {
        throw new RuntimeException("Stub!");
    }

    public String[] getOverlayDirs() {
        throw new RuntimeException("Stub!");
    }

    public String getDataDir() {
        throw new RuntimeException("Stub!");
    }

    public File getDataDirFile() {
        throw new RuntimeException("Stub!");
    }

    public AssetManager getAssets(final ActivityThread mainThread) {
        throw new RuntimeException("Stub!");
    }

    public Resources getResources(final ActivityThread mainThread) {
        throw new RuntimeException("Stub!");
    }

    public IIntentReceiver getReceiverDispatcher(final BroadcastReceiver r, final Context context, final Handler handler, final Instrumentation instrumentation, final boolean registered) {
        throw new RuntimeException("Stub!");
    }

    public IIntentReceiver forgetReceiverDispatcher(final Context context, final BroadcastReceiver r) {
        throw new RuntimeException("Stub!");
    }
}


================================================
FILE: AndroidStub/src/main/java/android/app/ResourcesManager.java
================================================
package android.app;

/**
 * Created by qiaopu on 2018/4/25.
 */
public class ResourcesManager {
    
    public static ResourcesManager getInstance() {
        throw new RuntimeException("Stub!");
    }
    
    public void appendLibAssetForMainAssetPath(String assetPath, String libAsset) {
        throw new RuntimeException("Stub!");
    }
    
}

================================================
FILE: AndroidStub/src/main/java/android/content/ContentResolver.java
================================================
package android.content;

import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

/**
 * Created by qiaopu on 2018/5/7.
 */
public abstract class ContentResolver {
    
    public ContentResolver(Context context) {
        throw new RuntimeException("Stub!");
    }
    
    public final @Nullable
    Bundle call(@NonNull Uri uri, @NonNull String method,
                @Nullable String arg, @Nullable Bundle extras) {
        throw new RuntimeException("Stub!");
    }
    
    protected abstract IContentProvider acquireProvider(Context c, String name);
    
    protected IContentProvider acquireExistingProvider(Context c, String name) {
        throw new RuntimeException("Stub!");
    }
    
    public abstract boolean releaseProvider(IContentProvider icp);
    
    protected abstract IContentProvider acquireUnstableProvider(Context c, String name);
    
    public abstract boolean releaseUnstableProvider(IContentProvider icp);
    
    public abstract void unstableProviderDied(IContentProvider icp);
    
    public void appNotRespondingViaProvider(IContentProvider icp) {
        throw new RuntimeException("Stub!");
    }
}


================================================
FILE: AndroidStub/src/main/java/android/content/IContentProvider.java
================================================
/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.content;

import android.os.IInterface;

/**
 * The ipc interface to talk to a content provider.
 * @hide
 */
public interface IContentProvider extends IInterface {
}


================================================
FILE: AndroidStub/src/main/java/android/content/pm/ManifestDigest.java
================================================
package android.content.pm;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.jar.Attributes;

/**
 * @author johnsonlee
 */
public class ManifestDigest implements Parcelable {

    ManifestDigest(final byte[] digest) {
        throw new RuntimeException("Stub!");
    }

    private ManifestDigest(final Parcel source) {
        throw new RuntimeException("Stub!");
    }

    static ManifestDigest fromAttributes(final Attributes attributes) {
        throw new RuntimeException("Stub!");
    }

    @Override
    public int describeContents() {
        throw new RuntimeException("Stub!");
    }

    @Override
    public boolean equals(Object o) {
        throw new RuntimeException("Stub!");
    }

    @Override
    public int hashCode() {
        throw new RuntimeException("Stub!");
    }

    @Override
    public String toString() {
        throw new RuntimeException("Stub!");
    }

    @Override
    public void writeToParcel(final Parcel dest, final int flags) {
        throw new RuntimeException("Stub!");
    }

    public static final Parcelable.Creator<ManifestDigest> CREATOR = new Parcelable.Creator<ManifestDigest>() {
        public ManifestDigest createFromParcel(Parcel source) {
            return new ManifestDigest(source);
        }

        public ManifestDigest[] newArray(int size) {
            return new ManifestDigest[size];
        }
    };

}


================================================
FILE: AndroidStub/src/main/java/android/content/pm/PackageParser.java
================================================
package android.content.pm;

import android.annotation.SuppressLint;
import android.content.ComponentName;
import android.content.IntentFilter;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.DisplayMetrics;

import java.io.File;
import java.io.PrintWriter;
import java.security.PublicKey;
import java.security.cert.Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * @author johnsonlee
 */
public class PackageParser {

    public final static int PARSE_IS_SYSTEM = 1 << 0;
    public final static int PARSE_CHATTY = 1 << 1;
    public final static int PARSE_MUST_BE_APK = 1 << 2;
    public final static int PARSE_IGNORE_PROCESSES = 1 << 3;
    public final static int PARSE_FORWARD_LOCK = 1 << 4;
    public final static int PARSE_EXTERNAL_STORAGE = 1 << 5;
    public final static int PARSE_IS_SYSTEM_DIR = 1 << 6;
    public final static int PARSE_IS_PRIVILEGED = 1 << 7;
    public final static int PARSE_COLLECT_CERTIFICATES = 1 << 8;
    public final static int PARSE_TRUSTED_OVERLAY = 1 << 9;

    public static class NewPermissionInfo {
        public final String name;
        public final int sdkVersion;
        public final int fileVersion;

        public NewPermissionInfo(String name, int sdkVersion, int fileVersion) {
            throw new RuntimeException("Stub!");
        }
    }

    public static class SplitPermissionInfo {
        public final String rootPerm;
        public final String[] newPerms;
        public final int targetSdk;

        public SplitPermissionInfo(String rootPerm, String[] newPerms, int targetSdk) {
            throw new RuntimeException("Stub!");
        }
    }

    public static final PackageParser.NewPermissionInfo NEW_PERMISSIONS[] = new PackageParser.NewPermissionInfo[]{
            new PackageParser.NewPermissionInfo(android.Manifest.permission.WRITE_EXTERNAL_STORAGE, android.os.Build.VERSION_CODES.DONUT, 0),
            new PackageParser.NewPermissionInfo(android.Manifest.permission.READ_PHONE_STATE, android.os.Build.VERSION_CODES.DONUT, 0)
    };

    static class ParsePackageItemArgs {
        final Package owner;
        final String[] outError;
        final int nameRes;
        final int labelRes;
        final int iconRes;
        final int logoRes;
        final int bannerRes;

        String tag;
        TypedArray sa;

        ParsePackageItemArgs(final Package owner, final String[] outError, final int nameRes, final int labelRes, final int iconRes, final int logoRes, final int bannerRes) { throw new RuntimeException("Stub!");
        }
    }

    static class ParseComponentArgs extends ParsePackageItemArgs {
        final String[] sepProcesses;
        final int processRes;
        final int descriptionRes;
        final int enabledRes;
        int flags;

        ParseComponentArgs(final Package owner, final String[] outError, final int nameRes, final int labelRes, final int iconRes, final int logoRes, final int bannerRes, final String[] sepProcesses, final int processRes, final int descriptionRes, final int enabledRes) {
            super(owner, outError, nameRes, labelRes, iconRes, logoRes, bannerRes);
            throw new RuntimeException("Stub!");
        }
    }

    public static class PackageLite {
        public final String packageName;
        public final int versionCode;
        public final int installLocation;
        public final VerifierInfo[] verifiers;

        /** Names of any split APKs, ordered by parsed splitName */
        public final String[] splitNames;

        /**
         * Path where this package was found on disk. For monolithic packages
         * this is path to single base APK file; for cluster packages this is
         * path to the cluster directory.
         */
        public final String codePath;

        /** Path of base APK */
        public final String baseCodePath;
        /** Paths of any split APKs, ordered by parsed splitName */
        public final String[] splitCodePaths;

        /** Revision code of base APK */
        public final int baseRevisionCode;
        /** Revision codes of any split APKs, ordered by parsed splitName */
        public final int[] splitRevisionCodes;

        public final boolean coreApp;
        public final boolean multiArch;
        public final boolean extractNativeLibs;

        public PackageLite(final String codePath, final ApkLite baseApk, final String[] splitNames, final String[] splitCodePaths, final int[] splitRevisionCodes) {
            throw new RuntimeException("Stub!");
        }

        public List<String> getAllCodePaths() {
            throw new RuntimeException("Stub!");
        }
    }

    public static class ApkLite {
        public final String codePath;
        public final String packageName;
        public final String splitName;
        public final int versionCode;
        public final int revisionCode;
        public final int installLocation;
        public final VerifierInfo[] verifiers;
        public final Signature[] signatures;
        public final boolean coreApp;
        public final boolean multiArch;
        public final boolean extractNativeLibs;

        public ApkLite(final String codePath, final String packageName, final String splitName, final int versionCode, final int revisionCode, final int installLocation, final List<VerifierInfo> verifiers, final Signature[] signatures, final boolean coreApp, final boolean multiArch, final boolean extractNativeLibs) {
            throw new RuntimeException("Stub!");
        }
    }

    /**
     * For Android 5.0+
     */
    public PackageParser() {
        throw new RuntimeException("Stub!");
    }

    public PackageParser(final String archiveSourcePath) {
        throw new RuntimeException("Stub!");
    }

    public void setSeparateProcesses(final String[] procs) {
        throw new RuntimeException("Stub!");
    }

    public void setOnlyCoreApps(final boolean onlyCoreApps) {
        throw new RuntimeException("Stub!");
    }

    public void setDisplayMetrics(final DisplayMetrics metrics) {
        throw new RuntimeException("Stub!");
    }

    public static final boolean isApkFile(final File file) {
        throw new RuntimeException("Stub!");
    }

    public static PackageInfo generatePackageInfo(final PackageParser.Package p, final int gids[], final int flags, final long firstInstallTime, final long lastUpdateTime, final Set<String> grantedPermissions, final PackageUserState state) {
        throw new RuntimeException("Stub!");
    }

    public static boolean isAvailable(final PackageUserState state) {
        throw new RuntimeException("Stub!");
    }

    public static PackageInfo generatePackageInfo(final PackageParser.Package p, final int gids[], final int flags, final long firstInstallTime, final long lastUpdateTime, final Set<String> grantedPermissions, final PackageUserState state, final int userId) {
        throw new RuntimeException("Stub!");
    }

    /**
     * Parse only lightweight details about the package at the given location.
     * Automatically detects if the package is a monolithic style (single APK
     * file) or cluster style (directory of APKs).
     * <p>
     * This performs sanity checking on cluster style packages, such as
     * requiring identical package name and version codes, a single base APK,
     * and unique split names.
     *
     * @see PackageParser#parsePackage(File, int)
     */
    public static PackageLite parsePackageLite(final File packageFile, final int flags) throws PackageParserException {
        throw new RuntimeException("Stub!");
    }

    /**
     * Parse the package at the given location. Automatically detects if the
     * package is a monolithic style (single APK file) or cluster style
     * (directory of APKs).
     * <p>
     * This performs sanity checking on cluster style packages, such as
     * requiring identical package name and version codes, a single base APK,
     * and unique split names.
     * <p>
     * Note that this <em>does not</em> perform signature verification; that
     * must be done separately in {@link #collectCertificates(Package, int)}.
     *
     * @see #parsePackageLite(File, int)
     * @since Android 5.0+
     */
    public Package parsePackage(final File packageFile, final int flags) throws PackageParserException {
        throw new RuntimeException("Stub!");
    }

    /**
     *
     * @param sourceFile
     * @param destCodePath
     * @param metrics
     * @param flags
     * @return
     * @since Android 2.3+
     */
    public Package parsePackage(final File sourceFile, final String destCodePath, final DisplayMetrics metrics, final int flags) {
        throw new RuntimeException("Stub!");
    }

    public void collectManifestDigest(final Package pkg) throws PackageParserException {
        throw new RuntimeException("Stub!");
    }

    public void collectCertificates(final Package pkg, final int flags) throws PackageParserException {
        throw new RuntimeException("Stub!");
    }

    /**
     * Utility method that retrieves lightweight details about a single APK
     * file, including package name, split name, and install location.
     *
     * @param apkFile path to a single APK
     * @param flags optional parse flags, such as
     *            {@link #PARSE_COLLECT_CERTIFICATES}
     */
    public static ApkLite parseApkLite(final File apkFile, final int flags) throws PackageParserException {
        throw new RuntimeException("Stub!");
    }

    public static ApplicationInfo generateApplicationInfo(final Package p, final int flags, final PackageUserState state) {
        throw new RuntimeException("Stub!");
    }

    public static ApplicationInfo generateApplicationInfo(final Package p, final int flags, final PackageUserState state, final int userId) {
        throw new RuntimeException("Stub!");
    }

    public static ApplicationInfo generateApplicationInfo(final ApplicationInfo ai, final int flags, final PackageUserState state, final int userId) {
        throw new RuntimeException("Stub!");
    }

    public static final PermissionInfo generatePermissionInfo(final Permission p, final int flags) {
        throw new RuntimeException("Stub!");
    }

    public static final PermissionGroupInfo generatePermissionGroupInfo(final PermissionGroup pg, final int flags) {
        throw new RuntimeException("Stub!");
    }

    public static final InstrumentationInfo generateInstrumentationInfo(final Instrumentation i, final int flags) {
        throw new RuntimeException("Stub!");
    }

    public static final ServiceInfo generateServiceInfo(final Service s, final int flags, final PackageUserState state, final int userId) {
        throw new RuntimeException("Stub!");
    }

    public static final ProviderInfo generateProviderInfo(final Provider p, final int flags, final PackageUserState state, final int userId) {
        throw new RuntimeException("Stub!");
    }

    public static final ActivityInfo generateActivityInfo(final Activity a, final int flags, final PackageUserState state, final int userId) {
        throw new RuntimeException("Stub!");
    }

    public static final ActivityInfo generateActivityInfo(final ActivityInfo ai, final int flags, final PackageUserState state, final int userId) {
        throw new RuntimeException("Stub!");
    }

    /**
     * Representation of a full package parsed from APK files on disk. A package
     * consists of a single base APK, and zero or more split APKs.
     */
    public final static class Package {

        public String packageName;

        /** Names of any split APKs, ordered by parsed splitName */
        public String[] splitNames;

        // TODO: work towards making these paths invariant

        public String volumeUuid;

        /**
         * Path where this package was found on disk. For monolithic packages
         * this is path to single base APK file; for cluster packages this is
         * path to the cluster directory.
         */
        public String codePath;

        /** Path of base APK */
        public String baseCodePath;
        /** Paths of any split APKs, ordered by parsed splitName */
        public String[] splitCodePaths;

        /** Revision code of base APK */
        public int baseRevisionCode;
        /** Revision codes of any split APKs, ordered by parsed splitName */
        public int[] splitRevisionCodes;

        /** Flags of any split APKs; ordered by parsed splitName */
        public int[] splitFlags;

        /**
         * Private flags of any split APKs; ordered by parsed splitName.
         *
         * {@hide}
         */
        public int[] splitPrivateFlags;

        public boolean baseHardwareAccelerated;

        // For now we only support one application per package.
        public final ApplicationInfo applicationInfo = new ApplicationInfo();

        public final ArrayList<Permission> permissions = new ArrayList<Permission>(0);
        public final ArrayList<PermissionGroup> permissionGroups = new ArrayList<PermissionGroup>(0);
        public final ArrayList<Activity> activities = new ArrayList<Activity>(0);
        public final ArrayList<Activity> receivers = new ArrayList<Activity>(0);
        public final ArrayList<Provider> providers = new ArrayList<Provider>(0);
        public final ArrayList<Service> services = new ArrayList<Service>(0);
        public final ArrayList<Instrumentation> instrumentation = new ArrayList<Instrumentation>(0);

        public final ArrayList<String> requestedPermissions = new ArrayList<String>();

        public ArrayList<String> protectedBroadcasts;

        public ArrayList<String> libraryNames = null;
        public ArrayList<String> usesLibraries = null;
        public ArrayList<String> usesOptionalLibraries = null;
        public String[] usesLibraryFiles = null;

        public ArrayList<ActivityIntentInfo> preferredActivityFilters = null;

        public ArrayList<String> mOriginalPackages = null;
        public String mRealPackage = null;
        public ArrayList<String> mAdoptPermissions = null;

        // We store the application meta-data independently to avoid multiple unwanted references
        public Bundle mAppMetaData = null;

        // The version code declared for this package.
        public int mVersionCode;

        // The version name declared for this package.
        public String mVersionName;

        // The shared user id that this package wants to use.
        public String mSharedUserId;

        // The shared user label that this package wants to use.
        public int mSharedUserLabel;

        // Signatures that were read from the package.
        public Signature[] mSignatures;
        public SigningDetails mSigningDetails;
        public Certificate[][] mCertificates;

        // For use by package manager service for quick lookup of
        // preferred up order.
        public int mPreferredOrder = 0;

        // For use by package manager to keep track of where it needs to do dexopt.
//        public final ArraySet<String> mDexOptPerformed = new ArraySet<>(4);

        // For use by package manager to keep track of when a package was last used.
        public long mLastPackageUsageTimeInMills;

        // // User set enabled state.
        // public int mSetEnabled = PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
        //
        // // Whether the package has been stopped.
        // public boolean mSetStopped = false;

        // Additional data supplied by callers.
        public Object mExtras;

        // Applications hardware preferences
        public ArrayList<ConfigurationInfo> configPreferences = null;

        // Applications requested features
        public ArrayList<FeatureInfo> reqFeatures = null;

        // Applications requested feature groups
        public ArrayList<FeatureGroupInfo> featureGroups = null;

        public int installLocation;

        public boolean coreApp;

        /* An app that's required for all users and cannot be uninstalled for a user */
        public boolean mRequiredForAllUsers;

        /* The restricted account authenticator type that is used by this application */
        public String mRestrictedAccountType;

        /* The required account type without which this application will not function */
        public String mRequiredAccountType;

        /**
         * Digest suitable for comparing whether this package's manifest is the
         * same as another.
         */
        public ManifestDigest manifestDigest;

        public String mOverlayTarget;
        public int mOverlayPriority;
        public boolean mTrustedOverlay;

        /**
         * Data used to feed the KeySetManagerService
         */
        public ArraySet<PublicKey> mSigningKeys;
        public ArraySet<String> mUpgradeKeySets;
        public ArrayMap<String, ArraySet<PublicKey>> mKeySetMapping;

        /**
         * The install time abi override for this package, if any.
         *
         * TODO: This seems like a horrible place to put the abiOverride because
         * this isn't something the packageParser parsers. However, this fits in with
         * the rest of the PackageManager where package scanning randomly pushes
         * and prods fields out of {@code this.applicationInfo}.
         */
        public String cpuAbiOverride;

        public Package(String packageName) {
            throw new RuntimeException("Stub!");
        }

        public List<String> getAllCodePaths() {
            throw new RuntimeException("Stub!");
        }

        /**
         * Filtered set of {@link #getAllCodePaths()} that excludes
         * resource-only APKs.
         */
        public List<String> getAllCodePathsExcludingResourceOnly() {
            throw new RuntimeException("Stub!");
        }

        public void setPackageName(final String newName) {
            throw new RuntimeException("Stub!");
        }

        public boolean hasComponentClassName(final String name) {
            throw new RuntimeException("Stub!");
        }

        public boolean isForwardLocked() {
            throw new RuntimeException("Stub!");
        }

        public boolean isSystemApp() {
            throw new RuntimeException("Stub!");
        }

        public boolean isPrivilegedApp() {
            throw new RuntimeException("Stub!");
        }

        public boolean isUpdatedSystemApp() {
            throw new RuntimeException("Stub!");
        }

        public boolean canHaveOatDir() {
            throw new RuntimeException("Stub!");
        }

        @Override
        public String toString() {
            throw new RuntimeException("Stub!");
        }
    }

    public static class Component<II extends IntentInfo> {
        public final Package owner;
        public final ArrayList<II> intents;
        public final String className;
        public Bundle metaData;

        ComponentName componentName;
        String componentShortName;

        public Component(final Package owner) {
            throw new RuntimeException("Stub!");
        }

        public Component(final ParsePackageItemArgs args, final PackageItemInfo outInfo) {
            throw new RuntimeException("Stub!");
        }

        public Component(final ParseComponentArgs args, final ComponentInfo outInfo) {
            throw new RuntimeException("Stub!");
        }

        public Component(final Component<II> clone) {
            throw new RuntimeException("Stub!");
        }

        public ComponentName getComponentName() {
            throw new RuntimeException("Stub!");
        }

        public void appendComponentShortName(final StringBuilder sb) {
            throw new RuntimeException("Stub!");
        }

        public void printComponentShortName(final PrintWriter pw) {
            throw new RuntimeException("Stub!");
        }

        public void setPackageName(final String packageName) {
            throw new RuntimeException("Stub!");
        }
    }

    public final static class Permission extends Component<IntentInfo> {
        public final PermissionInfo info;
        public boolean tree;
        public PermissionGroup group;

        public Permission(final Package owner) {
            super(owner);
            throw new RuntimeException("Stub!");
        }

        public Permission(final Package owner, final PermissionInfo info) {
            super(owner);
            throw new RuntimeException("Stub!");
        }

        @Override
        public void setPackageName(final String packageName) {
            throw new RuntimeException("Stub!");
        }

        @Override
        public String toString() {
            throw new RuntimeException("Stub!");
        }
    }

    public final static class PermissionGroup extends Component<IntentInfo> {
        public final PermissionGroupInfo info;

        public PermissionGroup(final Package owner) {
            super(owner);
            throw new RuntimeException("Stub!");
        }

        public PermissionGroup(final Package owner, final PermissionGroupInfo info) {
            super(owner);
            throw new RuntimeException("Stub!");
        }

        @Override
        public void setPackageName(final String packageName) {
            throw new RuntimeException("Stub!");
        }

        @Override
        public String toString() {
            throw new RuntimeException("Stub!");
        }
    }

    public final static class Activity extends Component<ActivityIntentInfo> {
        public final ActivityInfo info;

        public Activity(final ParseComponentArgs args, final ActivityInfo info) {
            super(args, info);
            throw new RuntimeException("Stub!");
        }

        @Override
        public void setPackageName(final String packageName) {
            throw new RuntimeException("Stub!");
        }

        @Override
        public String toString() {
            throw new RuntimeException("Stub!");
        }
    }

    public final static class Service extends Component<ServiceIntentInfo> {
        public final ServiceInfo info;

        public Service(final ParseComponentArgs args, final ServiceInfo info) {
            super(args, info);
            throw new RuntimeException("Stub!");
        }

        @Override
        public void setPackageName(final String packageName) {
            throw new RuntimeException("Stub!");
        }

        @Override
        public String toString() {
            throw new RuntimeException("Stub!");
        }
    }

    public final static class Provider extends Component<ProviderIntentInfo> {
        public final ProviderInfo info;
        public boolean syncable;

        public Provider(final ParseComponentArgs args, final ProviderInfo info) {
            super(args, info);
            throw new RuntimeException("Stub!");
        }

        public Provider(final Provider existingProvider) {
            super(existingProvider);
            throw new RuntimeException("Stub!");
        }

        @Override
        public void setPackageName(final String packageName) {
            throw new RuntimeException("Stub!");
        }

        @Override
        public String toString() {
            throw new RuntimeException("Stub!");
        }
    }

    public final static class Instrumentation extends Component {
        public final InstrumentationInfo info;

        public Instrumentation(final ParsePackageItemArgs args, final InstrumentationInfo info) {
            super(args, info);
            throw new RuntimeException("Stub!");
        }

        @Override
        public void setPackageName(final String packageName) {
            throw new RuntimeException("Stub!");
        }

        @Override
        public String toString() {
            throw new RuntimeException("Stub!");
        }
    }

    @SuppressLint("ParcelCreator")
    public static class IntentInfo extends IntentFilter {
        public boolean hasDefault;
        public int labelRes;
        public CharSequence nonLocalizedLabel;
        public int icon;
        public int logo;
        public int banner;
        public int preferred;
    }

    @SuppressLint("ParcelCreator")
    public final static class ActivityIntentInfo extends IntentInfo {
        public final Activity activity;

        public ActivityIntentInfo(final Activity activity) {
            throw new RuntimeException("Stub!");
        }

        @Override
        public String toString() {
            throw new RuntimeException("Stub!");
        }
    }

    @SuppressLint("ParcelCreator")
    public final static class ServiceIntentInfo extends IntentInfo {
        public final Service service;

        public ServiceIntentInfo(final Service service) {
            throw new RuntimeException("Stub!");
        }

        @Override
        public String toString() {
            throw new RuntimeException("Stub!");
        }
    }

    @SuppressLint("ParcelCreator")
    public static final class ProviderIntentInfo extends IntentInfo {
        public final Provider provider;

        public ProviderIntentInfo(final Provider provider) {
            throw new RuntimeException("Stub!");
        }

        @Override
        public String toString() {
            throw new RuntimeException("Stub!");
        }
    }

    public static class PackageParserException extends Exception {

        public PackageParserException(int error, String detailMessage) {
            super(detailMessage);
            throw new RuntimeException("Stub!");
        }

        public PackageParserException(int error, String detailMessage, Throwable throwable) {
            super(detailMessage, throwable);
            throw new RuntimeException("Stub!");
        }

    }
    
    public static class SigningDetails {
        public Signature[] signatures;
    }

}


================================================
FILE: AndroidStub/src/main/java/android/content/pm/PackageUserState.java
================================================
package android.content.pm;

import android.util.ArraySet;

/**
 * @author johnsonlee
 */
public class PackageUserState {

    public boolean stopped;
    public boolean notLaunched;
    public boolean installed;
    public boolean hidden; // Is the app restricted by owner / admin
    public int enabled;
    public boolean blockUninstall;

    public String lastDisableAppCaller;

    public ArraySet<String> disabledComponents;
    public ArraySet<String> enabledComponents;

    public int domainVerificationStatus;
    public int appLinkGeneration;

    public PackageUserState() {
        throw new RuntimeException("Stub!");
    }

    public PackageUserState(final PackageUserState o) {
        throw new RuntimeException("Stub!");
    }

}


================================================
FILE: AndroidStub/src/main/java/android/content/pm/VerifierInfo.java
================================================
package android.content.pm;

import android.os.Parcel;
import android.os.Parcelable;

import java.security.PublicKey;

/**
 * @author johnsonlee
 */
public class VerifierInfo implements Parcelable{

    public static final Parcelable.Creator<VerifierInfo> CREATOR = new Parcelable.Creator<VerifierInfo>() {
        public VerifierInfo createFromParcel(final Parcel source) {
            return new VerifierInfo(source);
        }

        public VerifierInfo[] newArray(final int size) {
            return new VerifierInfo[size];
        }
    };

    public VerifierInfo(final String packageName, final PublicKey publicKey) {
        throw new RuntimeException("Stub!");
    }

    private VerifierInfo(final Parcel source) {
        throw new RuntimeException("Stub!");
    }

    @Override
    public int describeContents() {
        throw new RuntimeException("Stub!");
    }

    @Override
    public void writeToParcel(final Parcel dest, final int flags) {
        throw new RuntimeException("Stub!");
    }
}


================================================
FILE: AndroidStub/src/main/java/android/content/res/CompatibilityInfo.java
================================================
package android.content.res;

import android.content.pm.ApplicationInfo;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by qiaopu on 2018/5/3.
 */
public class CompatibilityInfo implements Parcelable {
    
    public CompatibilityInfo(ApplicationInfo appInfo, int screenLayout, int sw,
                             boolean forceCompat) {
        throw new RuntimeException("Stub!");
    }
    
    @Override
    public int describeContents() {
        throw new RuntimeException("Stub!");
    }
    
    @Override
    public void writeToParcel(Parcel dest, int flags) {
        throw new RuntimeException("Stub!");
    }
    
    public static final Parcelable.Creator<CompatibilityInfo> CREATOR
        = new Parcelable.Creator<CompatibilityInfo>() {
        @Override
        public CompatibilityInfo createFromParcel(Parcel source) {
            throw new RuntimeException("Stub!");
        }
        
        @Override
        public CompatibilityInfo[] newArray(int size) {
            throw new RuntimeException("Stub!");
        }
    };
    
}



================================================
FILE: AndroidStub/src/main/java/android/content/res/Resources.java
================================================
package android.content.res;

import android.graphics.drawable.Drawable;
import android.util.DisplayMetrics;

/**
 * Created by qiaopu on 2018/5/18.
 */
public class Resources {
    
    public Resources(AssetManager assets, DisplayMetrics metrics, Configuration config) {
        throw new RuntimeException("Stub!");
    }
    
    public final AssetManager getAssets() {
        throw new RuntimeException("Stub!");
    }
    
    public int getColor(int id) throws NotFoundException {
        throw new RuntimeException("Stub!");
    }
    
    public Configuration getConfiguration() {
        throw new RuntimeException("Stub!");
    }
    
    public DisplayMetrics getDisplayMetrics() {
        throw new RuntimeException("Stub!");
    }
    
    public Drawable getDrawable(int id) throws NotFoundException {
        throw new RuntimeException("Stub!");
    }
    
    public String getString(int id) throws NotFoundException {
        throw new RuntimeException("Stub!");
    }
    
    public CharSequence getText(int id) throws NotFoundException {
        throw new RuntimeException("Stub!");
    }
    
    public XmlResourceParser getXml(int id) throws NotFoundException {
        throw new RuntimeException("Stub!");
    }
    
    public ResourcesImpl getImpl() {
        throw new RuntimeException("Stub!");
    }
    
    public final Theme newTheme() {
        throw new RuntimeException("Stub!");
    }
    
    public void updateConfiguration(Configuration config, DisplayMetrics metrics) {
        throw new RuntimeException("Stub!");
    }
    
    public final class Theme {
    
        public void applyStyle(int resId, boolean force) {
            throw new RuntimeException("Stub!");
        }
    
        public TypedArray obtainStyledAttributes(int[] attrs) {
            throw new RuntimeException("Stub!");
        }
    
        public void setTo(Theme other) {
            throw new RuntimeException("Stub!");
        }
        
    }
    
    public static class NotFoundException extends RuntimeException {
    
    }
    
}


================================================
FILE: AndroidStub/src/main/java/android/content/res/ResourcesImpl.java
================================================
package android.content.res;

/**
 * Created by qiaopu on 2018/5/18.
 */
public class ResourcesImpl {

}


================================================
FILE: AndroidStub/src/main/java/android/content/res/ResourcesKey.java
================================================
package android.content.res;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

/**
 * Created by qiaopu on 2018/5/3.
 */
public final class ResourcesKey {
    @Nullable
    public final String mResDir;
    
    @Nullable
    public final String[] mSplitResDirs;
    
    @Nullable
    public final String[] mOverlayDirs;
    
    @Nullable
    public final String[] mLibDirs;
    
    public final int mDisplayId;
    
    @NonNull
    public final Configuration mOverrideConfiguration;
    
    @NonNull
    public final CompatibilityInfo mCompatInfo;
    
    public ResourcesKey(@Nullable String resDir,
                        @Nullable String[] splitResDirs,
                        @Nullable String[] overlayDirs,
                        @Nullable String[] libDirs,
                        int displayId,
                        @Nullable Configuration overrideConfig,
                        @Nullable CompatibilityInfo compatInfo) {
        throw new RuntimeException("Stub!");
    }
    
}



================================================
FILE: AndroidStub/src/main/java/android/databinding/DataBinderMapper.java
================================================
/*
 * Copyright (C) 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.databinding;
import android.view.View;
/**
 * This class will be stripped from the jar and then replaced by the annotation processor
 * as part of the code generation step. This class's existence is just to ensure that
 * compile works and no reflection is needed to access the generated class.
 */
class DataBinderMapper {
    public ViewDataBinding getDataBinder(DataBindingComponent bindingComponent, View view,
            int layoutId) {
        return null;
    }
    ViewDataBinding getDataBinder(DataBindingComponent bindingComponent, View[] view, int layoutId) {
        return null;
    }
    public int getLayoutId(String tag) { return 0; }
    public String convertBrIdToString(int id) {
        return null;
    }
    public static int TARGET_MIN_SDK = 0;
}

================================================
FILE: AndroidStub/src/main/java/android/databinding/DataBindingComponent.java
================================================
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package android.databinding;
/**
 * This interface is generated during compilation to contain getters for all used instance
 * BindingAdapters. When a BindingAdapter is an instance method, an instance of the class
 * implementing the method must be instantiated. This interface will be generated with a getter
 * for each class with the name get* where * is simple class name of the declaring BindingAdapter
 * class/interface. Name collisions will be resolved by adding a numeric suffix to the getter.
 * <p>
 * An instance of this class may also be passed into static or instance BindingAdapters as the
 * first parameter.
 * <p>
 * If you are using Dagger 2, you should extend this interface and annotate the extended interface
 * as a Component.
 */
public interface DataBindingComponent {
}

================================================
FILE: AndroidStub/src/main/java/android/os/ServiceManager.java
================================================
package android.os;

import java.util.HashMap;
import java.util.Map;

/**
 * @author johnsonlee
 */
public final class ServiceManager {

    private static HashMap<String, IBinder> sCache = new HashMap<String, IBinder>();

    public static IBinder getService(final String name) {
        throw new RuntimeException("Stub!");
    }

    public static void addService(final String name, final IBinder service) {
        throw new RuntimeException("Stub!");
    }

    public static void addService(final String name, final IBinder service, final boolean allowIsolated) {
        throw new RuntimeException("Stub!");
    }

    public static IBinder checkService(final String name) {
        throw new RuntimeException("Stub!");
    }

    public static String[] listServices() throws RemoteException {
        throw new RuntimeException("Stub!");
    }

    public static void initServiceCache(final Map<String, IBinder> cache) {
        throw new RuntimeException("Stub!");
    }

}


================================================
FILE: AndroidStub/src/main/java/android/os/SystemProperties.java
================================================
package android.os;

/**
 * @author johnsonlee
 */
public class SystemProperties {

    public static String get(final String key) {
        throw new RuntimeException("Stub!");
    }

    public static String get(final String key, final String def) {
        throw new RuntimeException("Stub!");
    }

    public static int getInt(final String key, final int def) {
        throw new RuntimeException("Stub!");
    }

    public static long getLong(final String key, final long def) {
        throw new RuntimeException("Stub!");
    }

    public static boolean getBoolean(final String key, final boolean def) {
        throw new RuntimeException("Stub!");
    }

    public static void set(final String key, final String val) {
        throw new RuntimeException("Stub!");
    }

    public static void addChangeCallback(final Runnable callback) {
        throw new RuntimeException("Stub!");
    }
}


================================================
FILE: AndroidStub/src/main/java/android/util/Singleton.java
================================================
package android.util;

/**
 * @author johnsonlee
 */
public abstract class Singleton<T> {
    public Singleton() {
        throw new RuntimeException("Stub!");
    }

    protected abstract T create();

    public T get() {
        throw new RuntimeException("Stub!");
    }
}


================================================
FILE: AndroidStub/src/main/java/com/android/internal/R.java
================================================
package com.android.internal;

/**
 * @author johnsonlee
 */
public final class R {

    public static final class id {

        public static int action0 = 0;

        public static int actions = 0;

        public static int action_divider = 0;

        public static int big_picture = 0;

        public static int big_text = 0;

        public static int big_text2 = 0;

        public static int chronometer = 0;

        public static int icon = 0;

        public static int inbox_text0 = 0;

        public static int inbox_text1 = 0;

        public static int inbox_text2 = 0;

        public static int inbox_text3 = 0;

        public static int inbox_text4 = 0;

        public static int inbox_text5 = 0;

        public static int inbox_text6 = 0;

        public static int inbox_end_pad = 0;

        public static int info = 0;

        public static int line1 = 0;

        public static int line3 = 0;

        public static int overflow_divider = 0;

        public static int progress = 0;

        public static int title = 0;

        public static int text = 0;

        public static int text2 = 0;

        public static int time = 0;

        public static int right_icon = 0;

        public static int fillInIntent = 0;

        public static int status_bar_latest_event_content = 0;
    }

}


================================================
FILE: CONTRIBUTING.md
================================================
# Contribution Guideline

Thanks for considering to contribute this project. All issues and pull requests are highly appreciated.

## Pull Requests

Before sending pull request to this project, please read and follow guidelines below.

1. Branch: We only accept pull request on `dev` branch.
2. Coding style: Follow the coding style used in VirtualAPK.
3. Commit message: Use English and be aware of your spell.
4. Test: Make sure to test your code.

Add device mode, API version, related log, screenshots and other related information in your pull request if possible.

NOTE: We assume all your contribution can be licensed under the [Apache License 2.0](https://github.com/didi/VirtualAPK/blob/master/LICENSE). 

## Issues

We love clearly described issues. :)

Following information can help us to resolve the issue faster.

* Device mode and hardware information.
* API version.
* Logs.
* Screenshots.
* Steps to reproduce the issue.


================================================
FILE: CoreLibrary/.gitignore
================================================
/build


================================================
FILE: CoreLibrary/build.gradle
================================================
import com.android.build.gradle.api.ApplicationVariant
import com.android.build.gradle.api.LibraryVariant
import com.google.common.base.Joiner

apply plugin: 'com.android.library'

android {
    compileSdkVersion VERSION_COMPILE_SDK
    buildToolsVersion VERSION_BUILD_TOOLS

    defaultConfig {
        minSdkVersion VERSION_MIN_SDK
        targetSdkVersion VERSION_TARGET_SDK
        versionCode 1
        versionName "1.0.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility SOURCE_COMPATIBILITY
    }
    lintOptions {
        abortOnError false
    }
}

repositories {
    mavenCentral()
    jcenter()
}

final String projectAndroidStub = ':AndroidStub'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    provided project(projectAndroidStub)

    testCompile 'junit:junit:4.12'
}

// Using Stub classes first when compiling.
afterEvaluate {
    project.android.libraryVariants.each { LibraryVariant variant ->
        variant.javaCompile.doFirst { JavaCompile javaCompile ->
            String projectAndroidStubPath = project.project(projectAndroidStub).projectDir.canonicalPath
//            println "projectAndroidStubPath: ${projectAndroidStubPath}"
            File stubPath = javaCompile.classpath.find {
                it.canonicalPath.startsWith(projectAndroidStubPath)
            }
            if (stubPath == null) {
                throw new RuntimeException("reset bootclasspath error.")
            }
            javaCompile.options.setBootClasspath(Joiner.on(File.pathSeparator).join(stubPath, javaCompile.options.bootClasspath))
        }
    }
}

apply from: 'upload.gradle'


================================================
FILE: CoreLibrary/gradle.properties
================================================



================================================
FILE: CoreLibrary/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/didi/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}


================================================
FILE: CoreLibrary/src/androidTest/java/com/didi/virtualapk/core/ApplicationTest.java
================================================
package com.didi.virtualapk.core;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}

================================================
FILE: CoreLibrary/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.didi.virtualapk.core">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    
    <application>
        <activity android:exported="false" android:name="com.didi.virtualapk.delegate.StubActivity" android:launchMode="standard"/>
        <!-- Stub Activities -->
        <activity android:exported="false" android:name=".A$1" android:launchMode="standard"/>
        <activity android:exported="false" android:name=".A$2" android:launchMode="standard"
            android:theme="@android:style/Theme.Translucent" />

        <!-- Stub Activities -->
        <activity android:exported="false" android:name=".B$1" android:launchMode="singleTop"/>
        <activity android:exported="false" android:name=".B$2" android:launchMode="singleTop"/>
        <activity android:exported="false" android:name=".B$3" android:launchMode="singleTop"/>
        <activity android:exported="false" android:name=".B$4" android:launchMode="singleTop"/>
        <activity android:exported="false" android:name=".B$5" android:launchMode="singleTop"/>
        <activity android:exported="false" android:name=".B$6" android:launchMode="singleTop"/>
        <activity android:exported="false" android:name=".B$7" android:launchMode="singleTop"/>
        <activity android:exported="false" android:name=".B$8" android:launchMode="singleTop"/>

        <!-- Stub Activities -->
        <activity android:exported="false" android:name=".C$1" android:launchMode="singleTask"/>
        <activity android:exported="false" android:name=".C$2" android:launchMode="singleTask"/>
        <activity android:exported="false" android:name=".C$3" android:launchMode="singleTask"/>
        <activity android:exported="false" android:name=".C$4" android:launchMode="singleTask"/>
        <activity android:exported="false" android:name=".C$5" android:launchMode="singleTask"/>
        <activity android:exported="false" android:name=".C$6" android:launchMode="singleTask"/>
        <activity android:exported="false" android:name=".C$7" android:launchMode="singleTask"/>
        <activity android:exported="false" android:name=".C$8" android:launchMode="singleTask"/>

        <!-- Stub Activities -->
        <activity android:exported="false" android:name=".D$1" android:launchMode="singleInstance"/>
        <activity android:exported="false" android:name=".D$2" android:launchMode="singleInstance"/>
        <activity android:exported="false" android:name=".D$3" android:launchMode="singleInstance"/>
        <activity android:exported="false" android:name=".D$4" android:launchMode="singleInstance"/>
        <activity android:exported="false" android:name=".D$5" android:launchMode="singleInstance"/>
        <activity android:exported="false" android:name=".D$6" android:launchMode="singleInstance"/>
        <activity android:exported="false" android:name=".D$7" android:launchMode="singleInstance"/>
        <activity android:exported="false" android:name=".D$8" android:launchMode="singleInstance"/>

        <!-- Local Service running in main process -->
        <service android:exported="false" android:name="com.didi.virtualapk.delegate.LocalService" />

        <!-- Daemon Service running in child process -->
        <service android:exported="false" android:name="com.didi.virtualapk.delegate.RemoteService" android:process=":daemon">
            <intent-filter>
                <action android:name="${applicationId}.intent.ACTION_DAEMON_SERVICE" />
            </intent-filter>
        </service>

        <provider
            android:exported="false"
            android:name="com.didi.virtualapk.delegate.RemoteContentProvider"
            android:authorities="${applicationId}.VirtualAPK.Provider"
            android:process=":daemon" />

    </application>

</manifest>


================================================
FILE: CoreLibrary/src/main/java/android/content/ContentResolverWrapper.java
================================================
package android.content;

import android.annotation.TargetApi;
import android.os.Build;

/**
 * Wrapper of {@link ContentResolver}
 * Created by qiaopu on 2018/5/7.
 */
public abstract class ContentResolverWrapper extends ContentResolver {
    
    ContentResolver mBase;
    
    public ContentResolverWrapper(Context context) {
        super(context);
        mBase = context.getContentResolver();
    }
    
    @Override
    protected IContentProvider acquireProvider(Context context, String auth) {
        return mBase.acquireProvider(context, auth);
    }
    
    @Override
    protected IContentProvider acquireExistingProvider(Context context, String auth) {
        return mBase.acquireExistingProvider(context, auth);
    }
    
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    @Override
    protected IContentProvider acquireUnstableProvider(Context context, String auth) {
        return mBase.acquireUnstableProvider(context, auth);
    }
    
    @Override
    public boolean releaseProvider(IContentProvider icp) {
        return mBase.releaseProvider(icp);
    }
    
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    @Override
    public boolean releaseUnstableProvider(IContentProvider icp) {
        return mBase.releaseUnstableProvider(icp);
    }
    
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    @Override
    public void unstableProviderDied(IContentProvider icp) {
        mBase.unstableProviderDied(icp);
    }
    
    @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
    @Override
    public void appNotRespondingViaProvider(IContentProvider icp) {
        // dark greylist in Android P
//        mBase.appNotRespondingViaProvider(icp);
    }

}


================================================
FILE: CoreLibrary/src/main/java/android/databinding/DataBinderMapperProxy.java
================================================
package android.databinding;

import android.support.annotation.NonNull;
import android.util.Log;
import android.view.View;

import com.didi.virtualapk.PluginManager;
import com.didi.virtualapk.internal.Constants;
import com.didi.virtualapk.internal.LoadedPlugin;

import java.util.LinkedList;

/**
 * Replace {@link DataBindingUtil#sMapper}.
 * Created by qiaopu on 2018/4/11.
 */
public class DataBinderMapperProxy extends DataBinderMapper implements PluginManager.Callback {
    public static final String TAG = Constants.TAG_PREFIX + "DataBinderMapperProxy";
    
    private final LinkedList<DataBinderMapper> mMappers;
    private DataBinderMapper[] mCache;
    
    public DataBinderMapperProxy(@NonNull Object source) {
        mMappers = new LinkedList<>();
    
        addMapper((DataBinderMapper) source);
    }
    
    @Override
    public ViewDataBinding getDataBinder(DataBindingComponent bindingComponent, View view, int layoutId) {
        ViewDataBinding viewDataBinding;
    
        for (DataBinderMapper mapper : getCache()) {
            viewDataBinding = mapper.getDataBinder(bindingComponent, view, layoutId);
            if (viewDataBinding != null) {
//                Log.d(TAG, "Found by mapper: " + mapper);
                return viewDataBinding;
            }
        }
        
        return null;
    }
    
    @Override
    ViewDataBinding getDataBinder(DataBindingComponent bindingComponent, View[] view, int layoutId) {
        ViewDataBinding viewDataBinding;
    
        for (DataBinderMapper mapper : getCache()) {
            viewDataBinding = mapper.getDataBinder(bindingComponent, view, layoutId);
            if (viewDataBinding != null) {
//                Log.d(TAG, "Found by mapper: " + mapper);
                return viewDataBinding;
            }
        }
    
        return null;
    }
    
    @Override
    public int getLayoutId(String tag) {
        int layoutId;
    
        for (DataBinderMapper mapper : getCache()) {
            layoutId = mapper.getLayoutId(tag);
            if (layoutId != 0) {
//                Log.d(TAG, "Found by mapper: " + mapper);
                return layoutId;
            }
        }
    
        return 0;
    }
    
    @Override
    public String convertBrIdToString(int id) {
        String brId;
    
        for (DataBinderMapper mapper : getCache()) {
            brId = mapper.convertBrIdToString(id);
            if (brId != null) {
//                Log.d(TAG, "Found by mapper: " + mapper);
                return brId;
            }
        }
    
        return null;
    }
    
    @Override
    public void onAddedLoadedPlugin(LoadedPlugin plugin) {
        try {
            String clsName = "android.databinding.DataBinderMapper_" + plugin.getPackageName().replace('.', '_');
            Log.d(TAG, "Try to find the class: " + clsName);
            Class cls = Class.forName(clsName, true, plugin.getClassLoader());
            Object obj = cls.newInstance();
    
            addMapper((DataBinderMapper) obj);
            
        } catch (Exception e) {
            Log.w(TAG, e);
        }
    }
    
    private void addMapper(DataBinderMapper mapper) {
        int size = 0;
        synchronized (mMappers) {
            mMappers.add(mapper);
            mCache = null;
            size = mMappers.size();
        }
    
        Log.d(TAG, "Added mapper: " + mapper + ", size: " + size);
    }
    
    private DataBinderMapper[] getCache() {
        synchronized (mMappers) {
            if (mCache == null) {
                mCache = mMappers.toArray(new DataBinderMapper[mMappers.size()]);
            }
            return mCache;
        }
    }
}


================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/PluginManager.java
================================================
/*
 * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.didi.virtualapk;

import android.app.ActivityManager;
import android.app.ActivityManagerNative;
import android.app.ActivityThread;
import android.app.Application;
import android.app.IActivityManager;
import android.app.Instrumentation;
import android.content.ComponentName;
import android.content.Context;
import android.content.IContentProvider;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.util.Singleton;

import com.didi.virtualapk.delegate.ActivityManagerProxy;
import com.didi.virtualapk.delegate.IContentProviderProxy;
import com.didi.virtualapk.delegate.RemoteContentProvider;
import com.didi.virtualapk.internal.ComponentsHandler;
import com.didi.virtualapk.internal.Constants;
import com.didi.virtualapk.internal.LoadedPlugin;
import com.didi.virtualapk.internal.VAInstrumentation;
import com.didi.virtualapk.internal.utils.PluginUtil;
import com.didi.virtualapk.utils.Reflector;
import com.didi.virtualapk.utils.RunUtil;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by renyugang on 16/8/9.
 */
public class PluginManager {

    public static final String TAG = Constants.TAG_PREFIX + "PluginManager";

    private static volatile PluginManager sInstance = null;

    // Context of host app
    protected final Context mContext;
    protected final Application mApplication;
    protected ComponentsHandler mComponentsHandler;
    protected final Map<String, LoadedPlugin> mPlugins = new ConcurrentHashMap<>();
    protected final List<Callback> mCallbacks = new ArrayList<>();

    protected VAInstrumentation mInstrumentation; // Hooked instrumentation
    protected IActivityManager mActivityManager; // Hooked IActivityManager binder
    protected IContentProvider mIContentProvider; // Hooked IContentProvider binder

    public static PluginManager getInstance(Context base) {
        if (sInstance == null) {
            synchronized (PluginManager.class) {
                if (sInstance == null) {
                    sInstance = createInstance(base);
                }
            }
        }

        return sInstance;
    }
    
    private static PluginManager createInstance(Context context) {
        try {
            Bundle metaData = context.getPackageManager()
                                     .getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA)
                                     .metaData;
            
            if (metaData == null) {
                return new PluginManager(context);
            }
            
            String factoryClass = metaData.getString("VA_FACTORY");
            
            if (factoryClass == null) {
                return new PluginManager(context);
            }
            
            PluginManager pluginManager = Reflector.on(factoryClass).method("create", Context.class).call(context);
            
            if (pluginManager != null) {
                Log.d(TAG, "Created a instance of " + pluginManager.getClass());
                return pluginManager;
            }
    
        } catch (Exception e) {
            Log.w(TAG, "Created the instance error!", e);
        }
    
        return new PluginManager(context);
    }

    protected PluginManager(Context context) {
        if (context instanceof Application) {
            this.mApplication = (Application) context;
            this.mContext = mApplication.getBaseContext();
        } else {
            final Context app = context.getApplicationContext();
            if (app == null) {
                this.mContext = context;
                this.mApplication = ActivityThread.currentApplication();
            } else {
                this.mApplication = (Application) app;
                this.mContext = mApplication.getBaseContext();
            }
        }
        
        mComponentsHandler = createComponentsHandler();
        hookCurrentProcess();
    }

    protected void hookCurrentProcess() {
        hookInstrumentationAndHandler();
        hookSystemServices();
        hookDataBindingUtil();
    }

    public void init() {
        RunUtil.getThreadPool().execute(new Runnable() {
            @Override
            public void run() {
                doInWorkThread();
            }
        });
    }

    protected void doInWorkThread() {
    }
    
    public Application getHostApplication() {
        return this.mApplication;
    }
    
    protected ComponentsHandler createComponentsHandler() {
        return new ComponentsHandler(this);
    }
    
    protected VAInstrumentation createInstrumentation(Instrumentation origin) throws Exception {
        return new VAInstrumentation(this, origin);
    }
    
    protected ActivityManagerProxy createActivityManagerProxy(IActivityManager origin) throws Exception {
        return new ActivityManagerProxy(this, origin);
    }
    
    protected LoadedPlugin createLoadedPlugin(File apk) throws Exception {
        return new LoadedPlugin(this, this.mContext, apk);
    }
    
    protected void hookDataBindingUtil() {
        Reflector.QuietReflector reflector = Reflector.QuietReflector.on("android.databinding.DataBindingUtil").field("sMapper");
        Object old = reflector.get();
        if (old != null) {
            try {
                Callback callback = Reflector.on("android.databinding.DataBinderMapperProxy").constructor().newInstance();
                reflector.set(callback);
                addCallback(callback);
                Log.d(TAG, "hookDataBindingUtil succeed : " + callback);
            } catch (Reflector.ReflectedException e) {
                Log.w(TAG, e);
            }
        }
    }
    
    public void addCallback(Callback callback) {
        if (callback == null) {
            return;
        }
        synchronized (mCallbacks) {
            if (mCallbacks.contains(callback)) {
                throw new RuntimeException("Already added " + callback + "!");
            }
            mCallbacks.add(callback);
        }
    }
    
    public void removeCallback(Callback callback) {
        synchronized (mCallbacks) {
            mCallbacks.remove(callback);
        }
    }

    /**
     * hookSystemServices, but need to compatible with Android O in future.
     */
    protected void hookSystemServices() {
        try {
            Singleton<IActivityManager> defaultSingleton;
    
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                defaultSingleton = Reflector.on(ActivityManager.class).field("IActivityManagerSingleton").get();
            } else {
                defaultSingleton = Reflector.on(ActivityManagerNative.class).field("gDefault").get();
            }
            IActivityManager origin = defaultSingleton.get();
            IActivityManager activityManagerProxy = (IActivityManager) Proxy.newProxyInstance(mContext.getClassLoader(), new Class[] { IActivityManager.class },
                createActivityManagerProxy(origin));

            // Hook IActivityManager from ActivityManagerNative
            Reflector.with(defaultSingleton).field("mInstance").set(activityManagerProxy);

            if (defaultSingleton.get() == activityManagerProxy) {
                this.mActivityManager = activityManagerProxy;
                Log.d(TAG, "hookSystemServices succeed : " + mActivityManager);
            }
        } catch (Exception e) {
            Log.w(TAG, e);
        }
    }
    
    protected void hookInstrumentationAndHandler() {
        try {
            ActivityThread activityThread = ActivityThread.currentActivityThread();
            Instrumentation baseInstrumentation = activityThread.getInstrumentation();
//            if (baseInstrumentation.getClass().getName().contains("lbe")) {
//                // reject executing in paralell space, for example, lbe.
//                System.exit(0);
//            }
    
            final VAInstrumentation instrumentation = createInstrumentation(baseInstrumentation);
            
            Reflector.with(activityThread).field("mInstrumentation").set(instrumentation);
            Handler mainHandler = Reflector.with(activityThread).method("getHandler").call();
            Reflector.with(mainHandler).field("mCallback").set(instrumentation);
            this.mInstrumentation = instrumentation;
            Log.d(TAG, "hookInstrumentationAndHandler succeed : " + mInstrumentation);
        } catch (Exception e) {
            Log.w(TAG, e);
        }
    }

    protected void hookIContentProviderAsNeeded() {
        Uri uri = Uri.parse(RemoteContentProvider.getUri(mContext));
        mContext.getContentResolver().call(uri, "wakeup", null, null);
        try {
            Field authority = null;
            Field provider = null;
            ActivityThread activityThread = ActivityThread.currentActivityThread();
            Map providerMap = Reflector.with(activityThread).field("mProviderMap").get();
            Iterator iter = providerMap.entrySet().iterator();
            while (iter.hasNext()) {
                Map.Entry entry = (Map.Entry) iter.next();
                Object key = entry.getKey();
                Object val = entry.getValue();
                String auth;
                if (key instanceof String) {
                    auth = (String) key;
                } else {
                    if (authority == null) {
                        authority = key.getClass().getDeclaredField("authority");
                        authority.setAccessible(true);
                    }
                    auth = (String) authority.get(key);
                }
                if (auth.equals(RemoteContentProvider.getAuthority(mContext))) {
                    if (provider == null) {
                        provider = val.getClass().getDeclaredField("mProvider");
                        provider.setAccessible(true);
                    }
                    IContentProvider rawProvider = (IContentProvider) provider.get(val);
                    IContentProvider proxy = IContentProviderProxy.newInstance(mContext, rawProvider);
                    mIContentProvider = proxy;
                    Log.d(TAG, "hookIContentProvider succeed : " + mIContentProvider);
                    break;
                }
            }
        } catch (Exception e) {
            Log.w(TAG, e);
        }
    }

    /**
     * load a plugin into memory, then invoke it's Application.
     * @param apk the file of plugin, should end with .apk
     * @throws Exception
     */
    public void loadPlugin(File apk) throws Exception {
        if (null == apk) {
            throw new IllegalArgumentException("error : apk is null.");
        }

        if (!apk.exists()) {
            // throw the FileNotFoundException by opening a stream.
            InputStream in = new FileInputStream(apk);
            in.close();
        }

        LoadedPlugin plugin = createLoadedPlugin(apk);
        
        if (null == plugin) {
            throw new RuntimeException("Can't load plugin which is invalid: " + apk.getAbsolutePath());
        }
        
        this.mPlugins.put(plugin.getPackageName(), plugin);
        synchronized (mCallbacks) {
            for (int i = 0; i < mCallbacks.size(); i++) {
                mCallbacks.get(i).onAddedLoadedPlugin(plugin);
            }
        }
    }

    public LoadedPlugin getLoadedPlugin(Intent intent) {
        return getLoadedPlugin(PluginUtil.getComponent(intent));
    }

    public LoadedPlugin getLoadedPlugin(ComponentName component) {
        if (component == null) {
            return null;
        }
        return this.getLoadedPlugin(component.getPackageName());
    }

    public LoadedPlugin getLoadedPlugin(String packageName) {
        return this.mPlugins.get(packageName);
    }

    public List<LoadedPlugin> getAllLoadedPlugins() {
        List<LoadedPlugin> list = new ArrayList<>();
        list.addAll(mPlugins.values());
        return list;
    }

    public Context getHostContext() {
        return this.mContext;
    }

    public VAInstrumentation getInstrumentation() {
        return this.mInstrumentation;
    }

    public IActivityManager getActivityManager() {
        return this.mActivityManager;
    }

    public synchronized IContentProvider getIContentProvider() {
        if (mIContentProvider == null) {
            hookIContentProviderAsNeeded();
        }

        return mIContentProvider;
    }

    public ComponentsHandler getComponentsHandler() {
        return mComponentsHandler;
    }

    public ResolveInfo resolveActivity(Intent intent) {
        return this.resolveActivity(intent, 0);
    }

    public ResolveInfo resolveActivity(Intent intent, int flags) {
        for (LoadedPlugin plugin : this.mPlugins.values()) {
            ResolveInfo resolveInfo = plugin.resolveActivity(intent, flags);
            if (null != resolveInfo) {
                return resolveInfo;
            }
        }

        return null;
    }

    public ResolveInfo resolveService(Intent intent, int flags) {
        for (LoadedPlugin plugin : this.mPlugins.values()) {
            ResolveInfo resolveInfo = plugin.resolveService(intent, flags);
            if (null != resolveInfo) {
                return resolveInfo;
            }
        }

        return null;
    }

    public ProviderInfo resolveContentProvider(String name, int flags) {
        for (LoadedPlugin plugin : this.mPlugins.values()) {
            ProviderInfo providerInfo = plugin.resolveContentProvider(name, flags);
            if (null != providerInfo) {
                return providerInfo;
            }
        }

        return null;
    }

    /**
     * used in PluginPackageManager, do not invoke it from outside.
     */
    @Deprecated
    public List<ResolveInfo> queryIntentActivities(Intent intent, int flags) {
        List<ResolveInfo> resolveInfos = new ArrayList<ResolveInfo>();

        for (LoadedPlugin plugin : this.mPlugins.values()) {
            List<ResolveInfo> result = plugin.queryIntentActivities(intent, flags);
            if (null != result && result.size() > 0) {
                resolveInfos.addAll(result);
            }
        }

        return resolveInfos;
    }

    /**
     * used in PluginPackageManager, do not invoke it from outside.
     */
    @Deprecated
    public List<ResolveInfo> queryIntentServices(Intent intent, int flags) {
        List<ResolveInfo> resolveInfos = new ArrayList<ResolveInfo>();

        for (LoadedPlugin plugin : this.mPlugins.values()) {
            List<ResolveInfo> result = plugin.queryIntentServices(intent, flags);
            if (null != result && result.size() > 0) {
                resolveInfos.addAll(result);
            }
        }

        return resolveInfos;
    }

    /**
     * used in PluginPackageManager, do not invoke it from outside.
     */
    @Deprecated
    public List<ResolveInfo> queryBroadcastReceivers(Intent intent, int flags) {
        List<ResolveInfo> resolveInfos = new ArrayList<ResolveInfo>();

        for (LoadedPlugin plugin : this.mPlugins.values()) {
            List<ResolveInfo> result = plugin.queryBroadcastReceivers(intent, flags);
            if (null != result && result.size() > 0) {
                resolveInfos.addAll(result);
            }
        }

        return resolveInfos;
    }

    public interface Callback {
        void onAddedLoadedPlugin(LoadedPlugin plugin);
    }
}

================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/delegate/ActivityManagerProxy.java
================================================
/*
 * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.didi.virtualapk.delegate;

import android.app.ActivityManagerNative;
import android.app.IActivityManager;
import android.app.IApplicationThread;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.os.Bundle;
import android.os.DeadObjectException;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.Log;

import com.didi.virtualapk.PluginManager;
import com.didi.virtualapk.internal.Constants;
import com.didi.virtualapk.internal.utils.PluginUtil;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author johnsonlee
 */
public class ActivityManagerProxy implements InvocationHandler {

    private static final String TAG = Constants.TAG_PREFIX + "IActivityManagerProxy";

    public static final int INTENT_SENDER_BROADCAST = 1;
    public static final int INTENT_SENDER_ACTIVITY = 2;
    public static final int INTENT_SENDER_ACTIVITY_RESULT = 3;
    public static final int INTENT_SENDER_SERVICE = 4;

    private PluginManager mPluginManager;
    private IActivityManager mActivityManager;

    public ActivityManagerProxy(PluginManager pluginManager, IActivityManager activityManager) {
        this.mPluginManager = pluginManager;
        this.mActivityManager = activityManager;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        if ("startService".equals(method.getName())) {
            try {
                return startService(proxy, method, args);
            } catch (Throwable e) {
                Log.e(TAG, "Start service error", e);
            }
        } else if ("stopService".equals(method.getName())) {
            try {
                return stopService(proxy, method, args);
            } catch (Throwable e) {
                Log.e(TAG, "Stop Service error", e);
            }
        } else if ("stopServiceToken".equals(method.getName())) {
            try {
                return stopServiceToken(proxy, method, args);
            } catch (Throwable e) {
                Log.e(TAG, "Stop service token error", e);
            }
        } else if ("bindService".equals(method.getName())) {
            try {
                return bindService(proxy, method, args);
            } catch (Throwable e) {
                Log.w(TAG, e);
            }
        } else if ("unbindService".equals(method.getName())) {
            try {
                return unbindService(proxy, method, args);
            } catch (Throwable e) {
                Log.w(TAG, e);
            }
        } else if ("getIntentSender".equals(method.getName())) {
            try {
                getIntentSender(method, args);
            } catch (Exception e) {
                Log.w(TAG, e);
            }
        } else if ("overridePendingTransition".equals(method.getName())){
            try {
                overridePendingTransition(method, args);
            } catch (Exception e){
                Log.w(TAG, e);
            }
        }

        try {
            // sometimes system binder has problems.
            return method.invoke(this.mActivityManager, args);
        } catch (Throwable th) {
            Throwable c = th.getCause();
            if (c != null && c instanceof DeadObjectException) {
                // retry connect to system binder
                IBinder ams = ServiceManager.getService(Context.ACTIVITY_SERVICE);
                if (ams != null) {
                    IActivityManager am = ActivityManagerNative.asInterface(ams);
                    mActivityManager = am;
                }
            }

            Throwable cause = th;
            do {
                if (cause instanceof RemoteException) {
                    throw cause;
                }
            } while ((cause = cause.getCause()) != null);

            throw c != null ? c : th;
        }

    }

    protected Object startService(Object proxy, Method method, Object[] args) throws Throwable {
        IApplicationThread appThread = (IApplicationThread) args[0];
        Intent target = (Intent) args[1];
        ResolveInfo resolveInfo = this.mPluginManager.resolveService(target, 0);
        if (null == resolveInfo || null == resolveInfo.serviceInfo) {
            // is host service
            return method.invoke(this.mActivityManager, args);
        }

        return startDelegateServiceForTarget(target, resolveInfo.serviceInfo, null, RemoteService.EXTRA_COMMAND_START_SERVICE);
    }

    protected Object stopService(Object proxy, Method method, Object[] args) throws Throwable {
        Intent target = (Intent) args[1];
        ResolveInfo resolveInfo = this.mPluginManager.resolveService(target, 0);
        if (null == resolveInfo || null == resolveInfo.serviceInfo) {
            // is hot service
            return method.invoke(this.mActivityManager, args);
        }

        startDelegateServiceForTarget(target, resolveInfo.serviceInfo, null, RemoteService.EXTRA_COMMAND_STOP_SERVICE);
        return 1;
    }

    protected Object stopServiceToken(Object proxy, Method method, Object[] args) throws Throwable {
        ComponentName component = (ComponentName) args[0];
        Intent target = new Intent().setComponent(component);
        ResolveInfo resolveInfo = this.mPluginManager.resolveService(target, 0);
        if (null == resolveInfo || null == resolveInfo.serviceInfo) {
            // is hot service
            return method.invoke(this.mActivityManager, args);
        }

        startDelegateServiceForTarget(target, resolveInfo.serviceInfo, null, RemoteService.EXTRA_COMMAND_STOP_SERVICE);
        return true;
    }

    protected Object bindService(Object proxy, Method method, Object[] args) throws Throwable {
        Intent target = (Intent) args[2];
        ResolveInfo resolveInfo = this.mPluginManager.resolveService(target, 0);
        if (null == resolveInfo || null == resolveInfo.serviceInfo) {
            // is host service
            return method.invoke(this.mActivityManager, args);
        }

        Bundle bundle = new Bundle();
        PluginUtil.putBinder(bundle, "sc", (IBinder) args[4]);
        startDelegateServiceForTarget(target, resolveInfo.serviceInfo, bundle, RemoteService.EXTRA_COMMAND_BIND_SERVICE);
        mPluginManager.getComponentsHandler().remberIServiceConnection((IBinder) args[4], target);
        return 1;
    }

    protected Object unbindService(Object proxy, Method method, Object[] args) throws Throwable {
        IBinder iServiceConnection = (IBinder)args[0];
        Intent target = mPluginManager.getComponentsHandler().forgetIServiceConnection(iServiceConnection);
        if (target == null) {
            // is host service
            return method.invoke(this.mActivityManager, args);
        }

        ResolveInfo resolveInfo = this.mPluginManager.resolveService(target, 0);
        startDelegateServiceForTarget(target, resolveInfo.serviceInfo, null, RemoteService.EXTRA_COMMAND_UNBIND_SERVICE);
        return true;
    }

    protected ComponentName startDelegateServiceForTarget(Intent target, ServiceInfo serviceInfo, Bundle extras, int command) {
        Intent wrapperIntent = wrapperTargetIntent(target, serviceInfo, extras, command);
        return mPluginManager.getHostContext().startService(wrapperIntent);
    }

    protected Intent wrapperTargetIntent(Intent target, ServiceInfo serviceInfo, Bundle extras, int command) {
        // fill in service with ComponentName
        target.setComponent(new ComponentName(serviceInfo.packageName, serviceInfo.name));
        String pluginLocation = mPluginManager.getLoadedPlugin(target.getComponent()).getLocation();

        // start delegate service to run plugin service inside
        boolean local = PluginUtil.isLocalService(serviceInfo);
        Class<? extends Service> delegate = local ? LocalService.class : RemoteService.class;
        Intent intent = new Intent();
        intent.setClass(mPluginManager.getHostContext(), delegate);
        intent.putExtra(RemoteService.EXTRA_TARGET, target);
        intent.putExtra(RemoteService.EXTRA_COMMAND, command);
        intent.putExtra(RemoteService.EXTRA_PLUGIN_LOCATION, pluginLocation);
        if (extras != null) {
            intent.putExtras(extras);
        }

        return intent;
    }

    protected void getIntentSender(Method method, Object[] args) {
        String hostPackageName = mPluginManager.getHostContext().getPackageName();
        args[1] = hostPackageName;

        Intent target = ((Intent[]) args[5])[0];
        int intentSenderType = (int)args[0];
        if (intentSenderType == INTENT_SENDER_ACTIVITY) {
            mPluginManager.getComponentsHandler().transformIntentToExplicitAsNeeded(target);
            mPluginManager.getComponentsHandler().markIntentIfNeeded(target);
        } else if (intentSenderType == INTENT_SENDER_SERVICE) {
            ResolveInfo resolveInfo = this.mPluginManager.resolveService(target, 0);
            if (resolveInfo != null && resolveInfo.serviceInfo != null) {
                // find plugin service
                Intent wrapperIntent  = wrapperTargetIntent(target, resolveInfo.serviceInfo, null, RemoteService.EXTRA_COMMAND_START_SERVICE);
                ((Intent[]) args[5])[0] = wrapperIntent;
            }
        } else if (intentSenderType == INTENT_SENDER_BROADCAST) {
            // no action
        }
    }

    protected void overridePendingTransition(Method method, Object[] args) {
        String hostPackageName = mPluginManager.getHostContext().getPackageName();
        args[1] = hostPackageName;
    }

}


================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/delegate/IContentProviderProxy.java
================================================
/*
 * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.didi.virtualapk.delegate;

import android.content.Context;
import android.content.IContentProvider;
import android.content.pm.ProviderInfo;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;

import com.didi.virtualapk.PluginManager;
import com.didi.virtualapk.internal.Constants;
import com.didi.virtualapk.internal.LoadedPlugin;
import com.didi.virtualapk.internal.PluginContentResolver;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Arrays;

/**
 * Created by renyugang on 16/12/8.
 */

public class IContentProviderProxy implements InvocationHandler {
    private static final String TAG = Constants.TAG_PREFIX + "IContentProviderProxy";

    private IContentProvider mBase;
    private Context mContext;

    private IContentProviderProxy(Context context, IContentProvider iContentProvider) {
        mBase = iContentProvider;
        mContext = context;
    }

    public static IContentProvider newInstance(Context context, IContentProvider iContentProvider) {
        return (IContentProvider) Proxy.newProxyInstance(iContentProvider.getClass().getClassLoader(),
                new Class[] { IContentProvider.class }, new IContentProviderProxy(context, iContentProvider));
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Log.v(TAG, method.toGenericString() + " : " + Arrays.toString(args));
        wrapperUri(method, args);

        try {
            return method.invoke(mBase, args);
        } catch (InvocationTargetException e) {
            throw e.getTargetException();
        }
    }

    private void wrapperUri(Method method, Object[] args) {
        Uri uri = null;
        int index = 0;
        if (args != null) {
            for (int i = 0; i < args.length; i++) {
                if (args[i] instanceof Uri) {
                    uri = (Uri) args[i];
                    index = i;
                    break;
                }
            }
        }

        Bundle bundleInCallMethod = null;
        if (method.getName().equals("call")) {
            bundleInCallMethod = getBundleParameter(args);
            if (bundleInCallMethod != null) {
                String uriString = bundleInCallMethod.getString(RemoteContentProvider.KEY_WRAPPER_URI);
                if (uriString != null) {
                    uri = Uri.parse(uriString);
                }
            }
        }

        if (uri == null) {
            return;
        }

        PluginManager pluginManager = PluginManager.getInstance(mContext);
        ProviderInfo info = pluginManager.resolveContentProvider(uri.getAuthority(), 0);
        if (info != null) {
            String pkg = info.packageName;
            LoadedPlugin plugin = pluginManager.getLoadedPlugin(pkg);
            Uri wrapperUri = PluginContentResolver.wrapperUri(plugin, uri);
            if (method.getName().equals("call")) {
                bundleInCallMethod.putString(RemoteContentProvider.KEY_WRAPPER_URI, wrapperUri.toString());
            } else {
                args[index] = wrapperUri;
            }
        }
    }

    private Bundle getBundleParameter(Object[] args) {
        Bundle bundle = null;
        if (args != null) {
            for (int i = 0; i < args.length; i++) {
                if (args[i] instanceof Bundle) {
                    bundle = (Bundle) args[i];
                    break;
                }
            }
        }

        return bundle;
    }

}


================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/delegate/LocalService.java
================================================
/*
 * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.didi.virtualapk.delegate;

import android.app.ActivityThread;
import android.app.Application;
import android.app.IActivityManager;
import android.app.IApplicationThread;
import android.app.IServiceConnection;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Binder;
import android.os.Build;
import android.os.IBinder;
import android.util.Log;

import com.didi.virtualapk.PluginManager;
import com.didi.virtualapk.internal.Constants;
import com.didi.virtualapk.internal.LoadedPlugin;
import com.didi.virtualapk.internal.utils.PluginUtil;
import com.didi.virtualapk.utils.Reflector;

import java.lang.reflect.Method;

/**
 * @author johnsonlee
 */
public class LocalService extends Service {
    private static final String TAG = Constants.TAG_PREFIX + "LocalService";

    /**
     * The target service, usually it's a plugin service intent
     */
    public static final String EXTRA_TARGET = "target";
    public static final String EXTRA_COMMAND = "command";
    public static final String EXTRA_PLUGIN_LOCATION = "plugin_location";

    public static final int EXTRA_COMMAND_START_SERVICE = 1;
    public static final int EXTRA_COMMAND_STOP_SERVICE = 2;
    public static final int EXTRA_COMMAND_BIND_SERVICE = 3;
    public static final int EXTRA_COMMAND_UNBIND_SERVICE = 4;


    private PluginManager mPluginManager;

    @Override
    public IBinder onBind(Intent intent) {
        return new Binder();
    }

    @Override
    public void onCreate() {
        super.onCreate();
        mPluginManager = PluginManager.getInstance(this);
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        if (null == intent || !intent.hasExtra(EXTRA_TARGET) || !intent.hasExtra(EXTRA_COMMAND)) {
            return START_STICKY;
        }

        Intent target = intent.getParcelableExtra(EXTRA_TARGET);
        int command = intent.getIntExtra(EXTRA_COMMAND, 0);
        if (null == target || command <= 0) {
            return START_STICKY;
        }

        ComponentName component = target.getComponent();
        LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
        
        if (plugin == null) {
            Log.w(TAG, "Error target: " + target.toURI());
            return START_STICKY;
        }
        // ClassNotFoundException when unmarshalling in Android 5.1
        target.setExtrasClassLoader(plugin.getClassLoader());
        switch (command) {
            case EXTRA_COMMAND_START_SERVICE: {
                ActivityThread mainThread = ActivityThread.currentActivityThread();
                IApplicationThread appThread = mainThread.getApplicationThread();
                Service service;

                if (this.mPluginManager.getComponentsHandler().isServiceAvailable(component)) {
                    service = this.mPluginManager.getComponentsHandler().getService(component);
                } else {
                    try {
                        service = (Service) plugin.getClassLoader().loadClass(component.getClassName()).newInstance();

                        Application app = plugin.getApplication();
                        IBinder token = appThread.asBinder();
                        Method attach = service.getClass().getMethod("attach", Context.class, ActivityThread.class, String.class, IBinder.class, Application.class, Object.class);
                        IActivityManager am = mPluginManager.getActivityManager();

                        attach.invoke(service, plugin.getPluginContext(), mainThread, component.getClassName(), token, app, am);
                        service.onCreate();
                        this.mPluginManager.getComponentsHandler().rememberService(component, service);
                    } catch (Throwable t) {
                        return START_STICKY;
                    }
                }

                service.onStartCommand(target, 0, this.mPluginManager.getComponentsHandler().getServiceCounter(service).getAndIncrement());
                break;
            }
            case EXTRA_COMMAND_BIND_SERVICE: {
                ActivityThread mainThread = ActivityThread.currentActivityThread();
                IApplicationThread appThread = mainThread.getApplicationThread();
                Service service = null;

                if (this.mPluginManager.getComponentsHandler().isServiceAvailable(component)) {
                    service = this.mPluginManager.getComponentsHandler().getService(component);
                } else {
                    try {
                        service = (Service) plugin.getClassLoader().loadClass(component.getClassName()).newInstance();

                        Application app = plugin.getApplication();
                        IBinder token = appThread.asBinder();
                        Method attach = service.getClass().getMethod("attach", Context.class, ActivityThread.class, String.class, IBinder.class, Application.class, Object.class);
                        IActivityManager am = mPluginManager.getActivityManager();

                        attach.invoke(service, plugin.getPluginContext(), mainThread, component.getClassName(), token, app, am);
                        service.onCreate();
                        this.mPluginManager.getComponentsHandler().rememberService(component, service);
                    } catch (Throwable t) {
                        Log.w(TAG, t);
                    }
                }
                try {
                    IBinder binder = service.onBind(target);
                    IBinder serviceConnection = PluginUtil.getBinder(intent.getExtras(), "sc");
                    IServiceConnection iServiceConnection = IServiceConnection.Stub.asInterface(serviceConnection);
                    if (Build.VERSION.SDK_INT >= 26) {
                        iServiceConnection.connected(component, binder, false);
                    } else {
                        Reflector.QuietReflector.with(iServiceConnection).method("connected", ComponentName.class, IBinder.class).call(component, binder);
                    }
                } catch (Exception e) {
                    Log.w(TAG, e);
                }
                break;
            }
            case EXTRA_COMMAND_STOP_SERVICE: {
                Service service = this.mPluginManager.getComponentsHandler().forgetService(component);
                if (null != service) {
                    try {
                        service.onDestroy();
                    } catch (Exception e) {
                        Log.e(TAG, "Unable to stop service " + service + ": " + e.toString());
                    }
                } else {
                    Log.i(TAG, component + " not found");
                }
                break;
            }
            case EXTRA_COMMAND_UNBIND_SERVICE: {
                Service service = this.mPluginManager.getComponentsHandler().forgetService(component);
                if (null != service) {
                    try {
                        service.onUnbind(target);
                        service.onDestroy();
                    } catch (Exception e) {
                        Log.e(TAG, "Unable to unbind service " + service + ": " + e.toString());
                    }
                } else {
                    Log.i(TAG, component + " not found");
                }
                break;
            }
        }

        return START_STICKY;
    }

}


================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/delegate/RemoteContentProvider.java
================================================
/*
 * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.didi.virtualapk.delegate;

import android.content.ContentProvider;
import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
import android.content.ContentValues;
import android.content.Context;
import android.content.OperationApplicationException;
import android.content.pm.ProviderInfo;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.util.Log;

import com.didi.virtualapk.PluginManager;
import com.didi.virtualapk.internal.Constants;
import com.didi.virtualapk.internal.LoadedPlugin;
import com.didi.virtualapk.utils.RunUtil;

import java.io.File;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by renyugang on 16/12/7.
 */

public class RemoteContentProvider extends ContentProvider {
    private static final String TAG = Constants.TAG_PREFIX + "RemoteContentProvider";

    public static final String KEY_PKG = "pkg";
    public static final String KEY_PLUGIN = "plugin";
    public static final String KEY_URI = "uri";

    public static final String KEY_WRAPPER_URI = "wrapper_uri";

    private static Map<String, ContentProvider> sCachedProviders = new HashMap<>();

    @Override
    public boolean onCreate() {
        Log.d(TAG, "onCreate, current thread:"
                + Thread.currentThread().getName());
        return true;
    }

    private ContentProvider getContentProvider(final Uri uri) {
        final PluginManager pluginManager = PluginManager.getInstance(getContext());
        Uri pluginUri = Uri.parse(uri.getQueryParameter(KEY_URI));
        final String auth = pluginUri.getAuthority();
        ContentProvider cachedProvider = sCachedProviders.get(auth);
        if (cachedProvider != null) {
            return cachedProvider;
        }

        synchronized (sCachedProviders) {
            LoadedPlugin plugin = pluginManager.getLoadedPlugin(uri.getQueryParameter(KEY_PKG));
            if (plugin == null) {
                try {
                    pluginManager.loadPlugin(new File(uri.getQueryParameter(KEY_PLUGIN)));
                } catch (Exception e) {
                    Log.w(TAG, e);
                }
            }

            final ProviderInfo providerInfo = pluginManager.resolveContentProvider(auth, 0);
            if (providerInfo != null) {
                RunUtil.runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            LoadedPlugin loadedPlugin = pluginManager.getLoadedPlugin(uri.getQueryParameter(KEY_PKG));
                            ContentProvider contentProvider = (ContentProvider) Class.forName(providerInfo.name).newInstance();
                            contentProvider.attachInfo(loadedPlugin.getPluginContext(), providerInfo);
                            sCachedProviders.put(auth, contentProvider);
                        } catch (Exception e) {
                            Log.w(TAG, e);
                        }
                    }
                }, true);
                return sCachedProviders.get(auth);
            }
        }

        return null;
    }

    @Override
    public String getType(Uri uri) {
        ContentProvider provider = getContentProvider(uri);
        Uri pluginUri = Uri.parse(uri.getQueryParameter(KEY_URI));
        if (provider != null) {
            return provider.getType(pluginUri);
        }

        return null;
    }

    @Override
    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
        ContentProvider provider = getContentProvider(uri);
        Uri pluginUri = Uri.parse(uri.getQueryParameter(KEY_URI));
        if (provider != null) {
            return provider.query(pluginUri, projection, selection, selectionArgs, sortOrder);
        }

        return null;
    }

    @Override
    public Uri insert(Uri uri, ContentValues values) {
        ContentProvider provider = getContentProvider(uri);
        Uri pluginUri = Uri.parse(uri.getQueryParameter(KEY_URI));
        if (provider != null) {
            return provider.insert(pluginUri, values);
        }

        return uri;
    }

    @Override
    public int delete(Uri uri, String selection, String[] selectionArgs) {
        ContentProvider provider = getContentProvider(uri);
        Uri pluginUri = Uri.parse(uri.getQueryParameter(KEY_URI));
        if (provider != null) {
            return provider.delete(pluginUri, selection, selectionArgs);
        }

        return 0;
    }

    @Override
    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
        ContentProvider provider = getContentProvider(uri);
        Uri pluginUri = Uri.parse(uri.getQueryParameter(KEY_URI));
        if (provider != null) {
            return provider.update(pluginUri, values, selection, selectionArgs);
        }

        return 0;
    }

    @Override
    public int bulkInsert(Uri uri, ContentValues[] values) {
        ContentProvider provider = getContentProvider(uri);
        Uri pluginUri = Uri.parse(uri.getQueryParameter(KEY_URI));
        if (provider != null) {
            return provider.bulkInsert(pluginUri, values);
        }

        return 0;
    }

    @NonNull
    @Override
    public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations) throws OperationApplicationException {
        try {
            Field uriField = ContentProviderOperation.class.getDeclaredField("mUri");
            uriField.setAccessible(true);
            for (ContentProviderOperation operation : operations) {
                Uri pluginUri = Uri.parse(operation.getUri().getQueryParameter(KEY_URI));
                uriField.set(operation, pluginUri);
            }
        } catch (Exception e) {
            return new ContentProviderResult[0];
        }

        if (operations.size() > 0) {
            ContentProvider provider = getContentProvider(operations.get(0).getUri());
            if (provider != null) {
                return provider.applyBatch(operations);
            }
        }

        return new ContentProviderResult[0];
    }

    @Override
    public Bundle call(String method, String arg, Bundle extras) {
        Log.d(TAG, "call " + method + " with extras : " + extras);

        if (extras == null || extras.getString(KEY_WRAPPER_URI) == null) {
            return null;
        }

        Uri uri = Uri.parse(extras.getString(KEY_WRAPPER_URI));
        ContentProvider provider = getContentProvider(uri);
        if (provider != null) {
            return provider.call(method, arg, extras);
        }

        return null;
    }

    public static String getAuthority(Context context) {
        return context.getPackageName() + ".VirtualAPK.Provider";
    }
    
    public static String getUri(Context context) {
        return "content://" + getAuthority(context);
    }
    
}


================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/delegate/RemoteService.java
================================================
/*
 * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.didi.virtualapk.delegate;

import android.content.ComponentName;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

import com.didi.virtualapk.PluginManager;
import com.didi.virtualapk.internal.Constants;
import com.didi.virtualapk.internal.LoadedPlugin;

import java.io.File;

/**
 * @author johnsonlee
 */
public class RemoteService extends LocalService {
    
    private static final String TAG = Constants.TAG_PREFIX + "RemoteService";

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        if (intent == null) {
            return super.onStartCommand(intent, flags, startId);
        }

        Intent target = intent.getParcelableExtra(EXTRA_TARGET);
        if (target != null) {
            String pluginLocation = intent.getStringExtra(EXTRA_PLUGIN_LOCATION);
            ComponentName component = target.getComponent();
            LoadedPlugin plugin = PluginManager.getInstance(this).getLoadedPlugin(component);
            if (plugin == null && pluginLocation != null) {
                try {
                    PluginManager.getInstance(this).loadPlugin(new File(pluginLocation));
                } catch (Exception e) {
                    Log.w(TAG, e);
                }
            }
        }

        return super.onStartCommand(intent, flags, startId);
    }

}


================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/delegate/StubActivity.java
================================================
package com.didi.virtualapk.delegate;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.support.annotation.Nullable;

/**
 * Created by qiaopu on 2018/6/13.
 */
public class StubActivity extends Activity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    
        // Go to the main activity
        Intent mainIntent = getPackageManager().getLaunchIntentForPackage(getPackageName());
        
        if (mainIntent == null) {
            mainIntent = new Intent(Intent.ACTION_MAIN);
            mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
            mainIntent.setPackage(getPackageName());
    
            ResolveInfo resolveInfo = getPackageManager().resolveActivity(mainIntent, 0);
    
            if (resolveInfo != null) {
                mainIntent.setClassName(this, resolveInfo.activityInfo.name);
            }
        }
    
        startActivity(mainIntent);
        
        finish();
    }
}


================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/ActivityLifecycleCallbacksProxy.java
================================================
package com.didi.virtualapk.internal;

import android.app.Activity;
import android.app.ActivityThread;
import android.app.Application;
import android.os.Bundle;

import com.didi.virtualapk.utils.Reflector;

import java.util.ArrayList;

/**
 * Created by qiaopu on 2017/8/9.
 */
class ActivityLifecycleCallbacksProxy implements Application.ActivityLifecycleCallbacks {
    
    final ArrayList<Application.ActivityLifecycleCallbacks> mActivityLifecycleCallbacks =
        Reflector.QuietReflector.with(ActivityThread.currentApplication()).field("mActivityLifecycleCallbacks").get();
    
    Object[] collectActivityLifecycleCallbacks() {
        if (mActivityLifecycleCallbacks == null) {
            return null;
        }
        Object[] callbacks = null;
        synchronized (mActivityLifecycleCallbacks) {
            if (mActivityLifecycleCallbacks.size() > 0) {
                callbacks = mActivityLifecycleCallbacks.toArray();
            }
        }
        return callbacks;
    }
    
    @Override
    public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
        Object[] callbacks = collectActivityLifecycleCallbacks();
        if (callbacks != null) {
            for (int i = 0; i < callbacks.length; i++) {
                ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivityCreated(activity,
                    savedInstanceState);
            }
        }
    }
    
    @Override
    public void onActivityStarted(Activity activity) {
        Object[] callbacks = collectActivityLifecycleCallbacks();
        if (callbacks != null) {
            for (int i = 0; i < callbacks.length; i++) {
                ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivityStarted(activity);
            }
        }
    }
    
    @Override
    public void onActivityResumed(Activity activity) {
        Object[] callbacks = collectActivityLifecycleCallbacks();
        if (callbacks != null) {
            for (int i = 0; i < callbacks.length; i++) {
                ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivityResumed(activity);
            }
        }
    }
    
    @Override
    public void onActivityPaused(Activity activity) {
        Object[] callbacks = collectActivityLifecycleCallbacks();
        if (callbacks != null) {
            for (int i = 0; i < callbacks.length; i++) {
                ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivityPaused(activity);
            }
        }
    }
    
    @Override
    public void onActivityStopped(Activity activity) {
        Object[] callbacks = collectActivityLifecycleCallbacks();
        if (callbacks != null) {
            for (int i = 0; i < callbacks.length; i++) {
                ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivityStopped(activity);
            }
        }
    }
    
    @Override
    public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
        Object[] callbacks = collectActivityLifecycleCallbacks();
        if (callbacks != null) {
            for (int i = 0; i < callbacks.length; i++) {
                ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivitySaveInstanceState(activity,
                    outState);
            }
        }
    }
    
    @Override
    public void onActivityDestroyed(Activity activity) {
        Object[] callbacks = collectActivityLifecycleCallbacks();
        if (callbacks != null) {
            for (int i = 0; i < callbacks.length; i++) {
                ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivityDestroyed(activity);
            }
        }
    }
}


================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/ComponentsHandler.java
================================================
/*
 * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.didi.virtualapk.internal;

import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.os.IBinder;
import android.support.v4.util.ArrayMap;
import android.util.Log;

import com.didi.virtualapk.PluginManager;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created by renyugang on 17/6/7.
 */

public class ComponentsHandler {

    public static final String TAG = Constants.TAG_PREFIX + "PluginManager";

    private Context mContext;
    private PluginManager mPluginManager;
    private StubActivityInfo mStubActivityInfo = new StubActivityInfo();


    private ArrayMap<ComponentName, Service> mServices = new ArrayMap<ComponentName, Service>();
    private ArrayMap<IBinder, Intent> mBoundServices = new ArrayMap<IBinder, Intent>();
    private ArrayMap<Service, AtomicInteger> mServiceCounters = new ArrayMap<Service, AtomicInteger>();

    public ComponentsHandler(PluginManager pluginManager) {
        mPluginManager = pluginManager;
        mContext = pluginManager.getHostContext();
    }

    /**
     * transform intent from implicit to explicit
     */
    public Intent transformIntentToExplicitAsNeeded(Intent intent) {
        ComponentName component = intent.getComponent();
        if (component == null
            || component.getPackageName().equals(mContext.getPackageName())) {
            ResolveInfo info = mPluginManager.resolveActivity(intent);
            if (info != null && info.activityInfo != null) {
                component = new ComponentName(info.activityInfo.packageName, info.activityInfo.name);
                intent.setComponent(component);
            }
        }

        return intent;
    }

    public void markIntentIfNeeded(Intent intent) {
        if (intent.getComponent() == null) {
            return;
        }

        String targetPackageName = intent.getComponent().getPackageName();
        String targetClassName = intent.getComponent().getClassName();
        // search map and return specific launchmode stub activity
        if (!targetPackageName.equals(mContext.getPackageName()) && mPluginManager.getLoadedPlugin(targetPackageName) != null) {
            intent.putExtra(Constants.KEY_IS_PLUGIN, true);
            intent.putExtra(Constants.KEY_TARGET_PACKAGE, targetPackageName);
            intent.putExtra(Constants.KEY_TARGET_ACTIVITY, targetClassName);
            dispatchStubActivity(intent);
        }
    }

    private void dispatchStubActivity(Intent intent) {
        ComponentName component = intent.getComponent();
        String targetClassName = intent.getComponent().getClassName();
        LoadedPlugin loadedPlugin = mPluginManager.getLoadedPlugin(intent);
        ActivityInfo info = loadedPlugin.getActivityInfo(component);
        if (info == null) {
            throw new RuntimeException("can not find " + component);
        }
        int launchMode = info.launchMode;
        Resources.Theme themeObj = loadedPlugin.getResources().newTheme();
        themeObj.applyStyle(info.theme, true);
        String stubActivity = mStubActivityInfo.getStubActivity(targetClassName, launchMode, themeObj);
        Log.i(TAG, String.format("dispatchStubActivity,[%s -> %s]", targetClassName, stubActivity));
        intent.setClassName(mContext, stubActivity);
    }


    public AtomicInteger getServiceCounter(Service service) {
        return this.mServiceCounters.get(service);
    }

    /**
     * Retrieve the started service by component name
     *
     * @param component
     * @return
     */
    public Service getService(ComponentName component) {
        return this.mServices.get(component);
    }

    /**
     * Put the started service into service registry, and then increase the counter associate with
     * the service
     *
     * @param component
     * @param service
     */
    public void rememberService(ComponentName component, Service service) {
        synchronized (this.mServices) {
            this.mServices.put(component, service);
            this.mServiceCounters.put(service, new AtomicInteger(0));
        }
    }

    /**
     * Remove the service from service registry
     *
     * @param component
     * @return
     */
    public Service forgetService(ComponentName component) {
        synchronized (this.mServices) {
            Service service = this.mServices.remove(component);
            this.mServiceCounters.remove(service);
            return service;
        }
    }

    /**
     * Remove the bound service from service registry
     *
     * @param iServiceConnection IServiceConnection binder when unbindService
     * @return
     */
    public Intent forgetIServiceConnection(IBinder iServiceConnection) {
        synchronized (this.mBoundServices) {
            Intent intent = this.mBoundServices.remove(iServiceConnection);
            return intent;
        }
    }

    /**
     * save the bound service
     *
     * @param iServiceConnection IServiceConnection binder when bindService
     * @return
     */
    public void remberIServiceConnection(IBinder iServiceConnection, Intent intent) {
        synchronized (this.mBoundServices) {
            mBoundServices.put(iServiceConnection, intent);
        }
    }

    /**
     * Check if a started service with the specified component exists in the registry
     *
     * @param component
     * @return
     */
    public boolean isServiceAvailable(ComponentName component) {
        return this.mServices.containsKey(component);
    }

}


================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/Constants.java
================================================
/*
 * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.didi.virtualapk.internal;

/**
 * Created by renyugang on 16/8/15.
 */
public class Constants {
    public static final String KEY_IS_PLUGIN = "isPlugin";
    public static final String KEY_TARGET_PACKAGE = "target.package";
    public static final String KEY_TARGET_ACTIVITY = "target.activity";

    public static final String OPTIMIZE_DIR = "dex";
    public static final String NATIVE_DIR = "valibs";

    public static final boolean COMBINE_RESOURCES = true;
    public static final boolean COMBINE_CLASSLOADER = true;
    public static final boolean DEBUG = true;
    
    public static final String TAG = "VA";
    public static final String TAG_PREFIX = TAG + ".";

}


================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/LoadedPlugin.java
================================================
/*
 * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.didi.virtualapk.internal;

import android.annotation.TargetApi;
import android.app.Application;
import android.app.Instrumentation;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.ChangedPackages;
import android.content.pm.FeatureInfo;
import android.content.pm.InstrumentationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageParser;
import android.content.pm.PermissionGroupInfo;
import android.content.pm.PermissionInfo;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.content.pm.SharedLibraryInfo;
import android.content.pm.VersionedPackage;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Process;
import android.os.UserHandle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.didi.virtualapk.PluginManager;
import com.didi.virtualapk.internal.utils.DexUtil;
import com.didi.virtualapk.internal.utils.PackageParserCompat;
import com.didi.virtualapk.internal.utils.PluginUtil;
import com.didi.virtualapk.utils.Reflector;
import com.didi.virtualapk.utils.RunUtil;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import dalvik.system.DexClassLoader;

/**
 * Created by renyugang on 16/8/9.
 */
public class LoadedPlugin {

    public static final String TAG = Constants.TAG_PREFIX + "LoadedPlugin";

    protected File getDir(Context context, String name) {
        return context.getDir(name, Context.MODE_PRIVATE);
    }
    
    protected ClassLoader createClassLoader(Context context, File apk, File libsDir, ClassLoader parent) throws Exception {
        File dexOutputDir = getDir(context, Constants.OPTIMIZE_DIR);
        String dexOutputPath = dexOutputDir.getAbsolutePath();
        DexClassLoader loader = new DexClassLoader(apk.getAbsolutePath(), dexOutputPath, libsDir.getAbsolutePath(), parent);

        if (Constants.COMBINE_CLASSLOADER) {
            DexUtil.insertDex(loader, parent, libsDir);
        }

        return loader;
    }

    protected AssetManager createAssetManager(Context context, File apk) throws Exception {
        AssetManager am = AssetManager.class.newInstance();
        Reflector.with(am).method("addAssetPath", String.class).call(apk.getAbsolutePath());
        return am;
    }

    protected Resources createResources(Context context, String packageName, File apk) throws Exception {
        if (Constants.COMBINE_RESOURCES) {
            return ResourcesManager.createResources(context, packageName, apk);
        } else {
            Resources hostResources = context.getResources();
            AssetManager assetManager = createAssetManager(context, apk);
            return new Resources(assetManager, hostResources.getDisplayMetrics(), hostResources.getConfiguration());
        }
    }
    
    protected PluginPackageManager createPluginPackageManager() {
        return new PluginPackageManager();
    }
    
    public PluginContext createPluginContext(Context context) {
        if (context == null) {
            return new PluginContext(this);
        }
        
        return new PluginContext(this, context);
    }

    protected ResolveInfo chooseBestActivity(Intent intent, String s, int flags, List<ResolveInfo> query) {
        return query.get(0);
    }

    protected final String mLocation;
    protected PluginManager mPluginManager;
    protected Context mHostContext;
    protected Context mPluginContext;
    protected final File mNativeLibDir;
    protected final PackageParser.Package mPackage;
    protected final PackageInfo mPackageInfo;
    protected Resources mResources;
    protected ClassLoader mClassLoader;
    protected PluginPackageManager mPackageManager;

    protected Map<ComponentName, ActivityInfo> mActivityInfos;
    protected Map<ComponentName, ServiceInfo> mServiceInfos;
    protected Map<ComponentName, ActivityInfo> mReceiverInfos;
    protected Map<ComponentName, ProviderInfo> mProviderInfos;
    protected Map<String, ProviderInfo> mProviders; // key is authorities of provider
    protected Map<ComponentName, InstrumentationInfo> mInstrumentationInfos;

    protected Application mApplication;

    public LoadedPlugin(PluginManager pluginManager, Context context, File apk) throws Exception {
        this.mPluginManager = pluginManager;
        this.mHostContext = context;
        this.mLocation = apk.getAbsolutePath();
        this.mPackage = PackageParserCompat.parsePackage(context, apk, PackageParser.PARSE_MUST_BE_APK);
        this.mPackage.applicationInfo.metaData = this.mPackage.mAppMetaData;
        this.mPackageInfo = new PackageInfo();
        this.mPackageInfo.applicationInfo = this.mPackage.applicationInfo;
        this.mPackageInfo.applicationInfo.sourceDir = apk.getAbsolutePath();
    
        if (Build.VERSION.SDK_INT >= 28
            || (Build.VERSION.SDK_INT == 27 && Build.VERSION.PREVIEW_SDK_INT != 0)) { // Android P Preview
            try {
                this.mPackageInfo.signatures = this.mPackage.mSigningDetails.signatures;
            } catch (Throwable e) {
                PackageInfo info = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES);
                this.mPackageInfo.signatures = info.signatures;
            }
        } else {
            this.mPackageInfo.signatures = this.mPackage.mSignatures;
        }
        
        this.mPackageInfo.packageName = this.mPackage.packageName;
        if (pluginManager.getLoadedPlugin(mPackageInfo.packageName) != null) {
            throw new RuntimeException("plugin has already been loaded : " + mPackageInfo.packageName);
        }
        this.mPackageInfo.versionCode = this.mPackage.mVersionCode;
        this.mPackageInfo.versionName = this.mPackage.mVersionName;
        this.mPackageInfo.permissions = new PermissionInfo[0];
        this.mPackageManager = createPluginPackageManager();
        this.mPluginContext = createPluginContext(null);
        this.mNativeLibDir = getDir(context, Constants.NATIVE_DIR);
        this.mPackage.applicationInfo.nativeLibraryDir = this.mNativeLibDir.getAbsolutePath();
        this.mResources = createResources(context, getPackageName(), apk);
        this.mClassLoader = createClassLoader(context, apk, this.mNativeLibDir, context.getClassLoader());

        tryToCopyNativeLib(apk);

        // Cache instrumentations
        Map<ComponentName, InstrumentationInfo> instrumentations = new HashMap<ComponentName, InstrumentationInfo>();
        for (PackageParser.Instrumentation instrumentation : this.mPackage.instrumentation) {
            instrumentations.put(instrumentation.getComponentName(), instrumentation.info);
        }
        this.mInstrumentationInfos = Collections.unmodifiableMap(instrumentations);
        this.mPackageInfo.instrumentation = instrumentations.values().toArray(new InstrumentationInfo[instrumentations.size()]);

        // Cache activities
        Map<ComponentName, ActivityInfo> activityInfos = new HashMap<ComponentName, ActivityInfo>();
        for (PackageParser.Activity activity : this.mPackage.activities) {
            activity.info.metaData = activity.metaData;
            activityInfos.put(activity.getComponentName(), activity.info);
        }
        this.mActivityInfos = Collections.unmodifiableMap(activityInfos);
        this.mPackageInfo.activities = activityInfos.values().toArray(new ActivityInfo[activityInfos.size()]);

        // Cache services
        Map<ComponentName, ServiceInfo> serviceInfos = new HashMap<ComponentName, ServiceInfo>();
        for (PackageParser.Service service : this.mPackage.services) {
            serviceInfos.put(service.getComponentName(), service.info);
        }
        this.mServiceInfos = Collections.unmodifiableMap(serviceInfos);
        this.mPackageInfo.services = serviceInfos.values().toArray(new ServiceInfo[serviceInfos.size()]);

        // Cache providers
        Map<String, ProviderInfo> providers = new HashMap<String, ProviderInfo>();
        Map<ComponentName, ProviderInfo> providerInfos = new HashMap<ComponentName, ProviderInfo>();
        for (PackageParser.Provider provider : this.mPackage.providers) {
            providers.put(provider.info.authority, provider.info);
            providerInfos.put(provider.getComponentName(), provider.info);
        }
        this.mProviders = Collections.unmodifiableMap(providers);
        this.mProviderInfos = Collections.unmodifiableMap(providerInfos);
        this.mPackageInfo.providers = providerInfos.values().toArray(new ProviderInfo[providerInfos.size()]);

        // Register broadcast receivers dynamically
        Map<ComponentName, ActivityInfo> receivers = new HashMap<ComponentName, ActivityInfo>();
        for (PackageParser.Activity receiver : this.mPackage.receivers) {
            receivers.put(receiver.getComponentName(), receiver.info);
    
            BroadcastReceiver br = BroadcastReceiver.class.cast(getClassLoader().loadClass(receiver.getComponentName().getClassName()).newInstance());
            for (PackageParser.ActivityIntentInfo aii : receiver.intents) {
                this.mHostContext.registerReceiver(br, aii);
            }
        }
        this.mReceiverInfos = Collections.unmodifiableMap(receivers);
        this.mPackageInfo.receivers = receivers.values().toArray(new ActivityInfo[receivers.size()]);
    
        // try to invoke plugin's application
        invokeApplication();
    }

    protected void tryToCopyNativeLib(File apk) throws Exception {
        PluginUtil.copyNativeLib(apk, mHostContext, mPackageInfo, mNativeLibDir);
    }

    public String getLocation() {
        return this.mLocation;
    }

    public String getPackageName() {
        return this.mPackage.packageName;
    }

    public PackageManager getPackageManager() {
        return this.mPackageManager;
    }

    public AssetManager getAssets() {
        return getResources().getAssets();
    }

    public Resources getResources() {
        return this.mResources;
    }

    public void updateResources(Resources newResources) {
        this.mResources = newResources;
    }

    public ClassLoader getClassLoader() {
        return this.mClassLoader;
    }

    public PluginManager getPluginManager() {
        return this.mPluginManager;
    }

    public Context getHostContext() {
        return this.mHostContext;
    }

    public Context getPluginContext() {
        return this.mPluginContext;
    }

    public Application getApplication() {
        return mApplication;
    }

    public void invokeApplication() throws Exception {
        final Exception[] temp = new Exception[1];
        // make sure application's callback is run on ui thread.
        RunUtil.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                if (mApplication != null) {
                    return;
                }
                try {
                    mApplication = makeApplication(false, mPluginManager.getInstrumentation());
                } catch (Exception e) {
                    temp[0] = e;
                }
            }
        }, true);
        
        if (temp[0] != null) {
            throw temp[0];
        }
    }

    public String getPackageResourcePath() {
        int myUid = Process.myUid();
        ApplicationInfo appInfo = this.mPackage.applicationInfo;
        return appInfo.uid == myUid ? appInfo.sourceDir : appInfo.publicSourceDir;
    }

    public String getCodePath() {
        return this.mPackage.applicationInfo.sourceDir;
    }

    public Intent getLaunchIntent() {
        ContentResolver resolver = this.mPluginContext.getContentResolver();
        Intent launcher = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER);

        for (PackageParser.Activity activity : this.mPackage.activities) {
            for (PackageParser.ActivityIntentInfo intentInfo : activity.intents) {
                if (intentInfo.match(resolver, launcher, false, TAG) > 0) {
                    return Intent.makeMainActivity(activity.getComponentName());
                }
            }
        }

        return null;
    }

    public Intent getLeanbackLaunchIntent() {
        ContentResolver resolver = this.mPluginContext.getContentResolver();
        Intent launcher = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LEANBACK_LAUNCHER);

        for (PackageParser.Activity activity : this.mPackage.activities) {
            for (PackageParser.ActivityIntentInfo intentInfo : activity.intents) {
                if (intentInfo.match(resolver, launcher, false, TAG) > 0) {
                    Intent intent = new Intent(Intent.ACTION_MAIN);
                    intent.setComponent(activity.getComponentName());
                    intent.addCategory(Intent.CATEGORY_LEANBACK_LAUNCHER);
                    return intent;
                }
            }
        }

        return null;
    }

    public ApplicationInfo getApplicationInfo() {
        return this.mPackage.applicationInfo;
    }

    public PackageInfo getPackageInfo() {
        return this.mPackageInfo;
    }

    public ActivityInfo getActivityInfo(ComponentName componentName) {
        return this.mActivityInfos.get(componentName);
    }

    public ServiceInfo getServiceInfo(ComponentName componentName) {
        return this.mServiceInfos.get(componentName);
    }

    public ActivityInfo getReceiverInfo(ComponentName componentName) {
        return this.mReceiverInfos.get(componentName);
    }

    public ProviderInfo getProviderInfo(ComponentName componentName) {
        return this.mProviderInfos.get(componentName);
    }

    public Resources.Theme getTheme() {
        Resources.Theme theme = this.mResources.newTheme();
        theme.applyStyle(PluginUtil.selectDefaultTheme(this.mPackage.applicationInfo.theme, Build.VERSION.SDK_INT), false);
        return theme;
    }

    public void setTheme(int resid) {
        Reflector.QuietReflector.with(this.mResources).field("mThemeResId").set(resid);
    }

    protected Application makeApplication(boolean forceDefaultAppClass, Instrumentation instrumentation) throws Exception {
        if (null != this.mApplication) {
            return this.mApplication;
        }

        String appClass = this.mPackage.applicationInfo.className;
        if (forceDefaultAppClass || null == appClass) {
            appClass = "android.app.Application";
        }
    
        this.mApplication = instrumentation.newApplication(this.mClassLoader, appClass, this.getPluginContext());
        // inject activityLifecycleCallbacks of the host application
        mApplication.registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacksProxy());
        instrumentation.callApplicationOnCreate(this.mApplication);
        return this.mApplication;
    }

    public ResolveInfo resolveActivity(Intent intent, int flags) {
        List<ResolveInfo> query = this.queryIntentActivities(intent, flags);
        if (null == query || query.isEmpty()) {
            return null;
        }

        ContentResolver resolver = this.mPluginContext.getContentResolver();
        return chooseBestActivity(intent, intent.resolveTypeIfNeeded(resolver), flags, query);
    }

    public List<ResolveInfo> queryIntentActivities(Intent intent, int flags) {
        ComponentName component = intent.getComponent();
        List<ResolveInfo> resolveInfos = new ArrayList<ResolveInfo>();
        ContentResolver resolver = this.mPluginContext.getContentResolver();

        for (PackageParser.Activity activity : this.mPackage.activities) {
            if (match(activity, component)) {
                ResolveInfo resolveInfo = new ResolveInfo();
                resolveInfo.activityInfo = activity.info;
                resolveInfos.add(resolveInfo);
            } else if (component == null) {
                // only match implicit intent
                for (PackageParser.ActivityIntentInfo intentInfo : activity.intents) {
                    if (intentInfo.match(resolver, intent, true, TAG) >= 0) {
                        ResolveInfo resolveInfo = new ResolveInfo();
                        resolveInfo.activityInfo = activity.info;
                        resolveInfos.add(resolveInfo);
                        break;
                    }
                }
            }
        }

        return resolveInfos;
    }

    public ResolveInfo resolveService(Intent intent, int flags) {
        List<ResolveInfo> query = this.queryIntentServices(intent, flags);
        if (null == query || query.isEmpty()) {
            return null;
        }

        ContentResolver resolver = this.mPluginContext.getContentResolver();
        return chooseBestActivity(intent, intent.resolveTypeIfNeeded(resolver), flags, query);
    }

    public List<ResolveInfo> queryIntentServices(Intent intent, int flags) {
        ComponentName component = intent.getComponent();
        List<ResolveInfo> resolveInfos = new ArrayList<ResolveInfo>();
        ContentResolver resolver = this.mPluginContext.getContentResolver();

        for (PackageParser.Service service : this.mPackage.services) {
            if (match(service, component)) {
                ResolveInfo resolveInfo = new ResolveInfo();
                resolveInfo.serviceInfo = service.info;
                resolveInfos.add(resolveInfo);
            } else if (component == null) {
                // only match implicit intent
                for (PackageParser.ServiceIntentInfo intentInfo : service.intents) {
                    if (intentInfo.match(resolver, intent, true, TAG) >= 0) {
                        ResolveInfo resolveInfo = new ResolveInfo();
                        resolveInfo.serviceInfo = service.info;
                        resolveInfos.add(resolveInfo);
                        break;
                    }
                }
            }
        }

        return resolveInfos;
    }

    public List<ResolveInfo> queryBroadcastReceivers(Intent intent, int flags) {
        ComponentName component = intent.getComponent();
        List<ResolveInfo> resolveInfos = new ArrayList<ResolveInfo>();
        ContentResolver resolver = this.mPluginContext.getContentResolver();

        for (PackageParser.Activity receiver : this.mPackage.receivers) {
            if (receiver.getComponentName().equals(component)) {
                ResolveInfo resolveInfo = new ResolveInfo();
                resolveInfo.activityInfo = receiver.info;
                resolveInfos.add(resolveInfo);
            } else if (component == null) {
                // only match implicit intent
                for (PackageParser.ActivityIntentInfo intentInfo : receiver.intents) {
                    if (intentInfo.match(resolver, intent, true, TAG) >= 0) {
                        ResolveInfo resolveInfo = new ResolveInfo();
                        resolveInfo.activityInfo = receiver.info;
                        resolveInfos.add(resolveInfo);
                        break;
                    }
                }
            }
        }

        return resolveInfos;
    }

    public ProviderInfo resolveContentProvider(String name, int flags) {
        return this.mProviders.get(name);
    }

    protected boolean match(PackageParser.Component component, ComponentName target) {
        ComponentName source = component.getComponentName();
        if (source == target) return true;
        if (source != null && target != null
                && source.getClassName().equals(target.getClassName())
                && (source.getPackageName().equals(target.getPackageName())
                || mHostContext.getPackageName().equals(target.getPackageName()))) {
            return true;
        }
        return false;
    }

    /**
     * @author johnsonlee
     */
    protected class PluginPackageManager extends PackageManager {

        protected PackageManager mHostPackageManager = mHostContext.getPackageManager();

        @Override
        public PackageInfo getPackageInfo(String packageName, int flags) throws NameNotFoundException {

            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(packageName);
            if (null != plugin) {
                return plugin.mPackageInfo;
            }

            return this.mHostPackageManager.getPackageInfo(packageName, flags);
        }
    
        @TargetApi(Build.VERSION_CODES.O)
        @Override
        public PackageInfo getPackageInfo(VersionedPackage versionedPackage, int i) throws NameNotFoundException {

            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(versionedPackage.getPackageName());
            if (null != plugin) {
                return plugin.mPackageInfo;
            }

            return this.mHostPackageManager.getPackageInfo(versionedPackage, i);
        }
    
        @Override
        public String[] currentToCanonicalPackageNames(String[] names) {
            return this.mHostPackageManager.currentToCanonicalPackageNames(names);
        }

        @Override
        public String[] canonicalToCurrentPackageNames(String[] names) {
            return this.mHostPackageManager.canonicalToCurrentPackageNames(names);
        }

        @Override
        public Intent getLaunchIntentForPackage(@NonNull String packageName) {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(packageName);
            if (null != plugin) {
                return plugin.getLaunchIntent();
            }

            return this.mHostPackageManager.getLaunchIntentForPackage(packageName);
        }

        @TargetApi(Build.VERSION_CODES.LOLLIPOP)
        @Override
        public Intent getLeanbackLaunchIntentForPackage(@NonNull String packageName) {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(packageName);
            if (null != plugin) {
                return plugin.getLeanbackLaunchIntent();
            }

            return this.mHostPackageManager.getLeanbackLaunchIntentForPackage(packageName);
        }

        @Override
        public int[] getPackageGids(@NonNull String packageName) throws NameNotFoundException {
            return this.mHostPackageManager.getPackageGids(packageName);
        }
    
        @TargetApi(Build.VERSION_CODES.N)
        @Override
        public int[] getPackageGids(String packageName, int flags) throws NameNotFoundException {
            return this.mHostPackageManager.getPackageGids(packageName, flags);
        }
    
        @TargetApi(Build.VERSION_CODES.N)
        @Override
        public int getPackageUid(String packageName, int flags) throws NameNotFoundException {
            return this.mHostPackageManager.getPackageUid(packageName, flags);
        }

        @Override
        public PermissionInfo getPermissionInfo(String name, int flags) throws NameNotFoundException {
            return this.mHostPackageManager.getPermissionInfo(name, flags);
        }

        @Override
        public List<PermissionInfo> queryPermissionsByGroup(String group, int flags) throws NameNotFoundException {
            return this.mHostPackageManager.queryPermissionsByGroup(group, flags);
        }

        @Override
        public PermissionGroupInfo getPermissionGroupInfo(String name, int flags) throws NameNotFoundException {
            return this.mHostPackageManager.getPermissionGroupInfo(name, flags);
        }

        @Override
        public List<PermissionGroupInfo> getAllPermissionGroups(int flags) {
            return this.mHostPackageManager.getAllPermissionGroups(flags);
        }

        @Override
        public ApplicationInfo getApplicationInfo(String packageName, int flags) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(packageName);
            if (null != plugin) {
                return plugin.getApplicationInfo();
            }

            return this.mHostPackageManager.getApplicationInfo(packageName, flags);
        }

        @Override
        public ActivityInfo getActivityInfo(ComponentName component, int flags) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
            if (null != plugin) {
                return plugin.mActivityInfos.get(component);
            }

            return this.mHostPackageManager.getActivityInfo(component, flags);
        }

        @Override
        public ActivityInfo getReceiverInfo(ComponentName component, int flags) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
            if (null != plugin) {
                return plugin.mReceiverInfos.get(component);
            }

            return this.mHostPackageManager.getReceiverInfo(component, flags);
        }

        @Override
        public ServiceInfo getServiceInfo(ComponentName component, int flags) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
            if (null != plugin) {
                return plugin.mServiceInfos.get(component);
            }

            return this.mHostPackageManager.getServiceInfo(component, flags);
        }

        @Override
        public ProviderInfo getProviderInfo(ComponentName component, int flags) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
            if (null != plugin) {
                return plugin.mProviderInfos.get(component);
            }

            return this.mHostPackageManager.getProviderInfo(component, flags);
        }

        @Override
        public List<PackageInfo> getInstalledPackages(int flags) {
            return this.mHostPackageManager.getInstalledPackages(flags);
        }

        @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
        @Override
        public List<PackageInfo> getPackagesHoldingPermissions(String[] permissions, int flags) {
            return this.mHostPackageManager.getPackagesHoldingPermissions(permissions, flags);
        }

        @Override
        public int checkPermission(String permName, String pkgName) {
            return this.mHostPackageManager.checkPermission(permName, pkgName);
        }

        @TargetApi(Build.VERSION_CODES.M)
        @Override
        public boolean isPermissionRevokedByPolicy(@NonNull String permName, @NonNull String pkgName) {
            return this.mHostPackageManager.isPermissionRevokedByPolicy(permName, pkgName);
        }

        @Override
        public boolean addPermission(PermissionInfo info) {
            return this.mHostPackageManager.addPermission(info);
        }

        @Override
        public boolean addPermissionAsync(PermissionInfo info) {
            return this.mHostPackageManager.addPermissionAsync(info);
        }

        @Override
        public void removePermission(String name) {
            this.mHostPackageManager.removePermission(name);
        }

        @Override
        public int checkSignatures(String pkg1, String pkg2) {
            return this.mHostPackageManager.checkSignatures(pkg1, pkg2);
        }

        @Override
        public int checkSignatures(int uid1, int uid2) {
            return this.mHostPackageManager.checkSignatures(uid1, uid2);
        }

        @Override
        public String[] getPackagesForUid(int uid) {
            return this.mHostPackageManager.getPackagesForUid(uid);
        }

        @Override
        public String getNameForUid(int uid) {
            return this.mHostPackageManager.getNameForUid(uid);
        }

        @Override
        public List<ApplicationInfo> getInstalledApplications(int flags) {
            return this.mHostPackageManager.getInstalledApplications(flags);
        }
    
        @TargetApi(Build.VERSION_CODES.O)
        @Override
        public boolean isInstantApp() {
            return this.mHostPackageManager.isInstantApp();
        }
    
        @TargetApi(Build.VERSION_CODES.O)
        @Override
        public boolean isInstantApp(String packageName) {
            return this.mHostPackageManager.isInstantApp(packageName);
        }
    
        @TargetApi(Build.VERSION_CODES.O)
        @Override
        public int getInstantAppCookieMaxBytes() {
            return this.mHostPackageManager.getInstantAppCookieMaxBytes();
        }
    
        @TargetApi(Build.VERSION_CODES.O)
        @NonNull
        @Override
        public byte[] getInstantAppCookie() {
            return this.mHostPackageManager.getInstantAppCookie();
        }
    
        @TargetApi(Build.VERSION_CODES.O)
        @Override
        public void clearInstantAppCookie() {
            this.mHostPackageManager.clearInstantAppCookie();
        }
    
        @TargetApi(Build.VERSION_CODES.O)
        @Override
        public void updateInstantAppCookie(@Nullable byte[] cookie) {
            this.mHostPackageManager.updateInstantAppCookie(cookie);
        }
    
        @Override
        public String[] getSystemSharedLibraryNames() {
            return this.mHostPackageManager.getSystemSharedLibraryNames();
        }
    
        @TargetApi(Build.VERSION_CODES.O)
        @NonNull
        @Override
        public List<SharedLibraryInfo> getSharedLibraries(int flags) {
            return this.mHostPackageManager.getSharedLibraries(flags);
        }
    
        @TargetApi(Build.VERSION_CODES.O)
        @Nullable
        @Override
        public ChangedPackages getChangedPackages(int sequenceNumber) {
            return this.mHostPackageManager.getChangedPackages(sequenceNumber);
        }
    
        @Override
        public FeatureInfo[] getSystemAvailableFeatures() {
            return this.mHostPackageManager.getSystemAvailableFeatures();
        }

        @Override
        public boolean hasSystemFeature(String name) {
            return this.mHostPackageManager.hasSystemFeature(name);
        }

        @TargetApi(Build.VERSION_CODES.N)
        @Override
        public boolean hasSystemFeature(String name, int version) {
            return this.mHostPackageManager.hasSystemFeature(name, version);
        }
    
        @Override
        public ResolveInfo resolveActivity(Intent intent, int flags) {
            ResolveInfo resolveInfo = mPluginManager.resolveActivity(intent, flags);
            if (null != resolveInfo) {
                return resolveInfo;
            }

            return this.mHostPackageManager.resolveActivity(intent, flags);
        }

        @Override
        public List<ResolveInfo> queryIntentActivities(Intent intent, int flags) {
            ComponentName component = intent.getComponent();
            if (null == component) {
                if (intent.getSelector() != null) {
                    intent = intent.getSelector();
                    component = intent.getComponent();
                }
            }

            if (null != component) {
                LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
                if (null != plugin) {
                    ActivityInfo activityInfo = plugin.getActivityInfo(component);
                    if (activityInfo != null) {
                        ResolveInfo resolveInfo = new ResolveInfo();
                        resolveInfo.activityInfo = activityInfo;
                        return Arrays.asList(resolveInfo);
                    }
                }
            }

            List<ResolveInfo> all = new ArrayList<ResolveInfo>();

            List<ResolveInfo> pluginResolveInfos = mPluginManager.queryIntentActivities(intent, flags);
            if (null != pluginResolveInfos && pluginResolveInfos.size() > 0) {
                all.addAll(pluginResolveInfos);
            }

            List<ResolveInfo> hostResolveInfos = this.mHostPackageManager.queryIntentActivities(intent, flags);
            if (null != hostResolveInfos && hostResolveInfos.size() > 0) {
                all.addAll(hostResolveInfos);
            }

            return all;
        }

        @Override
        public List<ResolveInfo> queryIntentActivityOptions(ComponentName caller, Intent[] specifics, Intent intent, int flags) {
            return this.mHostPackageManager.queryIntentActivityOptions(caller, specifics, intent, flags);
        }

        @Override
        public List<ResolveInfo> queryBroadcastReceivers(Intent intent, int flags) {
            ComponentName component = intent.getComponent();
            if (null == component) {
                if (intent.getSelector() != null) {
                    intent = intent.getSelector();
                    component = intent.getComponent();
                }
            }

            if (null != component) {
                LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
                if (null != plugin) {
                    ActivityInfo activityInfo = plugin.getReceiverInfo(component);
                    if (activityInfo != null) {
                        ResolveInfo resolveInfo = new ResolveInfo();
                        resolveInfo.activityInfo = activityInfo;
                        return Arrays.asList(resolveInfo);
                    }
                }
            }

            List<ResolveInfo> all = new ArrayList<>();

            List<ResolveInfo> pluginResolveInfos = mPluginManager.queryBroadcastReceivers(intent, flags);
            if (null != pluginResolveInfos && pluginResolveInfos.size() > 0) {
                all.addAll(pluginResolveInfos);
            }

            List<ResolveInfo> hostResolveInfos = this.mHostPackageManager.queryBroadcastReceivers(intent, flags);
            if (null != hostResolveInfos && hostResolveInfos.size() > 0) {
                all.addAll(hostResolveInfos);
            }

            return all;
        }

        @Override
        public ResolveInfo resolveService(Intent intent, int flags) {
            ResolveInfo resolveInfo = mPluginManager.resolveService(intent, flags);
            if (null != resolveInfo) {
                return resolveInfo;
            }

            return this.mHostPackageManager.resolveService(intent, flags);
        }

        @Override
        public List<ResolveInfo> queryIntentServices(Intent intent, int flags) {
            ComponentName component = intent.getComponent();
            if (null == component) {
                if (intent.getSelector() != null) {
                    intent = intent.getSelector();
                    component = intent.getComponent();
                }
            }

            if (null != component) {
                LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
                if (null != plugin) {
                    ServiceInfo serviceInfo = plugin.getServiceInfo(component);
                    if (serviceInfo != null) {
                        ResolveInfo resolveInfo = new ResolveInfo();
                        resolveInfo.serviceInfo = serviceInfo;
                        return Arrays.asList(resolveInfo);
                    }
                }
            }

            List<ResolveInfo> all = new ArrayList<ResolveInfo>();

            List<ResolveInfo> pluginResolveInfos = mPluginManager.queryIntentServices(intent, flags);
            if (null != pluginResolveInfos && pluginResolveInfos.size() > 0) {
                all.addAll(pluginResolveInfos);
            }

            List<ResolveInfo> hostResolveInfos = this.mHostPackageManager.queryIntentServices(intent, flags);
            if (null != hostResolveInfos && hostResolveInfos.size() > 0) {
                all.addAll(hostResolveInfos);
            }

            return all;
        }

        @Override
        @TargetApi(Build.VERSION_CODES.KITKAT)
        public List<ResolveInfo> queryIntentContentProviders(Intent intent, int flags) {
            return this.mHostPackageManager.queryIntentContentProviders(intent, flags);
        }

        @Override
        public ProviderInfo resolveContentProvider(String name, int flags) {
            ProviderInfo providerInfo = mPluginManager.resolveContentProvider(name, flags);
            if (null != providerInfo) {
                return providerInfo;
            }

            return this.mHostPackageManager.resolveContentProvider(name, flags);
        }

        @Override
        public List<ProviderInfo> queryContentProviders(String processName, int uid, int flags) {
            return this.mHostPackageManager.queryContentProviders(processName, uid, flags);
        }

        @Override
        public InstrumentationInfo getInstrumentationInfo(ComponentName component, int flags) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
            if (null != plugin) {
                return plugin.mInstrumentationInfos.get(component);
            }

            return this.mHostPackageManager.getInstrumentationInfo(component, flags);
        }

        @Override
        public List<InstrumentationInfo> queryInstrumentation(String targetPackage, int flags) {
            return this.mHostPackageManager.queryInstrumentation(targetPackage, flags);
        }

        @Override
        public Drawable getDrawable(String packageName, int resid, ApplicationInfo appInfo) {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(packageName);
            if (null != plugin) {
                return plugin.mResources.getDrawable(resid);
            }

            return this.mHostPackageManager.getDrawable(packageName, resid, appInfo);
        }

        @Override
        public Drawable getActivityIcon(ComponentName component) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
            if (null != plugin) {
                return plugin.mResources.getDrawable(plugin.mActivityInfos.get(component).icon);
            }

            return this.mHostPackageManager.getActivityIcon(component);
        }

        @Override
        public Drawable getActivityIcon(Intent intent) throws NameNotFoundException {
            ResolveInfo ri = mPluginManager.resolveActivity(intent);
            if (null != ri) {
                LoadedPlugin plugin = mPluginManager.getLoadedPlugin(ri.resolvePackageName);
                return plugin.mResources.getDrawable(ri.activityInfo.icon);
            }

            return this.mHostPackageManager.getActivityIcon(intent);
        }

        @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
        @Override
        public Drawable getActivityBanner(ComponentName component) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
            if (null != plugin) {
                return plugin.mResources.getDrawable(plugin.mActivityInfos.get(component).banner);
            }

            return this.mHostPackageManager.getActivityBanner(component);
        }

        @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
        @Override
        public Drawable getActivityBanner(Intent intent) throws NameNotFoundException {
            ResolveInfo ri = mPluginManager.resolveActivity(intent);
            if (null != ri) {
                LoadedPlugin plugin = mPluginManager.getLoadedPlugin(ri.resolvePackageName);
                return plugin.mResources.getDrawable(ri.activityInfo.banner);
            }

            return this.mHostPackageManager.getActivityBanner(intent);
        }

        @Override
        public Drawable getDefaultActivityIcon() {
            return this.mHostPackageManager.getDefaultActivityIcon();
        }

        @Override
        public Drawable getApplicationIcon(ApplicationInfo info) {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(info.packageName);
            if (null != plugin) {
                return plugin.mResources.getDrawable(info.icon);
            }

            return this.mHostPackageManager.getApplicationIcon(info);
        }

        @Override
        public Drawable getApplicationIcon(String packageName) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(packageName);
            if (null != plugin) {
                return plugin.mResources.getDrawable(plugin.mPackage.applicationInfo.icon);
            }

            return this.mHostPackageManager.getApplicationIcon(packageName);
        }

        @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
        @Override
        public Drawable getApplicationBanner(ApplicationInfo info) {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(info.packageName);
            if (null != plugin) {
                return plugin.mResources.getDrawable(info.banner);
            }

            return this.mHostPackageManager.getApplicationBanner(info);
        }

        @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
        @Override
        public Drawable getApplicationBanner(String packageName) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(packageName);
            if (null != plugin) {
                return plugin.mResources.getDrawable(plugin.mPackage.applicationInfo.banner);
            }

            return this.mHostPackageManager.getApplicationBanner(packageName);
        }

        @Override
        public Drawable getActivityLogo(ComponentName component) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
            if (null != plugin) {
                return plugin.mResources.getDrawable(plugin.mActivityInfos.get(component).logo);
            }

            return this.mHostPackageManager.getActivityLogo(component);
        }

        @Override
        public Drawable getActivityLogo(Intent intent) throws NameNotFoundException {
            ResolveInfo ri = mPluginManager.resolveActivity(intent);
            if (null != ri) {
                LoadedPlugin plugin = mPluginManager.getLoadedPlugin(ri.resolvePackageName);
                return plugin.mResources.getDrawable(ri.activityInfo.logo);
            }

            return this.mHostPackageManager.getActivityLogo(intent);
        }

        @Override
        public Drawable getApplicationLogo(ApplicationInfo info) {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(info.packageName);
            if (null != plugin) {
                return plugin.mResources.getDrawable(0 != info.logo ? info.logo : android.R.drawable.sym_def_app_icon);
            }

            return this.mHostPackageManager.getApplicationLogo(info);
        }

        @Override
        public Drawable getApplicationLogo(String packageName) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(packageName);
            if (null != plugin) {
                return plugin.mResources.getDrawable(0 != plugin.mPackage.applicationInfo.logo ? plugin.mPackage.applicationInfo.logo : android.R.drawable.sym_def_app_icon);
            }

            return this.mHostPackageManager.getApplicationLogo(packageName);
        }

        @TargetApi(Build.VERSION_CODES.LOLLIPOP)
        @Override
        public Drawable getUserBadgedIcon(Drawable icon, UserHandle user) {
            return this.mHostPackageManager.getUserBadgedIcon(icon, user);
        }

        @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
        public Drawable getUserBadgeForDensity(UserHandle user, int density) {
            try {
                return Reflector.with(this.mHostPackageManager)
                    .method("getUserBadgeForDensity", UserHandle.class, int.class)
                    .call(user, density);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        @TargetApi(Build.VERSION_CODES.LOLLIPOP)
        @Override
        public Drawable getUserBadgedDrawableForDensity(Drawable drawable, UserHandle user, Rect badgeLocation, int badgeDensity) {
            return this.mHostPackageManager.getUserBadgedDrawableForDensity(drawable, user, badgeLocation, badgeDensity);
        }

        @TargetApi(Build.VERSION_CODES.LOLLIPOP)
        @Override
        public CharSequence getUserBadgedLabel(CharSequence label, UserHandle user) {
            return this.mHostPackageManager.getUserBadgedLabel(label, user);
        }

        @Override
        public CharSequence getText(String packageName, int resid, ApplicationInfo appInfo) {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(packageName);
            if (null != plugin) {
                return plugin.mResources.getText(resid);
            }

            return this.mHostPackageManager.getText(packageName, resid, appInfo);
        }

        @Override
        public XmlResourceParser getXml(String packageName, int resid, ApplicationInfo appInfo) {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(packageName);
            if (null != plugin) {
                return plugin.mResources.getXml(resid);
            }

            return this.mHostPackageManager.getXml(packageName, resid, appInfo);
        }

        @Override
        public CharSequence getApplicationLabel(ApplicationInfo info) {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(info.packageName);
            if (null != plugin) {
                try {
                    return plugin.mResources.getText(info.labelRes);
                } catch (Resources.NotFoundException e) {
                    // ignored.
                }
            }

            return this.mHostPackageManager.getApplicationLabel(info);
        }

        @Override
        public Resources getResourcesForActivity(ComponentName component) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(component);
            if (null != plugin) {
                return plugin.mResources;
            }

            return this.mHostPackageManager.getResourcesForActivity(component);
        }

        @Override
        public Resources getResourcesForApplication(ApplicationInfo app) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(app.packageName);
            if (null != plugin) {
                return plugin.mResources;
            }

            return this.mHostPackageManager.getResourcesForApplication(app);
        }

        @Override
        public Resources getResourcesForApplication(String appPackageName) throws NameNotFoundException {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(appPackageName);
            if (null != plugin) {
                return plugin.mResources;
            }

            return this.mHostPackageManager.getResourcesForApplication(appPackageName);
        }

        @Override
        public void verifyPendingInstall(int id, int verificationCode) {
            this.mHostPackageManager.verifyPendingInstall(id, verificationCode);
        }

        @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
        @Override
        public void extendVerificationTimeout(int id, int verificationCodeAtTimeout, long millisecondsToDelay) {
            this.mHostPackageManager.extendVerificationTimeout(id, verificationCodeAtTimeout, millisecondsToDelay);
        }

        @Override
        public void setInstallerPackageName(String targetPackage, String installerPackageName) {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(targetPackage);
            if (null != plugin) {
                return;
            }

            this.mHostPackageManager.setInstallerPackageName(targetPackage, installerPackageName);
        }

        @Override
        public String getInstallerPackageName(String packageName) {
            LoadedPlugin plugin = mPluginManager.getLoadedPlugin(packageName);
            if (null != plugin) {
                return mHostContext.getPackageName();
            }

            return this.mHostPackageManager.getInstallerPackageName(packageName);
        }

        @Override
        public void addPackageToPreferred(String packageName) {
            this.mHostPackageManager.addPackageToPreferred(packageName);
        }

        @Override
        public void removePackageFromPreferred(String packageName) {
            this.mHostPackageManager.removePackageFromPreferred(packageName);
        }

        @Override
        public List<PackageInfo> getPreferredPackages(int flags) {
            return this.mHostPackageManager.getPreferredPackages(flags);
        }

        @Override
        public void addPreferredActivity(IntentFilter filter, int match, ComponentName[] set, ComponentName activity) {
            this.mHostPackageManager.addPreferredActivity(filter, match, set, activity);
        }

        @Override
        public void clearPackagePreferredActivities(String packageName) {
            this.mHostPackageManager.clearPackagePreferredActivities(packageName);
        }

        @Override
        public int getPreferredActivities(@NonNull List<IntentFilter> outFilters, @NonNull List<ComponentName> outActivities, String packageName) {
            return this.mHostPackageManager.getPreferredActivities(outFilters, outActivities, packageName);
        }

        @Override
        public void setComponentEnabledSetting(ComponentName component, int newState, int flags) {
            this.mHostPackageManager.setComponentEnabledSetting(component, newState, flags);
        }

        @Override
        public int getComponentEnabledSetting(ComponentName component) {
            return this.mHostPackageManager.getComponentEnabledSetting(component);
        }

        @Override
        public void setApplicationEnabledSetting(String packageName, int newState, int flags) {
            this.mHostPackageManager.setApplicationEnabledSetting(packageName, newState, flags);
        }

        @Override
        public int getApplicationEnabledSetting(String packageName) {
            return this.mHostPackageManager.getApplicationEnabledSetting(packageName);
        }

        @Override
        public boolean isSafeMode() {
            return this.mHostPackageManager.isSafeMode();
        }
    
        @TargetApi(Build.VERSION_CODES.O)
        @Override
        public void setApplicationCategoryHint(@NonNull String packageName, int categoryHint) {
            this.mHostPackageManager.setApplicationCategoryHint(packageName, categoryHint);
        }
    
        @TargetApi(Build.VERSION_CODES.LOLLIPOP)
        @Override
        public @NonNull PackageInstaller getPackageInstaller() {
            return this.mHostPackageManager.getPackageInstaller();
        }
    
        @TargetApi(Build.VERSION_CODES.O)
        @Override
        public boolean canRequestPackageInstalls() {
            return this.mHostPackageManager.canRequestPackageInstalls();
        }
    
        public Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo) {
            if (itemInfo == null) {
                return null;
            }
            return itemInfo.loadIcon(this.mHostPackageManager);
        }
    }

}


================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/PluginContentResolver.java
================================================
/*
 * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.didi.virtualapk.internal;

import android.annotation.TargetApi;
import android.content.ContentResolverWrapper;
import android.content.Context;
import android.content.IContentProvider;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Keep;

import com.didi.virtualapk.PluginManager;
import com.didi.virtualapk.delegate.RemoteContentProvider;

/**
 * Created by renyugang on 16/12/7.
 */

public class PluginContentResolver extends ContentResolverWrapper {
    private PluginManager mPluginManager;

    public PluginContentResolver(Context context) {
        super(context);
        mPluginManager = PluginManager.getInstance(context);
    }
    
    @Override
    protected IContentProvider acquireProvider(Context context, String auth) {
        if (mPluginManager.resolveContentProvider(auth, 0) != null) {
            return mPluginManager.getIContentProvider();
        }
        return super.acquireProvider(context, auth);
    }

    @Override
    protected IContentProvider acquireExistingProvider(Context context, String auth) {
        if (mPluginManager.resolveContentProvider(auth, 0) != null) {
            return mPluginManager.getIContentProvider();
        }
        return super.acquireExistingProvider(context, auth);
    }
    
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    @Override
    protected IContentProvider acquireUnstableProvider(Context context, String auth) {
        if (mPluginManager.resolveContentProvider(auth, 0) != null) {
            return mPluginManager.getIContentProvider();
        }
        return super.acquireUnstableProvider(context, auth);
    }

    @Override
    public boolean releaseProvider(IContentProvider provider) {
        return true;
    }
    
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    @Override
    public boolean releaseUnstableProvider(IContentProvider icp) {
        return true;
    }
    
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    @Override
    public void unstableProviderDied(IContentProvider icp) {
    }

    @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
    @Override
    public void appNotRespondingViaProvider(IContentProvider icp) {
    }

    protected int resolveUserIdFromAuthority(String auth) {
        return 0;
    }

    @Keep
    public static Uri wrapperUri(LoadedPlugin loadedPlugin, Uri pluginUri) {
        String pkg = loadedPlugin.getPackageName();
        String pluginUriString = Uri.encode(pluginUri.toString());
        StringBuilder builder = new StringBuilder(RemoteContentProvider.getUri(loadedPlugin.getHostContext()));
        builder.append("/?plugin=" + loadedPlugin.getLocation());
        builder.append("&pkg=" + pkg);
        builder.append("&uri=" + pluginUriString);
        Uri wrapperUri = Uri.parse(builder.toString());
        return wrapperUri;
    }

    @Deprecated
    public static String getAuthority(Context context) {
        return RemoteContentProvider.getAuthority(context);
    }

    @Deprecated
    public static String getUri(Context context) {
        return RemoteContentProvider.getUri(context);
    }

    @Keep
    public static Bundle getBundleForCall(Uri uri) {
        Bundle bundle = new Bundle();
        bundle.putString(RemoteContentProvider.KEY_WRAPPER_URI, uri.toString());
        return bundle;
    }

}


================================================
FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/PluginContext.java
================================================
/*
 * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitat
Download .txt
gitextract__l3v4sn5/

├── .gitignore
├── AndroidStub/
│   ├── README.md
│   ├── build.gradle
│   ├── gradle.properties
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── aidl/
│           │   └── android/
│           │       ├── app/
│           │       │   ├── IActivityManager.aidl
│           │       │   ├── IApplicationThread.aidl
│           │       │   ├── INotificationManager.aidl
│           │       │   └── IServiceConnection.aidl
│           │       └── content/
│           │           ├── IIntentReceiver.aidl
│           │           └── IIntentSender.aidl
│           └── java/
│               ├── android/
│               │   ├── app/
│               │   │   ├── ActivityManagerNative.java
│               │   │   ├── ActivityThread.java
│               │   │   ├── ApplicationThreadNative.java
│               │   │   ├── Instrumentation.java
│               │   │   ├── LoadedApk.java
│               │   │   └── ResourcesManager.java
│               │   ├── content/
│               │   │   ├── ContentResolver.java
│               │   │   ├── IContentProvider.java
│               │   │   ├── pm/
│               │   │   │   ├── ManifestDigest.java
│               │   │   │   ├── PackageParser.java
│               │   │   │   ├── PackageUserState.java
│               │   │   │   └── VerifierInfo.java
│               │   │   └── res/
│               │   │       ├── CompatibilityInfo.java
│               │   │       ├── Resources.java
│               │   │       ├── ResourcesImpl.java
│               │   │       └── ResourcesKey.java
│               │   ├── databinding/
│               │   │   ├── DataBinderMapper.java
│               │   │   └── DataBindingComponent.java
│               │   ├── os/
│               │   │   ├── ServiceManager.java
│               │   │   └── SystemProperties.java
│               │   └── util/
│               │       └── Singleton.java
│               └── com/
│                   └── android/
│                       └── internal/
│                           └── R.java
├── CONTRIBUTING.md
├── CoreLibrary/
│   ├── .gitignore
│   ├── build.gradle
│   ├── gradle.properties
│   ├── proguard-rules.pro
│   ├── src/
│   │   ├── androidTest/
│   │   │   └── java/
│   │   │       └── com/
│   │   │           └── didi/
│   │   │               └── virtualapk/
│   │   │                   └── core/
│   │   │                       └── ApplicationTest.java
│   │   ├── main/
│   │   │   ├── AndroidManifest.xml
│   │   │   ├── java/
│   │   │   │   ├── android/
│   │   │   │   │   ├── content/
│   │   │   │   │   │   └── ContentResolverWrapper.java
│   │   │   │   │   └── databinding/
│   │   │   │   │       └── DataBinderMapperProxy.java
│   │   │   │   └── com/
│   │   │   │       └── didi/
│   │   │   │           └── virtualapk/
│   │   │   │               ├── PluginManager.java
│   │   │   │               ├── delegate/
│   │   │   │               │   ├── ActivityManagerProxy.java
│   │   │   │               │   ├── IContentProviderProxy.java
│   │   │   │               │   ├── LocalService.java
│   │   │   │               │   ├── RemoteContentProvider.java
│   │   │   │               │   ├── RemoteService.java
│   │   │   │               │   └── StubActivity.java
│   │   │   │               ├── internal/
│   │   │   │               │   ├── ActivityLifecycleCallbacksProxy.java
│   │   │   │               │   ├── ComponentsHandler.java
│   │   │   │               │   ├── Constants.java
│   │   │   │               │   ├── LoadedPlugin.java
│   │   │   │               │   ├── PluginContentResolver.java
│   │   │   │               │   ├── PluginContext.java
│   │   │   │               │   ├── ResourcesManager.java
│   │   │   │               │   ├── StubActivityInfo.java
│   │   │   │               │   ├── VAInstrumentation.java
│   │   │   │               │   └── utils/
│   │   │   │               │       ├── DexUtil.java
│   │   │   │               │       ├── PackageParserCompat.java
│   │   │   │               │       ├── PluginUtil.java
│   │   │   │               │       └── Settings.java
│   │   │   │               └── utils/
│   │   │   │                   ├── Reflector.java
│   │   │   │                   ├── RunUtil.java
│   │   │   │                   └── ZipVerifyUtil.java
│   │   │   └── res/
│   │   │       └── values/
│   │   │           └── strings.xml
│   │   └── test/
│   │       └── java/
│   │           └── com/
│   │               └── didi/
│   │                   └── virtualapk/
│   │                       └── core/
│   │                           └── ExampleUnitTest.java
│   └── upload.gradle
├── LICENSE
├── PluginDemo/
│   ├── app/
│   │   ├── build.gradle
│   │   ├── gradle.properties
│   │   ├── proguard-rules.pro
│   │   └── src/
│   │       └── main/
│   │           ├── AndroidManifest.xml
│   │           ├── aidl/
│   │           │   └── com/
│   │           │       └── didi/
│   │           │           └── virtualapk/
│   │           │               └── demo/
│   │           │                   ├── aidl/
│   │           │                   │   ├── Book.aidl
│   │           │                   │   ├── IBookManager.aidl
│   │           │                   │   └── IOnNewBookArrivedListener.aidl
│   │           │                   ├── binderpool/
│   │           │                   │   ├── IBinderPool.aidl
│   │           │                   │   ├── ICompute.aidl
│   │           │                   │   └── ISecurityCenter.aidl
│   │           │                   └── manualbinder/
│   │           │                       └── Book.aidl
│   │           ├── java/
│   │           │   └── com/
│   │           │       └── didi/
│   │           │           └── virtualapk/
│   │           │               └── demo/
│   │           │                   ├── MainActivity.java
│   │           │                   ├── MyApplication.java
│   │           │                   ├── SecondActivity.java
│   │           │                   ├── ThirdActivity.java
│   │           │                   ├── aidl/
│   │           │                   │   ├── Book.java
│   │           │                   │   ├── BookManagerActivity.java
│   │           │                   │   └── BookManagerService.java
│   │           │                   ├── binderpool/
│   │           │                   │   ├── BinderPool.java
│   │           │                   │   ├── BinderPoolActivity.java
│   │           │                   │   ├── BinderPoolService.java
│   │           │                   │   ├── ComputeImpl.java
│   │           │                   │   └── SecurityCenterImpl.java
│   │           │                   ├── manager/
│   │           │                   │   ├── BookManager.java
│   │           │                   │   └── UserManager.java
│   │           │                   ├── manualbinder/
│   │           │                   │   ├── Book.java
│   │           │                   │   ├── BookManagerImpl.java
│   │           │                   │   └── IBookManager.java
│   │           │                   ├── messenger/
│   │           │                   │   ├── MessengerActivity.java
│   │           │                   │   └── MessengerService.java
│   │           │                   ├── model/
│   │           │                   │   └── User.java
│   │           │                   ├── provider/
│   │           │                   │   ├── BookProvider.java
│   │           │                   │   ├── DbOpenHelper.java
│   │           │                   │   └── ProviderActivity.java
│   │           │                   ├── socket/
│   │           │                   │   ├── TCPClientActivity.java
│   │           │                   │   └── TCPServerService.java
│   │           │                   └── utils/
│   │           │                       ├── MyConstants.java
│   │           │                       └── MyUtils.java
│   │           └── res/
│   │               ├── drawable/
│   │               │   └── edit.xml
│   │               ├── layout/
│   │               │   ├── activity_binder_pool.xml
│   │               │   ├── activity_book_manager.xml
│   │               │   ├── activity_main.xml
│   │               │   ├── activity_messenger.xml
│   │               │   ├── activity_provider.xml
│   │               │   ├── activity_second.xml
│   │               │   ├── activity_tcpclient.xml
│   │               │   └── activity_third.xml
│   │               └── values/
│   │                   ├── colors.xml
│   │                   ├── strings.xml
│   │                   └── styles.xml
│   ├── build.gradle
│   ├── gradle/
│   │   └── wrapper/
│   │       ├── gradle-wrapper.jar
│   │       └── gradle-wrapper.properties
│   ├── gradlew
│   ├── gradlew.bat
│   ├── make.sh
│   └── settings.gradle
├── README.md
├── RELEASE-NOTES.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── didi/
│       │               └── virtualapk/
│       │                   └── ApplicationTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── didi/
│       │   │           └── virtualapk/
│       │   │               ├── MainActivity.java
│       │   │               └── VAApplication.java
│       │   └── res/
│       │       ├── layout/
│       │       │   └── activity_main.xml
│       │       ├── values/
│       │       │   ├── colors.xml
│       │       │   ├── dimens.xml
│       │       │   ├── strings.xml
│       │       │   └── styles.xml
│       │       ├── values-en/
│       │       │   └── strings.xml
│       │       └── values-w820dp/
│       │           └── dimens.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── didi/
│                       └── virtualapk/
│                           └── ExampleUnitTest.java
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── keystore/
│   ├── test.cer
│   └── test.keystore
├── settings.gradle
└── virtualapk-gradle-plugin/
    ├── build.gradle
    ├── gradle/
    │   └── wrapper/
    │       ├── gradle-wrapper.jar
    │       └── gradle-wrapper.properties
    ├── gradle.properties
    ├── gradlew
    ├── gradlew.bat
    ├── src/
    │   └── main/
    │       ├── groovy/
    │       │   └── com.didi.virtualapk/
    │       │       ├── BasePlugin.groovy
    │       │       ├── Constants.groovy
    │       │       ├── VAExtention.groovy
    │       │       ├── VAHostPlugin.groovy
    │       │       ├── VAPlugin.groovy
    │       │       ├── aapt/
    │       │       │   ├── AXmlEditor.groovy
    │       │       │   ├── Aapt.groovy
    │       │       │   ├── ArscEditor.groovy
    │       │       │   ├── AssetEditor.groovy
    │       │       │   ├── CppHexEditor.groovy
    │       │       │   ├── ResAttr.groovy
    │       │       │   ├── ResStringFlag.groovy
    │       │       │   ├── ResStringPoolSpan.groovy
    │       │       │   ├── ResTableEntry.groovy
    │       │       │   ├── ResTableType.groovy
    │       │       │   ├── ResType.groovy
    │       │       │   ├── ResValueDataType.groovy
    │       │       │   ├── SymbolParser.groovy
    │       │       │   └── packageinfo
    │       │       ├── collector/
    │       │       │   ├── HostClassAndResCollector.groovy
    │       │       │   ├── HostJniLibsCollector.groovy
    │       │       │   ├── ResourceCollector.groovy
    │       │       │   ├── dependence/
    │       │       │   │   ├── AarDependenceInfo.groovy
    │       │       │   │   ├── DependenceInfo.groovy
    │       │       │   │   └── JarDependenceInfo.groovy
    │       │       │   └── res/
    │       │       │       ├── ResourceEntry.groovy
    │       │       │       └── StyleableEntry.groovy
    │       │       ├── hooker/
    │       │       │   ├── DxTaskHooker.groovy
    │       │       │   ├── GradleTaskHooker.groovy
    │       │       │   ├── MergeAssetsHooker.groovy
    │       │       │   ├── MergeJniLibsHooker.groovy
    │       │       │   ├── MergeManifestsHooker.groovy
    │       │       │   ├── PrepareDependenciesHooker.groovy
    │       │       │   ├── ProcessResourcesHooker.groovy
    │       │       │   ├── ProguardHooker.groovy
    │       │       │   ├── ShrinkResourcesHooker.groovy
    │       │       │   └── TaskHookerManager.groovy
    │       │       ├── tasks/
    │       │       │   └── AssemblePlugin.groovy
    │       │       ├── transform/
    │       │       │   ├── StripClassAndResTransform.groovy
    │       │       │   └── TransformWrapper.groovy
    │       │       └── utils/
    │       │           ├── CheckList.groovy
    │       │           ├── FileBinaryCategory.groovy
    │       │           ├── FileUtil.groovy
    │       │           ├── PackagingUtils.java
    │       │           ├── Reflect.java
    │       │           └── ZipUtil.groovy
    │       ├── java/
    │       │   └── com/
    │       │       └── didi/
    │       │           └── virtualapk/
    │       │               ├── databinding/
    │       │               │   └── annotationprocessor/
    │       │               │       └── ProcessDataBinding.java
    │       │               └── utils/
    │       │                   └── Log.java
    │       └── resources/
    │           └── META-INF/
    │               ├── gradle-plugins/
    │               │   ├── com.didi.virtualapk.host.properties
    │               │   └── com.didi.virtualapk.plugin.properties
    │               └── services/
    │                   └── javax.annotation.processing.Processor
    └── upload.gradle
Download .txt
SYMBOL INDEX (906 symbols across 84 files)

FILE: AndroidStub/src/main/java/android/app/ActivityManagerNative.java
  class ActivityManagerNative (line 10) | public abstract class ActivityManagerNative extends Binder implements IA...
    method getDefault (line 12) | public static IActivityManager getDefault() {
    method isSystemReady (line 16) | public static boolean isSystemReady() {
    method broadcastStickyIntent (line 20) | public static void broadcastStickyIntent(final Intent intent, final St...
    method asInterface (line 24) | static public IActivityManager asInterface(IBinder obj) {
    method ActivityManagerNative (line 28) | public ActivityManagerNative() {

FILE: AndroidStub/src/main/java/android/app/ActivityThread.java
  class ActivityThread (line 12) | public final class ActivityThread {
    method currentActivityThread (line 14) | public static ActivityThread currentActivityThread() {
    method isSystem (line 18) | public static boolean isSystem() {
    method currentOpPackageName (line 22) | public static String currentOpPackageName() {
    method currentPackageName (line 26) | public static String currentPackageName() {
    method currentProcessName (line 30) | public static String currentProcessName() {
    method currentApplication (line 34) | public static Application currentApplication() {
    method getApplicationThread (line 38) | public ApplicationThread getApplicationThread() {
    method getInstrumentation (line 42) | public Instrumentation getInstrumentation() {
    method getLooper (line 46) | public Looper getLooper() {
    method getApplication (line 50) | public Application getApplication() {
    method getProcessName (line 54) | public String getProcessName() {
    method resolveActivityInfo (line 58) | public final ActivityInfo resolveActivityInfo(final Intent intent) {
    method getActivity (line 62) | public final Activity getActivity(final IBinder token) {
    method getHandler (line 66) | final Handler getHandler() {
    class ApplicationThread (line 70) | private class ApplicationThread extends ApplicationThreadNative {

FILE: AndroidStub/src/main/java/android/app/ApplicationThreadNative.java
  class ApplicationThreadNative (line 9) | public abstract class ApplicationThreadNative extends Binder implements ...
    method asBinder (line 11) | @Override

FILE: AndroidStub/src/main/java/android/app/Instrumentation.java
  class Instrumentation (line 13) | public class Instrumentation {
    method newApplication (line 15) | public Application newApplication(ClassLoader cl, String className, Co...
    method callApplicationOnCreate (line 19) | public void callApplicationOnCreate(Application app) {
    method newActivity (line 23) | public Activity newActivity(ClassLoader cl, String className, Intent i...
    method callActivityOnCreate (line 27) | public void callActivityOnCreate(Activity activity, Bundle icicle) {
    method callActivityOnCreate (line 31) | public void callActivityOnCreate(Activity activity, Bundle icicle, Per...
    method execStartActivity (line 35) | public ActivityResult execStartActivity(Context who, IBinder contextTh...
    method execStartActivity (line 39) | public ActivityResult execStartActivity(Context who, IBinder contextTh...
    method execStartActivity (line 43) | public ActivityResult execStartActivity(Context who, IBinder contextTh...
    method execStartActivity (line 47) | public ActivityResult execStartActivity(Context who, IBinder contextTh...
    method getContext (line 51) | public Context getContext() {
    method getTargetContext (line 55) | public Context getTargetContext() {
    method getComponentName (line 59) | public ComponentName getComponentName() {
    class ActivityResult (line 63) | public static final class ActivityResult {
      method ActivityResult (line 64) | public ActivityResult(int resultCode, Intent resultData) {

FILE: AndroidStub/src/main/java/android/app/LoadedApk.java
  class LoadedApk (line 16) | public final class LoadedApk {
    method getPackageName (line 18) | public String getPackageName() {
    method getApplicationInfo (line 22) | public ApplicationInfo getApplicationInfo() {
    method getClassLoader (line 26) | public ClassLoader getClassLoader() {
    method getAppDir (line 30) | public String getAppDir() {
    method getLibDir (line 34) | public String getLibDir() {
    method getResDir (line 38) | public String getResDir() {
    method getSplitAppDirs (line 42) | public String[] getSplitAppDirs() {
    method getSplitResDirs (line 46) | public String[] getSplitResDirs() {
    method getOverlayDirs (line 50) | public String[] getOverlayDirs() {
    method getDataDir (line 54) | public String getDataDir() {
    method getDataDirFile (line 58) | public File getDataDirFile() {
    method getAssets (line 62) | public AssetManager getAssets(final ActivityThread mainThread) {
    method getResources (line 66) | public Resources getResources(final ActivityThread mainThread) {
    method getReceiverDispatcher (line 70) | public IIntentReceiver getReceiverDispatcher(final BroadcastReceiver r...
    method forgetReceiverDispatcher (line 74) | public IIntentReceiver forgetReceiverDispatcher(final Context context,...

FILE: AndroidStub/src/main/java/android/app/ResourcesManager.java
  class ResourcesManager (line 6) | public class ResourcesManager {
    method getInstance (line 8) | public static ResourcesManager getInstance() {
    method appendLibAssetForMainAssetPath (line 12) | public void appendLibAssetForMainAssetPath(String assetPath, String li...

FILE: AndroidStub/src/main/java/android/content/ContentResolver.java
  class ContentResolver (line 11) | public abstract class ContentResolver {
    method ContentResolver (line 13) | public ContentResolver(Context context) {
    method call (line 17) | public final @Nullable
    method acquireProvider (line 23) | protected abstract IContentProvider acquireProvider(Context c, String ...
    method acquireExistingProvider (line 25) | protected IContentProvider acquireExistingProvider(Context c, String n...
    method releaseProvider (line 29) | public abstract boolean releaseProvider(IContentProvider icp);
    method acquireUnstableProvider (line 31) | protected abstract IContentProvider acquireUnstableProvider(Context c,...
    method releaseUnstableProvider (line 33) | public abstract boolean releaseUnstableProvider(IContentProvider icp);
    method unstableProviderDied (line 35) | public abstract void unstableProviderDied(IContentProvider icp);
    method appNotRespondingViaProvider (line 37) | public void appNotRespondingViaProvider(IContentProvider icp) {

FILE: AndroidStub/src/main/java/android/content/IContentProvider.java
  type IContentProvider (line 25) | public interface IContentProvider extends IInterface {

FILE: AndroidStub/src/main/java/android/content/pm/ManifestDigest.java
  class ManifestDigest (line 11) | public class ManifestDigest implements Parcelable {
    method ManifestDigest (line 13) | ManifestDigest(final byte[] digest) {
    method ManifestDigest (line 17) | private ManifestDigest(final Parcel source) {
    method fromAttributes (line 21) | static ManifestDigest fromAttributes(final Attributes attributes) {
    method describeContents (line 25) | @Override
    method equals (line 30) | @Override
    method hashCode (line 35) | @Override
    method toString (line 40) | @Override
    method writeToParcel (line 45) | @Override
    method createFromParcel (line 51) | public ManifestDigest createFromParcel(Parcel source) {
    method newArray (line 55) | public ManifestDigest[] newArray(int size) {

FILE: AndroidStub/src/main/java/android/content/pm/PackageParser.java
  class PackageParser (line 23) | public class PackageParser {
    class NewPermissionInfo (line 36) | public static class NewPermissionInfo {
      method NewPermissionInfo (line 41) | public NewPermissionInfo(String name, int sdkVersion, int fileVersio...
    class SplitPermissionInfo (line 46) | public static class SplitPermissionInfo {
      method SplitPermissionInfo (line 51) | public SplitPermissionInfo(String rootPerm, String[] newPerms, int t...
    class ParsePackageItemArgs (line 61) | static class ParsePackageItemArgs {
      method ParsePackageItemArgs (line 73) | ParsePackageItemArgs(final Package owner, final String[] outError, f...
    class ParseComponentArgs (line 77) | static class ParseComponentArgs extends ParsePackageItemArgs {
      method ParseComponentArgs (line 84) | ParseComponentArgs(final Package owner, final String[] outError, fin...
    class PackageLite (line 90) | public static class PackageLite {
      method PackageLite (line 120) | public PackageLite(final String codePath, final ApkLite baseApk, fin...
      method getAllCodePaths (line 124) | public List<String> getAllCodePaths() {
    class ApkLite (line 129) | public static class ApkLite {
      method ApkLite (line 142) | public ApkLite(final String codePath, final String packageName, fina...
    method PackageParser (line 150) | public PackageParser() {
    method PackageParser (line 154) | public PackageParser(final String archiveSourcePath) {
    method setSeparateProcesses (line 158) | public void setSeparateProcesses(final String[] procs) {
    method setOnlyCoreApps (line 162) | public void setOnlyCoreApps(final boolean onlyCoreApps) {
    method setDisplayMetrics (line 166) | public void setDisplayMetrics(final DisplayMetrics metrics) {
    method isApkFile (line 170) | public static final boolean isApkFile(final File file) {
    method generatePackageInfo (line 174) | public static PackageInfo generatePackageInfo(final PackageParser.Pack...
    method isAvailable (line 178) | public static boolean isAvailable(final PackageUserState state) {
    method generatePackageInfo (line 182) | public static PackageInfo generatePackageInfo(final PackageParser.Pack...
    method parsePackageLite (line 197) | public static PackageLite parsePackageLite(final File packageFile, fin...
    method parsePackage (line 216) | public Package parsePackage(final File packageFile, final int flags) t...
    method parsePackage (line 229) | public Package parsePackage(final File sourceFile, final String destCo...
    method collectManifestDigest (line 233) | public void collectManifestDigest(final Package pkg) throws PackagePar...
    method collectCertificates (line 237) | public void collectCertificates(final Package pkg, final int flags) th...
    method parseApkLite (line 249) | public static ApkLite parseApkLite(final File apkFile, final int flags...
    method generateApplicationInfo (line 253) | public static ApplicationInfo generateApplicationInfo(final Package p,...
    method generateApplicationInfo (line 257) | public static ApplicationInfo generateApplicationInfo(final Package p,...
    method generateApplicationInfo (line 261) | public static ApplicationInfo generateApplicationInfo(final Applicatio...
    method generatePermissionInfo (line 265) | public static final PermissionInfo generatePermissionInfo(final Permis...
    method generatePermissionGroupInfo (line 269) | public static final PermissionGroupInfo generatePermissionGroupInfo(fi...
    method generateInstrumentationInfo (line 273) | public static final InstrumentationInfo generateInstrumentationInfo(fi...
    method generateServiceInfo (line 277) | public static final ServiceInfo generateServiceInfo(final Service s, f...
    method generateProviderInfo (line 281) | public static final ProviderInfo generateProviderInfo(final Provider p...
    method generateActivityInfo (line 285) | public static final ActivityInfo generateActivityInfo(final Activity a...
    method generateActivityInfo (line 289) | public static final ActivityInfo generateActivityInfo(final ActivityIn...
    class Package (line 297) | public final static class Package {
      method Package (line 451) | public Package(String packageName) {
      method getAllCodePaths (line 455) | public List<String> getAllCodePaths() {
      method getAllCodePathsExcludingResourceOnly (line 463) | public List<String> getAllCodePathsExcludingResourceOnly() {
      method setPackageName (line 467) | public void setPackageName(final String newName) {
      method hasComponentClassName (line 471) | public boolean hasComponentClassName(final String name) {
      method isForwardLocked (line 475) | public boolean isForwardLocked() {
      method isSystemApp (line 479) | public boolean isSystemApp() {
      method isPrivilegedApp (line 483) | public boolean isPrivilegedApp() {
      method isUpdatedSystemApp (line 487) | public boolean isUpdatedSystemApp() {
      method canHaveOatDir (line 491) | public boolean canHaveOatDir() {
      method toString (line 495) | @Override
    class Component (line 501) | public static class Component<II extends IntentInfo> {
      method Component (line 510) | public Component(final Package owner) {
      method Component (line 514) | public Component(final ParsePackageItemArgs args, final PackageItemI...
      method Component (line 518) | public Component(final ParseComponentArgs args, final ComponentInfo ...
      method Component (line 522) | public Component(final Component<II> clone) {
      method getComponentName (line 526) | public ComponentName getComponentName() {
      method appendComponentShortName (line 530) | public void appendComponentShortName(final StringBuilder sb) {
      method printComponentShortName (line 534) | public void printComponentShortName(final PrintWriter pw) {
      method setPackageName (line 538) | public void setPackageName(final String packageName) {
    class Permission (line 543) | public final static class Permission extends Component<IntentInfo> {
      method Permission (line 548) | public Permission(final Package owner) {
      method Permission (line 553) | public Permission(final Package owner, final PermissionInfo info) {
      method setPackageName (line 558) | @Override
      method toString (line 563) | @Override
    class PermissionGroup (line 569) | public final static class PermissionGroup extends Component<IntentInfo> {
      method PermissionGroup (line 572) | public PermissionGroup(final Package owner) {
      method PermissionGroup (line 577) | public PermissionGroup(final Package owner, final PermissionGroupInf...
      method setPackageName (line 582) | @Override
      method toString (line 587) | @Override
    class Activity (line 593) | public final static class Activity extends Component<ActivityIntentInf...
      method Activity (line 596) | public Activity(final ParseComponentArgs args, final ActivityInfo in...
      method setPackageName (line 601) | @Override
      method toString (line 606) | @Override
    class Service (line 612) | public final static class Service extends Component<ServiceIntentInfo> {
      method Service (line 615) | public Service(final ParseComponentArgs args, final ServiceInfo info) {
      method setPackageName (line 620) | @Override
      method toString (line 625) | @Override
    class Provider (line 631) | public final static class Provider extends Component<ProviderIntentInf...
      method Provider (line 635) | public Provider(final ParseComponentArgs args, final ProviderInfo in...
      method Provider (line 640) | public Provider(final Provider existingProvider) {
      method setPackageName (line 645) | @Override
      method toString (line 650) | @Override
    class Instrumentation (line 656) | public final static class Instrumentation extends Component {
      method Instrumentation (line 659) | public Instrumentation(final ParsePackageItemArgs args, final Instru...
      method setPackageName (line 664) | @Override
      method toString (line 669) | @Override
    class IntentInfo (line 675) | @SuppressLint("ParcelCreator")
    class ActivityIntentInfo (line 686) | @SuppressLint("ParcelCreator")
      method ActivityIntentInfo (line 690) | public ActivityIntentInfo(final Activity activity) {
      method toString (line 694) | @Override
    class ServiceIntentInfo (line 700) | @SuppressLint("ParcelCreator")
      method ServiceIntentInfo (line 704) | public ServiceIntentInfo(final Service service) {
      method toString (line 708) | @Override
    class ProviderIntentInfo (line 714) | @SuppressLint("ParcelCreator")
      method ProviderIntentInfo (line 718) | public ProviderIntentInfo(final Provider provider) {
      method toString (line 722) | @Override
    class PackageParserException (line 728) | public static class PackageParserException extends Exception {
      method PackageParserException (line 730) | public PackageParserException(int error, String detailMessage) {
      method PackageParserException (line 735) | public PackageParserException(int error, String detailMessage, Throw...
    class SigningDetails (line 742) | public static class SigningDetails {

FILE: AndroidStub/src/main/java/android/content/pm/PackageUserState.java
  class PackageUserState (line 8) | public class PackageUserState {
    method PackageUserState (line 25) | public PackageUserState() {
    method PackageUserState (line 29) | public PackageUserState(final PackageUserState o) {

FILE: AndroidStub/src/main/java/android/content/pm/VerifierInfo.java
  class VerifierInfo (line 11) | public class VerifierInfo implements Parcelable{
    method createFromParcel (line 14) | public VerifierInfo createFromParcel(final Parcel source) {
    method newArray (line 18) | public VerifierInfo[] newArray(final int size) {
    method VerifierInfo (line 23) | public VerifierInfo(final String packageName, final PublicKey publicKe...
    method VerifierInfo (line 27) | private VerifierInfo(final Parcel source) {
    method describeContents (line 31) | @Override
    method writeToParcel (line 36) | @Override

FILE: AndroidStub/src/main/java/android/content/res/CompatibilityInfo.java
  class CompatibilityInfo (line 10) | public class CompatibilityInfo implements Parcelable {
    method CompatibilityInfo (line 12) | public CompatibilityInfo(ApplicationInfo appInfo, int screenLayout, in...
    method describeContents (line 17) | @Override
    method writeToParcel (line 22) | @Override
    method createFromParcel (line 29) | @Override
    method newArray (line 34) | @Override

FILE: AndroidStub/src/main/java/android/content/res/Resources.java
  class Resources (line 9) | public class Resources {
    method Resources (line 11) | public Resources(AssetManager assets, DisplayMetrics metrics, Configur...
    method getAssets (line 15) | public final AssetManager getAssets() {
    method getColor (line 19) | public int getColor(int id) throws NotFoundException {
    method getConfiguration (line 23) | public Configuration getConfiguration() {
    method getDisplayMetrics (line 27) | public DisplayMetrics getDisplayMetrics() {
    method getDrawable (line 31) | public Drawable getDrawable(int id) throws NotFoundException {
    method getString (line 35) | public String getString(int id) throws NotFoundException {
    method getText (line 39) | public CharSequence getText(int id) throws NotFoundException {
    method getXml (line 43) | public XmlResourceParser getXml(int id) throws NotFoundException {
    method getImpl (line 47) | public ResourcesImpl getImpl() {
    method newTheme (line 51) | public final Theme newTheme() {
    method updateConfiguration (line 55) | public void updateConfiguration(Configuration config, DisplayMetrics m...
    class Theme (line 59) | public final class Theme {
      method applyStyle (line 61) | public void applyStyle(int resId, boolean force) {
      method obtainStyledAttributes (line 65) | public TypedArray obtainStyledAttributes(int[] attrs) {
      method setTo (line 69) | public void setTo(Theme other) {
    class NotFoundException (line 75) | public static class NotFoundException extends RuntimeException {

FILE: AndroidStub/src/main/java/android/content/res/ResourcesImpl.java
  class ResourcesImpl (line 6) | public class ResourcesImpl {

FILE: AndroidStub/src/main/java/android/content/res/ResourcesKey.java
  class ResourcesKey (line 9) | public final class ResourcesKey {
    method ResourcesKey (line 30) | public ResourcesKey(@Nullable String resDir,

FILE: AndroidStub/src/main/java/android/databinding/DataBinderMapper.java
  class DataBinderMapper (line 23) | class DataBinderMapper {
    method getDataBinder (line 24) | public ViewDataBinding getDataBinder(DataBindingComponent bindingCompo...
    method getDataBinder (line 28) | ViewDataBinding getDataBinder(DataBindingComponent bindingComponent, V...
    method getLayoutId (line 31) | public int getLayoutId(String tag) { return 0; }
    method convertBrIdToString (line 32) | public String convertBrIdToString(int id) {

FILE: AndroidStub/src/main/java/android/databinding/DataBindingComponent.java
  type DataBindingComponent (line 30) | public interface DataBindingComponent {

FILE: AndroidStub/src/main/java/android/os/ServiceManager.java
  class ServiceManager (line 9) | public final class ServiceManager {
    method getService (line 13) | public static IBinder getService(final String name) {
    method addService (line 17) | public static void addService(final String name, final IBinder service) {
    method addService (line 21) | public static void addService(final String name, final IBinder service...
    method checkService (line 25) | public static IBinder checkService(final String name) {
    method listServices (line 29) | public static String[] listServices() throws RemoteException {
    method initServiceCache (line 33) | public static void initServiceCache(final Map<String, IBinder> cache) {

FILE: AndroidStub/src/main/java/android/os/SystemProperties.java
  class SystemProperties (line 6) | public class SystemProperties {
    method get (line 8) | public static String get(final String key) {
    method get (line 12) | public static String get(final String key, final String def) {
    method getInt (line 16) | public static int getInt(final String key, final int def) {
    method getLong (line 20) | public static long getLong(final String key, final long def) {
    method getBoolean (line 24) | public static boolean getBoolean(final String key, final boolean def) {
    method set (line 28) | public static void set(final String key, final String val) {
    method addChangeCallback (line 32) | public static void addChangeCallback(final Runnable callback) {

FILE: AndroidStub/src/main/java/android/util/Singleton.java
  class Singleton (line 6) | public abstract class Singleton<T> {
    method Singleton (line 7) | public Singleton() {
    method create (line 11) | protected abstract T create();
    method get (line 13) | public T get() {

FILE: AndroidStub/src/main/java/com/android/internal/R.java
  class R (line 6) | public final class R {
    class id (line 8) | public static final class id {

FILE: CoreLibrary/src/androidTest/java/com/didi/virtualapk/core/ApplicationTest.java
  class ApplicationTest (line 9) | public class ApplicationTest extends ApplicationTestCase<Application> {
    method ApplicationTest (line 10) | public ApplicationTest() {

FILE: CoreLibrary/src/main/java/android/content/ContentResolverWrapper.java
  class ContentResolverWrapper (line 10) | public abstract class ContentResolverWrapper extends ContentResolver {
    method ContentResolverWrapper (line 14) | public ContentResolverWrapper(Context context) {
    method acquireProvider (line 19) | @Override
    method acquireExistingProvider (line 24) | @Override
    method acquireUnstableProvider (line 29) | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    method releaseProvider (line 35) | @Override
    method releaseUnstableProvider (line 40) | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    method unstableProviderDied (line 46) | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    method appNotRespondingViaProvider (line 52) | @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)

FILE: CoreLibrary/src/main/java/android/databinding/DataBinderMapperProxy.java
  class DataBinderMapperProxy (line 17) | public class DataBinderMapperProxy extends DataBinderMapper implements P...
    method DataBinderMapperProxy (line 23) | public DataBinderMapperProxy(@NonNull Object source) {
    method getDataBinder (line 29) | @Override
    method getDataBinder (line 44) | @Override
    method getLayoutId (line 59) | @Override
    method convertBrIdToString (line 74) | @Override
    method onAddedLoadedPlugin (line 89) | @Override
    method addMapper (line 104) | private void addMapper(DataBinderMapper mapper) {
    method getCache (line 115) | private DataBinderMapper[] getCache() {

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/PluginManager.java
  class PluginManager (line 64) | public class PluginManager {
    method getInstance (line 81) | public static PluginManager getInstance(Context base) {
    method createInstance (line 93) | private static PluginManager createInstance(Context context) {
    method PluginManager (line 123) | protected PluginManager(Context context) {
    method hookCurrentProcess (line 142) | protected void hookCurrentProcess() {
    method init (line 148) | public void init() {
    method doInWorkThread (line 157) | protected void doInWorkThread() {
    method getHostApplication (line 160) | public Application getHostApplication() {
    method createComponentsHandler (line 164) | protected ComponentsHandler createComponentsHandler() {
    method createInstrumentation (line 168) | protected VAInstrumentation createInstrumentation(Instrumentation orig...
    method createActivityManagerProxy (line 172) | protected ActivityManagerProxy createActivityManagerProxy(IActivityMan...
    method createLoadedPlugin (line 176) | protected LoadedPlugin createLoadedPlugin(File apk) throws Exception {
    method hookDataBindingUtil (line 180) | protected void hookDataBindingUtil() {
    method addCallback (line 195) | public void addCallback(Callback callback) {
    method removeCallback (line 207) | public void removeCallback(Callback callback) {
    method hookSystemServices (line 216) | protected void hookSystemServices() {
    method hookInstrumentationAndHandler (line 241) | protected void hookInstrumentationAndHandler() {
    method hookIContentProviderAsNeeded (line 262) | protected void hookIContentProviderAsNeeded() {
    method loadPlugin (line 307) | public void loadPlugin(File apk) throws Exception {
    method getLoadedPlugin (line 332) | public LoadedPlugin getLoadedPlugin(Intent intent) {
    method getLoadedPlugin (line 336) | public LoadedPlugin getLoadedPlugin(ComponentName component) {
    method getLoadedPlugin (line 343) | public LoadedPlugin getLoadedPlugin(String packageName) {
    method getAllLoadedPlugins (line 347) | public List<LoadedPlugin> getAllLoadedPlugins() {
    method getHostContext (line 353) | public Context getHostContext() {
    method getInstrumentation (line 357) | public VAInstrumentation getInstrumentation() {
    method getActivityManager (line 361) | public IActivityManager getActivityManager() {
    method getIContentProvider (line 365) | public synchronized IContentProvider getIContentProvider() {
    method getComponentsHandler (line 373) | public ComponentsHandler getComponentsHandler() {
    method resolveActivity (line 377) | public ResolveInfo resolveActivity(Intent intent) {
    method resolveActivity (line 381) | public ResolveInfo resolveActivity(Intent intent, int flags) {
    method resolveService (line 392) | public ResolveInfo resolveService(Intent intent, int flags) {
    method resolveContentProvider (line 403) | public ProviderInfo resolveContentProvider(String name, int flags) {
    method queryIntentActivities (line 417) | @Deprecated
    method queryIntentServices (line 434) | @Deprecated
    method queryBroadcastReceivers (line 451) | @Deprecated
    type Callback (line 465) | public interface Callback {
      method onAddedLoadedPlugin (line 466) | void onAddedLoadedPlugin(LoadedPlugin plugin);

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/delegate/ActivityManagerProxy.java
  class ActivityManagerProxy (line 45) | public class ActivityManagerProxy implements InvocationHandler {
    method ActivityManagerProxy (line 57) | public ActivityManagerProxy(PluginManager pluginManager, IActivityMana...
    method invoke (line 62) | @Override
    method startService (line 134) | protected Object startService(Object proxy, Method method, Object[] ar...
    method stopService (line 146) | protected Object stopService(Object proxy, Method method, Object[] arg...
    method stopServiceToken (line 158) | protected Object stopServiceToken(Object proxy, Method method, Object[...
    method bindService (line 171) | protected Object bindService(Object proxy, Method method, Object[] arg...
    method unbindService (line 186) | protected Object unbindService(Object proxy, Method method, Object[] a...
    method startDelegateServiceForTarget (line 199) | protected ComponentName startDelegateServiceForTarget(Intent target, S...
    method wrapperTargetIntent (line 204) | protected Intent wrapperTargetIntent(Intent target, ServiceInfo servic...
    method getIntentSender (line 224) | protected void getIntentSender(Method method, Object[] args) {
    method overridePendingTransition (line 245) | protected void overridePendingTransition(Method method, Object[] args) {

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/delegate/IContentProviderProxy.java
  class IContentProviderProxy (line 41) | public class IContentProviderProxy implements InvocationHandler {
    method IContentProviderProxy (line 47) | private IContentProviderProxy(Context context, IContentProvider iConte...
    method newInstance (line 52) | public static IContentProvider newInstance(Context context, IContentPr...
    method invoke (line 57) | @Override
    method wrapperUri (line 69) | private void wrapperUri(Method method, Object[] args) {
    method getBundleParameter (line 111) | private Bundle getBundleParameter(Object[] args) {

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/delegate/LocalService.java
  class LocalService (line 44) | public class LocalService extends Service {
    method onBind (line 62) | @Override
    method onCreate (line 67) | @Override
    method onStartCommand (line 73) | @Override

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/delegate/RemoteContentProvider.java
  class RemoteContentProvider (line 47) | public class RemoteContentProvider extends ContentProvider {
    method onCreate (line 58) | @Override
    method getContentProvider (line 65) | private ContentProvider getContentProvider(final Uri uri) {
    method getType (line 106) | @Override
    method query (line 117) | @Override
    method insert (line 128) | @Override
    method delete (line 139) | @Override
    method update (line 150) | @Override
    method bulkInsert (line 161) | @Override
    method applyBatch (line 172) | @NonNull
    method call (line 196) | @Override
    method getAuthority (line 213) | public static String getAuthority(Context context) {
    method getUri (line 217) | public static String getUri(Context context) {

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/delegate/RemoteService.java
  class RemoteService (line 33) | public class RemoteService extends LocalService {
    method onBind (line 37) | @Override
    method onStartCommand (line 42) | @Override

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/delegate/StubActivity.java
  class StubActivity (line 12) | public class StubActivity extends Activity {
    method onCreate (line 13) | @Override

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/ActivityLifecycleCallbacksProxy.java
  class ActivityLifecycleCallbacksProxy (line 15) | class ActivityLifecycleCallbacksProxy implements Application.ActivityLif...
    method collectActivityLifecycleCallbacks (line 20) | Object[] collectActivityLifecycleCallbacks() {
    method onActivityCreated (line 33) | @Override
    method onActivityStarted (line 44) | @Override
    method onActivityResumed (line 54) | @Override
    method onActivityPaused (line 64) | @Override
    method onActivityStopped (line 74) | @Override
    method onActivitySaveInstanceState (line 84) | @Override
    method onActivityDestroyed (line 95) | @Override

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/ComponentsHandler.java
  class ComponentsHandler (line 38) | public class ComponentsHandler {
    method ComponentsHandler (line 51) | public ComponentsHandler(PluginManager pluginManager) {
    method transformIntentToExplicitAsNeeded (line 59) | public Intent transformIntentToExplicitAsNeeded(Intent intent) {
    method markIntentIfNeeded (line 73) | public void markIntentIfNeeded(Intent intent) {
    method dispatchStubActivity (line 89) | private void dispatchStubActivity(Intent intent) {
    method getServiceCounter (line 106) | public AtomicInteger getServiceCounter(Service service) {
    method getService (line 116) | public Service getService(ComponentName component) {
    method rememberService (line 127) | public void rememberService(ComponentName component, Service service) {
    method forgetService (line 140) | public Service forgetService(ComponentName component) {
    method forgetIServiceConnection (line 154) | public Intent forgetIServiceConnection(IBinder iServiceConnection) {
    method remberIServiceConnection (line 167) | public void remberIServiceConnection(IBinder iServiceConnection, Inten...
    method isServiceAvailable (line 179) | public boolean isServiceAvailable(ComponentName component) {

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/Constants.java
  class Constants (line 22) | public class Constants {

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/LoadedPlugin.java
  class LoadedPlugin (line 76) | public class LoadedPlugin {
    method getDir (line 80) | protected File getDir(Context context, String name) {
    method createClassLoader (line 84) | protected ClassLoader createClassLoader(Context context, File apk, Fil...
    method createAssetManager (line 96) | protected AssetManager createAssetManager(Context context, File apk) t...
    method createResources (line 102) | protected Resources createResources(Context context, String packageNam...
    method createPluginPackageManager (line 112) | protected PluginPackageManager createPluginPackageManager() {
    method createPluginContext (line 116) | public PluginContext createPluginContext(Context context) {
    method chooseBestActivity (line 124) | protected ResolveInfo chooseBestActivity(Intent intent, String s, int ...
    method LoadedPlugin (line 148) | public LoadedPlugin(PluginManager pluginManager, Context context, File...
    method tryToCopyNativeLib (line 239) | protected void tryToCopyNativeLib(File apk) throws Exception {
    method getLocation (line 243) | public String getLocation() {
    method getPackageName (line 247) | public String getPackageName() {
    method getPackageManager (line 251) | public PackageManager getPackageManager() {
    method getAssets (line 255) | public AssetManager getAssets() {
    method getResources (line 259) | public Resources getResources() {
    method updateResources (line 263) | public void updateResources(Resources newResources) {
    method getClassLoader (line 267) | public ClassLoader getClassLoader() {
    method getPluginManager (line 271) | public PluginManager getPluginManager() {
    method getHostContext (line 275) | public Context getHostContext() {
    method getPluginContext (line 279) | public Context getPluginContext() {
    method getApplication (line 283) | public Application getApplication() {
    method invokeApplication (line 287) | public void invokeApplication() throws Exception {
    method getPackageResourcePath (line 309) | public String getPackageResourcePath() {
    method getCodePath (line 315) | public String getCodePath() {
    method getLaunchIntent (line 319) | public Intent getLaunchIntent() {
    method getLeanbackLaunchIntent (line 334) | public Intent getLeanbackLaunchIntent() {
    method getApplicationInfo (line 352) | public ApplicationInfo getApplicationInfo() {
    method getPackageInfo (line 356) | public PackageInfo getPackageInfo() {
    method getActivityInfo (line 360) | public ActivityInfo getActivityInfo(ComponentName componentName) {
    method getServiceInfo (line 364) | public ServiceInfo getServiceInfo(ComponentName componentName) {
    method getReceiverInfo (line 368) | public ActivityInfo getReceiverInfo(ComponentName componentName) {
    method getProviderInfo (line 372) | public ProviderInfo getProviderInfo(ComponentName componentName) {
    method getTheme (line 376) | public Resources.Theme getTheme() {
    method setTheme (line 382) | public void setTheme(int resid) {
    method makeApplication (line 386) | protected Application makeApplication(boolean forceDefaultAppClass, In...
    method resolveActivity (line 403) | public ResolveInfo resolveActivity(Intent intent, int flags) {
    method queryIntentActivities (line 413) | public List<ResolveInfo> queryIntentActivities(Intent intent, int flag...
    method resolveService (line 439) | public ResolveInfo resolveService(Intent intent, int flags) {
    method queryIntentServices (line 449) | public List<ResolveInfo> queryIntentServices(Intent intent, int flags) {
    method queryBroadcastReceivers (line 475) | public List<ResolveInfo> queryBroadcastReceivers(Intent intent, int fl...
    method resolveContentProvider (line 501) | public ProviderInfo resolveContentProvider(String name, int flags) {
    method match (line 505) | protected boolean match(PackageParser.Component component, ComponentNa...
    class PluginPackageManager (line 520) | protected class PluginPackageManager extends PackageManager {
      method getPackageInfo (line 524) | @Override
      method getPackageInfo (line 535) | @TargetApi(Build.VERSION_CODES.O)
      method currentToCanonicalPackageNames (line 547) | @Override
      method canonicalToCurrentPackageNames (line 552) | @Override
      method getLaunchIntentForPackage (line 557) | @Override
      method getLeanbackLaunchIntentForPackage (line 567) | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
      method getPackageGids (line 578) | @Override
      method getPackageGids (line 583) | @TargetApi(Build.VERSION_CODES.N)
      method getPackageUid (line 589) | @TargetApi(Build.VERSION_CODES.N)
      method getPermissionInfo (line 595) | @Override
      method queryPermissionsByGroup (line 600) | @Override
      method getPermissionGroupInfo (line 605) | @Override
      method getAllPermissionGroups (line 610) | @Override
      method getApplicationInfo (line 615) | @Override
      method getActivityInfo (line 625) | @Override
      method getReceiverInfo (line 635) | @Override
      method getServiceInfo (line 645) | @Override
      method getProviderInfo (line 655) | @Override
      method getInstalledPackages (line 665) | @Override
      method getPackagesHoldingPermissions (line 670) | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
      method checkPermission (line 676) | @Override
      method isPermissionRevokedByPolicy (line 681) | @TargetApi(Build.VERSION_CODES.M)
      method addPermission (line 687) | @Override
      method addPermissionAsync (line 692) | @Override
      method removePermission (line 697) | @Override
      method checkSignatures (line 702) | @Override
      method checkSignatures (line 707) | @Override
      method getPackagesForUid (line 712) | @Override
      method getNameForUid (line 717) | @Override
      method getInstalledApplications (line 722) | @Override
      method isInstantApp (line 727) | @TargetApi(Build.VERSION_CODES.O)
      method isInstantApp (line 733) | @TargetApi(Build.VERSION_CODES.O)
      method getInstantAppCookieMaxBytes (line 739) | @TargetApi(Build.VERSION_CODES.O)
      method getInstantAppCookie (line 745) | @TargetApi(Build.VERSION_CODES.O)
      method clearInstantAppCookie (line 752) | @TargetApi(Build.VERSION_CODES.O)
      method updateInstantAppCookie (line 758) | @TargetApi(Build.VERSION_CODES.O)
      method getSystemSharedLibraryNames (line 764) | @Override
      method getSharedLibraries (line 769) | @TargetApi(Build.VERSION_CODES.O)
      method getChangedPackages (line 776) | @TargetApi(Build.VERSION_CODES.O)
      method getSystemAvailableFeatures (line 783) | @Override
      method hasSystemFeature (line 788) | @Override
      method hasSystemFeature (line 793) | @TargetApi(Build.VERSION_CODES.N)
      method resolveActivity (line 799) | @Override
      method queryIntentActivities (line 809) | @Override
      method queryIntentActivityOptions (line 846) | @Override
      method queryBroadcastReceivers (line 851) | @Override
      method resolveService (line 888) | @Override
      method queryIntentServices (line 898) | @Override
      method queryIntentContentProviders (line 935) | @Override
      method resolveContentProvider (line 941) | @Override
      method queryContentProviders (line 951) | @Override
      method getInstrumentationInfo (line 956) | @Override
      method queryInstrumentation (line 966) | @Override
      method getDrawable (line 971) | @Override
      method getActivityIcon (line 981) | @Override
      method getActivityIcon (line 991) | @Override
      method getActivityBanner (line 1002) | @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
      method getActivityBanner (line 1013) | @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
      method getDefaultActivityIcon (line 1025) | @Override
      method getApplicationIcon (line 1030) | @Override
      method getApplicationIcon (line 1040) | @Override
      method getApplicationBanner (line 1050) | @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
      method getApplicationBanner (line 1061) | @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
      method getActivityLogo (line 1072) | @Override
      method getActivityLogo (line 1082) | @Override
      method getApplicationLogo (line 1093) | @Override
      method getApplicationLogo (line 1103) | @Override
      method getUserBadgedIcon (line 1113) | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
      method getUserBadgeForDensity (line 1119) | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
      method getUserBadgedDrawableForDensity (line 1130) | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
      method getUserBadgedLabel (line 1136) | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
      method getText (line 1142) | @Override
      method getXml (line 1152) | @Override
      method getApplicationLabel (line 1162) | @Override
      method getResourcesForActivity (line 1176) | @Override
      method getResourcesForApplication (line 1186) | @Override
      method getResourcesForApplication (line 1196) | @Override
      method verifyPendingInstall (line 1206) | @Override
      method extendVerificationTimeout (line 1211) | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
      method setInstallerPackageName (line 1217) | @Override
      method getInstallerPackageName (line 1227) | @Override
      method addPackageToPreferred (line 1237) | @Override
      method removePackageFromPreferred (line 1242) | @Override
      method getPreferredPackages (line 1247) | @Override
      method addPreferredActivity (line 1252) | @Override
      method clearPackagePreferredActivities (line 1257) | @Override
      method getPreferredActivities (line 1262) | @Override
      method setComponentEnabledSetting (line 1267) | @Override
      method getComponentEnabledSetting (line 1272) | @Override
      method setApplicationEnabledSetting (line 1277) | @Override
      method getApplicationEnabledSetting (line 1282) | @Override
      method isSafeMode (line 1287) | @Override
      method setApplicationCategoryHint (line 1292) | @TargetApi(Build.VERSION_CODES.O)
      method getPackageInstaller (line 1298) | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
      method canRequestPackageInstalls (line 1304) | @TargetApi(Build.VERSION_CODES.O)
      method loadItemIcon (line 1310) | public Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationIn...

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/PluginContentResolver.java
  class PluginContentResolver (line 35) | public class PluginContentResolver extends ContentResolverWrapper {
    method PluginContentResolver (line 38) | public PluginContentResolver(Context context) {
    method acquireProvider (line 43) | @Override
    method acquireExistingProvider (line 51) | @Override
    method acquireUnstableProvider (line 59) | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    method releaseProvider (line 68) | @Override
    method releaseUnstableProvider (line 73) | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    method unstableProviderDied (line 79) | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    method appNotRespondingViaProvider (line 84) | @TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
    method resolveUserIdFromAuthority (line 89) | protected int resolveUserIdFromAuthority(String auth) {
    method wrapperUri (line 93) | @Keep
    method getAuthority (line 105) | @Deprecated
    method getUri (line 110) | @Deprecated
    method getBundleForCall (line 115) | @Keep

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/PluginContext.java
  class PluginContext (line 31) | class PluginContext extends ContextWrapper {
    method PluginContext (line 35) | public PluginContext(LoadedPlugin plugin) {
    method PluginContext (line 40) | public PluginContext(LoadedPlugin plugin, Context base) {
    method getApplicationContext (line 45) | @Override
    method getHostContext (line 55) | private Context getHostContext() {
    method getContentResolver (line 59) | @Override
    method getClassLoader (line 64) | @Override
    method getPackageManager (line 84) | @Override
    method getSystemService (line 89) | @Override
    method getResources (line 101) | @Override
    method getAssets (line 106) | @Override
    method getTheme (line 111) | @Override
    method startActivity (line 116) | @Override

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/ResourcesManager.java
  class ResourcesManager (line 48) | class ResourcesManager {
    method createResources (line 54) | public static synchronized Resources createResources(Context hostConte...
    method createResourcesSimple (line 64) | private static Resources createResourcesSimple(Context hostContext, St...
    method hookResources (line 111) | public static void hookResources(Context base, Resources resources) {
    method createResourcesForN (line 148) | @TargetApi(Build.VERSION_CODES.N)
    method append (line 193) | private static String[] append(String[] paths, String newPath) {
    method contains (line 207) | @TargetApi(Build.VERSION_CODES.KITKAT)
    method isMiUi (line 220) | private static boolean isMiUi(Resources resources) {
    method isVivo (line 224) | private static boolean isVivo(Resources resources) {
    method isNubia (line 228) | private static boolean isNubia(Resources resources) {
    method isNotRawResources (line 232) | private static boolean isNotRawResources(Resources resources) {
    class MiUiResourcesCompat (line 236) | private static final class MiUiResourcesCompat {
      method createResources (line 237) | private static Resources createResources(Resources hostResources, As...
    class VivoResourcesCompat (line 245) | private static final class VivoResourcesCompat {
      method createResources (line 246) | private static Resources createResources(Context hostContext, Resour...
    class NubiaResourcesCompat (line 257) | private static final class NubiaResourcesCompat {
      method createResources (line 258) | private static Resources createResources(Resources hostResources, As...
    class AdaptationResourcesCompat (line 266) | private static final class AdaptationResourcesCompat {
      method createResources (line 267) | private static Resources createResources(Resources hostResources, As...
    class ResourcesManagerCompatForN (line 281) | private static final class ResourcesManagerCompatForN {
      method resolveResourcesImplMap (line 283) | @TargetApi(Build.VERSION_CODES.KITKAT)
    class ResourcesManagerCompatForP (line 302) | private static final class ResourcesManagerCompatForP {
      method resolveResourcesImplMap (line 304) | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/StubActivityInfo.java
  class StubActivityInfo (line 29) | class StubActivityInfo {
    method getStubActivity (line 48) | public String getStubActivity(String className, int launchMode, Theme ...

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/VAInstrumentation.java
  class VAInstrumentation (line 51) | public class VAInstrumentation extends Instrumentation implements Handle...
    method VAInstrumentation (line 61) | public VAInstrumentation(PluginManager pluginManager, Instrumentation ...
    method execStartActivity (line 66) | @Override
    method execStartActivity (line 72) | @Override
    method execStartActivity (line 78) | @Override
    method execStartActivity (line 84) | @Override
    method injectIntent (line 90) | protected void injectIntent(Intent intent) {
    method newActivity (line 100) | @Override
    method newApplication (line 148) | @Override
    method callActivityOnCreate (line 153) | @Override
    method callActivityOnCreate (line 159) | @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    method injectActivity (line 166) | protected void injectActivity(Activity activity) {
    method handleMessage (line 195) | @Override
    method getContext (line 221) | @Override
    method getTargetContext (line 226) | @Override
    method getComponentName (line 231) | @Override
    method newActivity (line 236) | protected Activity newActivity(Activity activity) {
    method getActivities (line 248) | List<WeakReference<Activity>> getActivities() {

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/utils/DexUtil.java
  class DexUtil (line 33) | public class DexUtil {
    method insertDex (line 36) | public static void insertDex(DexClassLoader dexClassLoader, ClassLoade...
    method getDexElements (line 46) | private static Object getDexElements(Object pathList) throws Exception {
    method getPathList (line 50) | private static Object getPathList(ClassLoader baseDexClassLoader) thro...
    method combineArray (line 54) | private static Object combineArray(Object firstArray, Object secondArr...
    method insertNativeLibrary (line 64) | private static synchronized void insertNativeLibrary(DexClassLoader de...

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/utils/PackageParserCompat.java
  class PackageParserCompat (line 30) | public final class PackageParserCompat {
    method parsePackage (line 32) | public static final PackageParser.Package parsePackage(final Context c...
    class PackageParserPPreview (line 50) | private static final class PackageParserPPreview {
      method parsePackage (line 52) | static final PackageParser.Package parsePackage(Context context, Fil...
    class PackageParserV24 (line 62) | private static final class PackageParserV24 {
      method parsePackage (line 64) | static final PackageParser.Package parsePackage(Context context, Fil...
    class PackageParserLollipop (line 74) | private static final class PackageParserLollipop {
      method parsePackage (line 76) | static final PackageParser.Package parsePackage(final Context contex...
    class PackageParserLegacy (line 85) | private static final class PackageParserLegacy {
      method parsePackage (line 87) | static final PackageParser.Package parsePackage(Context context, Fil...

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/utils/PluginUtil.java
  class PluginUtil (line 53) | public class PluginUtil {
    method getComponent (line 57) | public static ComponentName getComponent(Intent intent) {
    method isIntentFromPlugin (line 69) | public static boolean isIntentFromPlugin(Intent intent) {
    method getTheme (line 76) | public static int getTheme(Context context, Intent intent) {
    method getTheme (line 80) | public static int getTheme(Context context, ComponentName component) {
    method selectDefaultTheme (line 104) | public static int selectDefaultTheme(final int curTheme, final int tar...
    method selectSystemTheme (line 112) | public static int selectSystemTheme(final int curTheme, final int targ...
    method hookActivityResources (line 132) | public static void hookActivityResources(Activity activity, String pac...
    method isLocalService (line 161) | public static final boolean isLocalService(final ServiceInfo serviceIn...
    method isVivo (line 165) | public static boolean isVivo(Resources resources) {
    method putBinder (line 169) | public static void putBinder(Bundle bundle, String key, IBinder value) {
    method getBinder (line 177) | public static IBinder getBinder(Bundle bundle, String key) {
    method copyNativeLib (line 189) | public static void copyNativeLib(File apk, Context context, PackageInf...
    method findAndCopyNativeLib (line 215) | private static boolean findAndCopyNativeLib(ZipFile zipfile, Context c...
    method copySo (line 273) | private static void copySo(byte[] buffer, InputStream input, OutputStr...

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/internal/utils/Settings.java
  class Settings (line 25) | public class Settings {
    method setSoVersion (line 29) | public static void setSoVersion(Context context, String name, int vers...
    method getSoVersion (line 36) | public static int getSoVersion(Context context, String name) {

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/utils/Reflector.java
  class Reflector (line 19) | public class Reflector {
    class ReflectedException (line 29) | public static class ReflectedException extends Exception {
      method ReflectedException (line 31) | public ReflectedException(String message) {
      method ReflectedException (line 34) | public ReflectedException(String message, Throwable cause) {
    method on (line 39) | public static Reflector on(@NonNull String name) throws ReflectedExcep...
    method on (line 43) | public static Reflector on(@NonNull String name, boolean initialize) t...
    method on (line 47) | public static Reflector on(@NonNull String name, boolean initialize, @...
    method on (line 55) | public static Reflector on(@NonNull Class<?> type) {
    method with (line 61) | public static Reflector with(@NonNull Object caller) throws ReflectedE...
    method Reflector (line 65) | protected Reflector() {
    method constructor (line 69) | public Reflector constructor(@Nullable Class<?>... parameterTypes) thr...
    method newInstance (line 81) | @SuppressWarnings("unchecked")
    method checked (line 95) | protected Object checked(@Nullable Object caller) throws ReflectedExce...
    method check (line 102) | protected void check(@Nullable Object caller, @Nullable Member member,...
    method bind (line 112) | public Reflector bind(@Nullable Object caller) throws ReflectedExcepti...
    method unbind (line 117) | public Reflector unbind() {
    method field (line 122) | public Reflector field(@NonNull String name) throws ReflectedException {
    method findField (line 134) | protected Field findField(@NonNull String name) throws NoSuchFieldExce...
    method get (line 149) | @SuppressWarnings("unchecked")
    method get (line 154) | @SuppressWarnings("unchecked")
    method set (line 164) | public Reflector set(@Nullable Object value) throws ReflectedException {
    method set (line 168) | public Reflector set(@Nullable Object caller, @Nullable Object value) ...
    method method (line 178) | public Reflector method(@NonNull String name, @Nullable Class<?>... pa...
    method findMethod (line 190) | protected Method findMethod(@NonNull String name, @Nullable Class<?>.....
    method call (line 205) | public <R> R call(@Nullable Object... args) throws ReflectedException {
    method callByCaller (line 209) | @SuppressWarnings("unchecked")
    class QuietReflector (line 221) | public static class QuietReflector extends Reflector {
      method on (line 225) | public static QuietReflector on(@NonNull String name) {
      method on (line 229) | public static QuietReflector on(@NonNull String name, boolean initia...
      method on (line 233) | public static QuietReflector on(@NonNull String name, boolean initia...
      method on (line 244) | public static QuietReflector on(@Nullable Class<?> type) {
      method on (line 248) | private static QuietReflector on(@Nullable Class<?> type, @Nullable ...
      method with (line 255) | public static QuietReflector with(@Nullable Object caller) {
      method QuietReflector (line 262) | protected QuietReflector() {
      method getIgnored (line 266) | public Throwable getIgnored() {
      method skip (line 270) | protected boolean skip() {
      method skipAlways (line 274) | protected boolean skipAlways() {
      method constructor (line 278) | @Override
      method newInstance (line 293) | @Override
      method bind (line 308) | @Override
      method unbind (line 323) | @Override
      method field (line 329) | @Override
      method get (line 344) | @Override
      method get (line 359) | @Override
      method set (line 374) | @Override
      method set (line 389) | @Override
      method method (line 404) | @Override
      method call (line 419) | @Override
      method callByCaller (line 434) | @Override

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/utils/RunUtil.java
  class RunUtil (line 38) | public class RunUtil {
    method runOnUiThread (line 48) | public static void runOnUiThread(Runnable runnable) {
    method runOnUiThread (line 57) | public static void runOnUiThread(Runnable runnable, boolean waitUtilDo...
    method getThreadPool (line 78) | public static Executor getThreadPool() {
    method getProcessNameByPid (line 82) | private static String getProcessNameByPid(Context context, int pid) {
    method isMainProcess (line 101) | public static boolean isMainProcess(Context context) {
    method getHandler (line 110) | private static Handler getHandler() {
    class InternalHandler (line 119) | private static class InternalHandler extends Handler {
      method InternalHandler (line 120) | public InternalHandler() {
      method handleMessage (line 124) | @Override

FILE: CoreLibrary/src/main/java/com/didi/virtualapk/utils/ZipVerifyUtil.java
  class ZipVerifyUtil (line 49) | public class ZipVerifyUtil {
    method verifyZip (line 51) | public static boolean verifyZip(Context context, String zipPath) {
    method verifyZip (line 55) | public static boolean verifyZip(Context context, String zipPath, Strin...
    method verifyZip (line 68) | public static boolean verifyZip(String zipPath, Certificate remoteCert...
    method getCertificateFromZip (line 80) | public static Certificate getCertificateFromZip(String zipPath, String...
    method checkZipFileForCertificate (line 90) | public static String checkZipFileForCertificate(String zipPath) throws...
    method getCertificate (line 142) | public static Certificate getCertificate(String certificatePath) throw...
    method decode (line 150) | private static byte[] decode(String base64) throws Exception {

FILE: CoreLibrary/src/test/java/com/didi/virtualapk/core/ExampleUnitTest.java
  class ExampleUnitTest (line 10) | public class ExampleUnitTest {
    method addition_isCorrect (line 11) | @Test

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/MainActivity.java
  class MainActivity (line 23) | public class MainActivity extends Activity {
    method onCreate (line 27) | @Override
    method onResume (line 46) | @Override
    method persistToFile (line 54) | private void persistToFile() {

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/MyApplication.java
  class MyApplication (line 9) | public class MyApplication extends Application {
    method onCreate (line 13) | @Override
    method doWorkInBackground (line 28) | private void doWorkInBackground() {

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/SecondActivity.java
  class SecondActivity (line 20) | public class SecondActivity extends Activity {
    method onCreate (line 23) | @Override
    method onNewIntent (line 40) | @Override
    method onResume (line 46) | @Override
    method recoverFromFile (line 55) | private void recoverFromFile() {

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/ThirdActivity.java
  class ThirdActivity (line 12) | public class ThirdActivity extends Activity {
    method onCreate (line 15) | @Override
    method onStart (line 33) | @Override
    method onResume (line 40) | @Override
    method onSaveInstanceState (line 47) | @Override
    method onRestoreInstanceState (line 53) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/aidl/Book.java
  class Book (line 6) | public class Book implements Parcelable {
    method Book (line 11) | public Book() {
    method Book (line 15) | public Book(int bookId, String bookName) {
    method describeContents (line 20) | public int describeContents() {
    method writeToParcel (line 24) | public void writeToParcel(Parcel out, int flags) {
    method createFromParcel (line 30) | public Book createFromParcel(Parcel in) {
    method newArray (line 34) | public Book[] newArray(int size) {
    method Book (line 39) | private Book(Parcel in) {
    method toString (line 44) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/aidl/BookManagerActivity.java
  class BookManagerActivity (line 22) | public class BookManagerActivity extends AppCompatActivity {
    method handleMessage (line 32) | @Override
    method binderDied (line 46) | @Override
    method onServiceConnected (line 58) | public void onServiceConnected(ComponentName className, IBinder servic...
    method onServiceDisconnected (line 78) | public void onServiceDisconnected(ComponentName className) {
    method onNewBookArrived (line 86) | @Override
    method onCreate (line 93) | @Override
    method onButton1Click (line 102) | public void onButton1Click(View view) {
    method onDestroy (line 121) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/aidl/BookManagerService.java
  class BookManagerService (line 17) | public class BookManagerService extends Service {
    method getBookList (line 31) | @Override
    method addBook (line 37) | @Override
    method onTransact (line 42) | public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
    method registerListener (line 64) | @Override
    method unregisterListener (line 74) | @Override
    method onCreate (line 91) | @Override
    method onBind (line 99) | @Override
    method onDestroy (line 104) | @Override
    method onNewBookArrived (line 110) | private void onNewBookArrived(Book book) throws RemoteException {
    class ServiceWorker (line 126) | private class ServiceWorker implements Runnable {
      method run (line 127) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/binderpool/BinderPool.java
  class BinderPool (line 13) | public class BinderPool {
    method BinderPool (line 24) | private BinderPool(Context context) {
    method getInsance (line 29) | public static BinderPool getInsance(Context context) {
    method connectBinderPoolService (line 40) | private synchronized void connectBinderPoolService() {
    method queryBinder (line 60) | public IBinder queryBinder(int binderCode) {
    method onServiceDisconnected (line 74) | @Override
    method onServiceConnected (line 79) | @Override
    method binderDied (line 92) | @Override
    class BinderPoolImpl (line 101) | public static class BinderPoolImpl extends IBinderPool.Stub {
      method BinderPoolImpl (line 103) | public BinderPoolImpl() {
      method queryBinder (line 107) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/binderpool/BinderPoolActivity.java
  class BinderPoolActivity (line 10) | public class BinderPoolActivity extends Activity {
    method onCreate (line 16) | @Override
    method doWork (line 29) | private void doWork() {

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/binderpool/BinderPoolService.java
  class BinderPoolService (line 9) | public class BinderPoolService extends Service {
    method onCreate (line 15) | @Override
    method onBind (line 20) | @Override
    method onDestroy (line 26) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/binderpool/ComputeImpl.java
  class ComputeImpl (line 5) | public class ComputeImpl extends ICompute.Stub {
    method add (line 7) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/binderpool/SecurityCenterImpl.java
  class SecurityCenterImpl (line 5) | public class SecurityCenterImpl extends ISecurityCenter.Stub {
    method encrypt (line 9) | @Override
    method decrypt (line 18) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/manager/BookManager.java
  class BookManager (line 7) | public class BookManager {
    method binderDied (line 12) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/manager/UserManager.java
  class UserManager (line 3) | public class UserManager {

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/manualbinder/Book.java
  class Book (line 6) | public class Book implements Parcelable {
    method Book (line 11) | public Book() {
    method Book (line 15) | public Book(int bookId, String bookName) {
    method describeContents (line 20) | public int describeContents() {
    method writeToParcel (line 24) | public void writeToParcel(Parcel out, int flags) {
    method createFromParcel (line 30) | public Book createFromParcel(Parcel in) {
    method newArray (line 34) | public Book[] newArray(int size) {
    method Book (line 39) | private Book(Parcel in) {

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/manualbinder/BookManagerImpl.java
  class BookManagerImpl (line 10) | public class BookManagerImpl extends Binder implements IBookManager {
    method BookManagerImpl (line 13) | public BookManagerImpl() {
    method asInterface (line 21) | public static IBookManager asInterface(IBinder obj) {
    method asBinder (line 32) | @Override
    method onTransact (line 37) | @Override
    method getBookList (line 68) | @Override
    method addBook (line 74) | @Override
    class Proxy (line 79) | private static class Proxy implements IBookManager {
      method Proxy (line 82) | Proxy(IBinder remote) {
      method asBinder (line 86) | @Override
      method getInterfaceDescriptor (line 91) | public java.lang.String getInterfaceDescriptor() {
      method getBookList (line 95) | @Override
      method addBook (line 112) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/manualbinder/IBookManager.java
  type IBookManager (line 9) | public interface IBookManager extends IInterface {
    method getBookList (line 16) | public List<Book> getBookList() throws RemoteException;
    method addBook (line 18) | public void addBook(Book book) throws RemoteException;

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/messenger/MessengerActivity.java
  class MessengerActivity (line 20) | public class MessengerActivity extends Activity {
    class MessengerHandler (line 27) | private static class MessengerHandler extends Handler {
      method handleMessage (line 28) | @Override
    method onServiceConnected (line 41) | public void onServiceConnected(ComponentName className, IBinder servic...
    method onServiceDisconnected (line 56) | public void onServiceDisconnected(ComponentName className) {
    method onCreate (line 60) | @Override
    method onDestroy (line 68) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/messenger/MessengerService.java
  class MessengerService (line 15) | public class MessengerService extends Service {
    class MessengerHandler (line 19) | private static class MessengerHandler extends Handler {
      method handleMessage (line 20) | @Override
    method onBind (line 44) | @Override
    method onCreate (line 49) | @Override
    method onStartCommand (line 54) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/model/User.java
  class User (line 10) | public class User implements Parcelable, Serializable {
    method User (line 19) | public User() {
    method User (line 22) | public User(int userId, String userName, boolean isMale) {
    method describeContents (line 28) | public int describeContents() {
    method writeToParcel (line 32) | public void writeToParcel(Parcel out, int flags) {
    method createFromParcel (line 40) | public User createFromParcel(Parcel in) {
    method newArray (line 44) | public User[] newArray(int size) {
    method User (line 49) | private User(Parcel in) {
    method toString (line 57) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/provider/BookProvider.java
  class BookProvider (line 12) | public class BookProvider extends ContentProvider {
    method onCreate (line 36) | @Override
    method initProviderData (line 45) | private void initProviderData() {
    method query (line 56) | @Override
    method getType (line 67) | @Override
    method insert (line 73) | @Override
    method delete (line 85) | @Override
    method update (line 99) | @Override
    method getTableName (line 114) | private String getTableName(Uri uri) {

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/provider/DbOpenHelper.java
  class DbOpenHelper (line 7) | public class DbOpenHelper extends SQLiteOpenHelper {
    method DbOpenHelper (line 22) | public DbOpenHelper(Context context) {
    method onCreate (line 26) | @Override
    method onUpgrade (line 32) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/provider/ProviderActivity.java
  class ProviderActivity (line 14) | public class ProviderActivity extends Activity {
    method onCreate (line 17) | @Override

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/socket/TCPClientActivity.java
  class TCPClientActivity (line 26) | public class TCPClientActivity extends FragmentActivity implements OnCli...
    method handleMessage (line 40) | @Override
    method onCreate (line 58) | @Override
    method onDestroy (line 76) | @Override
    method onClick (line 89) | @Override
    method formatDateTime (line 109) | @SuppressLint("SimpleDateFormat")
    method connectTCPServer (line 114) | private void connectTCPServer() {

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/socket/TCPServerService.java
  class TCPServerService (line 19) | public class TCPServerService extends Service {
    method onCreate (line 30) | @Override
    method onBind (line 36) | @Override
    method onDestroy (line 41) | @Override
    class TcpServer (line 47) | private class TcpServer implements Runnable {
      method run (line 49) | @SuppressWarnings("resource")
    method responseClient (line 84) | private void responseClient(Socket client) throws IOException {

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/utils/MyConstants.java
  class MyConstants (line 5) | public class MyConstants {

FILE: PluginDemo/app/src/main/java/com/didi/virtualapk/demo/utils/MyUtils.java
  class MyUtils (line 11) | public class MyUtils {
    method getProcessName (line 13) | public static String getProcessName(Context cxt, int pid) {
    method close (line 28) | public static void close(Closeable closeable) {
    method executeInThread (line 38) | public static void executeInThread(Runnable runnable) {

FILE: app/src/androidTest/java/com/didi/virtualapk/ApplicationTest.java
  class ApplicationTest (line 9) | public class ApplicationTest extends ApplicationTestCase<Application> {
    method ApplicationTest (line 10) | public ApplicationTest() {

FILE: app/src/main/java/com/didi/virtualapk/MainActivity.java
  class MainActivity (line 29) | public class MainActivity extends AppCompatActivity {
    method onCreate (line 35) | @Override
    method onRequestPermissionsResult (line 59) | @Override
    method hasPermission (line 73) | private boolean hasPermission() {
    method requestPermission (line 82) | private void requestPermission() {
    method onButtonClick (line 92) | public void onButtonClick(View v) {
    method loadPlugin (line 130) | private void loadPlugin(Context base) {
    method showAbout (line 165) | private void showAbout() {

FILE: app/src/main/java/com/didi/virtualapk/VAApplication.java
  class VAApplication (line 10) | public class VAApplication extends Application {
    method attachBaseContext (line 12) | @Override
    method onCreate (line 20) | @Override

FILE: app/src/test/java/com/didi/virtualapk/ExampleUnitTest.java
  class ExampleUnitTest (line 10) | public class ExampleUnitTest {
    method addition_isCorrect (line 11) | @Test

FILE: virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/utils/PackagingUtils.java
  class PackagingUtils (line 34) | public class PackagingUtils {
    method checkFolderForPackaging (line 43) | public static boolean checkFolderForPackaging(@NonNull String folderNa...
    method checkFileForPackaging (line 56) | public static boolean checkFileForPackaging(@NonNull String fileName, ...
    method checkFileForPackaging (line 71) | public static boolean checkFileForPackaging(@NonNull String fileName) {
    method checkFileForPackaging (line 82) | public static boolean checkFileForPackaging(
    method checkFileForPackaging (line 98) | public static boolean checkFileForPackaging(
    method isOfNonResourcesExtensions (line 107) | private static boolean isOfNonResourcesExtensions(
    method isNotAResourceFile (line 119) | private static boolean isNotAResourceFile(@NonNull String fileName) {
    method computeApplicationHash (line 182) | public static long computeApplicationHash(@NonNull File projectDir) {

FILE: virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/utils/Reflect.java
  class Reflect (line 49) | public class Reflect {
    method on (line 65) | public static Reflect on(String name) throws ReflectException {
    method on (line 82) | public static Reflect on(String name, ClassLoader classLoader) throws ...
    method on (line 96) | public static Reflect on(Class<?> clazz) {
    method on (line 109) | public static Reflect on(Object object) {
    method on (line 113) | private static Reflect on(Class<?> type, Object object) {
    method accessible (line 126) | public static <T extends AccessibleObject> T accessible(T accessible) {
    method Reflect (line 183) | private Reflect(Class<?> type) {
    method Reflect (line 187) | private Reflect(Class<?> type, Object object) {
    method get (line 201) | @SuppressWarnings("unchecked")
    method set (line 233) | public Reflect set(String name, Object value) throws ReflectException {
    method get (line 265) | public <T> T get(String name) throws ReflectException {
    method field (line 281) | public Reflect field(String name) throws ReflectException {
    method field0 (line 291) | private Field field0(String name) throws ReflectException {
    method fields (line 330) | public Map<String, Reflect> fields() {
    method call (line 364) | public Reflect call(String name) throws ReflectException {
    method call (line 405) | public Reflect call(String name, Object... args) throws ReflectExcepti...
    method exactMethod (line 434) | private Method exactMethod(String name, Class<?>[] types) throws NoSuc...
    method similarMethod (line 466) | private Method similarMethod(String name, Class<?>[] types) throws NoS...
    method isSimilarSignature (line 496) | private boolean isSimilarSignature(Method possiblyMatchingMethod, Stri...
    method create (line 510) | public Reflect create() throws ReflectException {
    method create (line 540) | public Reflect create(Object... args) throws ReflectException {
    method as (line 570) | @SuppressWarnings("unchecked")
    method property (line 623) | private static String property(String string) {
    method match (line 645) | private boolean match(Class<?>[] declaredTypes, Class<?>[] actualTypes) {
    method hashCode (line 667) | @Override
    method equals (line 675) | @Override
    method toString (line 687) | @Override
    method on (line 699) | private static Reflect on(Constructor<?> constructor, Object... args) ...
    method on (line 711) | private static Reflect on(Method method, Object object, Object... args...
    method unwrap (line 731) | private static Object unwrap(Object object) {
    method types (line 744) | private static Class<?>[] types(Object... values) {
    method forName (line 764) | private static Class<?> forName(String name) throws ReflectException {
    method forName (line 773) | private static Class<?> forName(String name, ClassLoader classLoader) ...
    method type (line 787) | public Class<?> type() {
    method wrapper (line 795) | public static Class<?> wrapper(Class<?> type) {
    class NULL (line 832) | private static class NULL {}
    class ReflectException (line 851) | public static class ReflectException extends RuntimeException {
      method ReflectException (line 858) | public ReflectException(String message) {
      method ReflectException (line 862) | public ReflectException(String message, Throwable cause) {
      method ReflectException (line 866) | public ReflectException() {
      method ReflectException (line 870) | public ReflectException(Throwable cause) {

FILE: virtualapk-gradle-plugin/src/main/java/com/didi/virtualapk/databinding/annotationprocessor/ProcessDataBinding.java
  class ProcessDataBinding (line 42) | @SupportedAnnotationTypes({
    method process (line 63) | @Override
    method readDataBinderMapper (line 78) | private void readDataBinderMapper() {
    method closeSafely (line 116) | private static void closeSafely(Closeable closeable) {
    method getSupportedSourceVersion (line 126) | @Override
    method init (line 131) | @Override

FILE: virtualapk-gradle-plugin/src/main/java/com/didi/virtualapk/utils/Log.java
  class Log (line 3) | public final class Log {
    method Log (line 5) | private Log() {
    method i (line 9) | public static int i(String tag, String msg) {
    method e (line 14) | public static int e(String tag, String msg) {
Condensed preview — 211 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (699K chars).
[
  {
    "path": ".gitignore",
    "chars": 553,
    "preview": "# Generated by MacOSX\n.DS_Store\n\n# Generated by VIM\n.*.swp\n\n# Generated by IntelliJ\n.idea/\n*.iml\n/*/*.iml\n/*/*/*.iml\n\n# "
  },
  {
    "path": "AndroidStub/README.md",
    "chars": 117,
    "preview": "# Android Framework Stub\n\n该库主要是针对在 app 中无法直接调用 Android Framework 中很多隐藏的 API 而创造的一系列 stub 类用来欺骗编译器,从而避免了使用反射去调用造成性能损失\n"
  },
  {
    "path": "AndroidStub/build.gradle",
    "chars": 1855,
    "preview": "group = 'com.didichuxing.foundation'\nversion = '0.0.5'\n\napply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVer"
  },
  {
    "path": "AndroidStub/gradle.properties",
    "chars": 103,
    "preview": "MAVEN_RELEASES_REPOSITORY_URL=\nMAVEN_SNAPSHOTS_REPOSITORY_URL=\nMAVEN_USERNAME=test\nMAVEN_PASSWORD=test\n"
  },
  {
    "path": "AndroidStub/proguard-rules.pro",
    "chars": 665,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
  },
  {
    "path": "AndroidStub/src/main/AndroidManifest.xml",
    "chars": 126,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"android\">\n\n    <application />\n\n</mani"
  },
  {
    "path": "AndroidStub/src/main/aidl/android/app/IActivityManager.aidl",
    "chars": 1655,
    "preview": "package android.app;\n\nimport android.app.IApplicationThread;\nimport android.app.IServiceConnection;\nimport android.conte"
  },
  {
    "path": "AndroidStub/src/main/aidl/android/app/IApplicationThread.aidl",
    "chars": 55,
    "preview": "package android.app;\n\ninterface IApplicationThread {\n}\n"
  },
  {
    "path": "AndroidStub/src/main/aidl/android/app/INotificationManager.aidl",
    "chars": 1310,
    "preview": "/*\n * Copyright 2007, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License"
  },
  {
    "path": "AndroidStub/src/main/aidl/android/app/IServiceConnection.aidl",
    "chars": 958,
    "preview": "/* //device/java/android/android/app/IServiceConnection.aidl\n**\n** Copyright 2007, The Android Open Source Project\n**\n**"
  },
  {
    "path": "AndroidStub/src/main/aidl/android/content/IIntentReceiver.aidl",
    "chars": 1081,
    "preview": "/*\n * Copyright (C) 2006 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
  },
  {
    "path": "AndroidStub/src/main/aidl/android/content/IIntentSender.aidl",
    "chars": 925,
    "preview": "/*\n * Copyright (C) 2006 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
  },
  {
    "path": "AndroidStub/src/main/java/android/app/ActivityManagerNative.java",
    "chars": 792,
    "preview": "package android.app;\n\nimport android.content.Intent;\nimport android.os.Binder;\nimport android.os.IBinder;\n\n/**\n * @autho"
  },
  {
    "path": "AndroidStub/src/main/java/android/app/ActivityThread.java",
    "chars": 1728,
    "preview": "package android.app;\n\nimport android.content.Intent;\nimport android.content.pm.ActivityInfo;\nimport android.os.Handler;\n"
  },
  {
    "path": "AndroidStub/src/main/java/android/app/ApplicationThreadNative.java",
    "chars": 300,
    "preview": "package android.app;\n\nimport android.os.Binder;\nimport android.os.IBinder;\n\n/**\n * @author johnsonlee\n */\npublic abstrac"
  },
  {
    "path": "AndroidStub/src/main/java/android/app/Instrumentation.java",
    "chars": 2465,
    "preview": "package android.app;\n\nimport android.content.ComponentName;\nimport android.content.Context;\nimport android.content.Inten"
  },
  {
    "path": "AndroidStub/src/main/java/android/app/LoadedApk.java",
    "chars": 2006,
    "preview": "package android.app;\n\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.I"
  },
  {
    "path": "AndroidStub/src/main/java/android/app/ResourcesManager.java",
    "chars": 350,
    "preview": "package android.app;\n\n/**\n * Created by qiaopu on 2018/4/25.\n */\npublic class ResourcesManager {\n    \n    public static "
  },
  {
    "path": "AndroidStub/src/main/java/android/content/ContentResolver.java",
    "chars": 1223,
    "preview": "package android.content;\n\nimport android.net.Uri;\nimport android.os.Bundle;\nimport android.support.annotation.NonNull;\ni"
  },
  {
    "path": "AndroidStub/src/main/java/android/content/IContentProvider.java",
    "chars": 804,
    "preview": "/*\n * Copyright (C) 2006 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
  },
  {
    "path": "AndroidStub/src/main/java/android/content/pm/ManifestDigest.java",
    "chars": 1406,
    "preview": "package android.content.pm;\n\nimport android.os.Parcel;\nimport android.os.Parcelable;\n\nimport java.util.jar.Attributes;\n\n"
  },
  {
    "path": "AndroidStub/src/main/java/android/content/pm/PackageParser.java",
    "chars": 25946,
    "preview": "package android.content.pm;\n\nimport android.annotation.SuppressLint;\nimport android.content.ComponentName;\nimport androi"
  },
  {
    "path": "AndroidStub/src/main/java/android/content/pm/PackageUserState.java",
    "chars": 749,
    "preview": "package android.content.pm;\n\nimport android.util.ArraySet;\n\n/**\n * @author johnsonlee\n */\npublic class PackageUserState "
  },
  {
    "path": "AndroidStub/src/main/java/android/content/pm/VerifierInfo.java",
    "chars": 1017,
    "preview": "package android.content.pm;\n\nimport android.os.Parcel;\nimport android.os.Parcelable;\n\nimport java.security.PublicKey;\n\n/"
  },
  {
    "path": "AndroidStub/src/main/java/android/content/res/CompatibilityInfo.java",
    "chars": 1079,
    "preview": "package android.content.res;\n\nimport android.content.pm.ApplicationInfo;\nimport android.os.Parcel;\nimport android.os.Par"
  },
  {
    "path": "AndroidStub/src/main/java/android/content/res/Resources.java",
    "chars": 2061,
    "preview": "package android.content.res;\n\nimport android.graphics.drawable.Drawable;\nimport android.util.DisplayMetrics;\n\n/**\n * Cre"
  },
  {
    "path": "AndroidStub/src/main/java/android/content/res/ResourcesImpl.java",
    "chars": 105,
    "preview": "package android.content.res;\n\n/**\n * Created by qiaopu on 2018/5/18.\n */\npublic class ResourcesImpl {\n\n}\n"
  },
  {
    "path": "AndroidStub/src/main/java/android/content/res/ResourcesKey.java",
    "chars": 1039,
    "preview": "package android.content.res;\n\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\n\n/*"
  },
  {
    "path": "AndroidStub/src/main/java/android/databinding/DataBinderMapper.java",
    "chars": 1406,
    "preview": "/*\n * Copyright (C) 2014 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
  },
  {
    "path": "AndroidStub/src/main/java/android/databinding/DataBindingComponent.java",
    "chars": 1415,
    "preview": "/*\n * Copyright (C) 2015 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
  },
  {
    "path": "AndroidStub/src/main/java/android/os/ServiceManager.java",
    "chars": 983,
    "preview": "package android.os;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/**\n * @author johnsonlee\n */\npublic final class S"
  },
  {
    "path": "AndroidStub/src/main/java/android/os/SystemProperties.java",
    "chars": 905,
    "preview": "package android.os;\n\n/**\n * @author johnsonlee\n */\npublic class SystemProperties {\n\n    public static String get(final S"
  },
  {
    "path": "AndroidStub/src/main/java/android/util/Singleton.java",
    "chars": 277,
    "preview": "package android.util;\n\n/**\n * @author johnsonlee\n */\npublic abstract class Singleton<T> {\n    public Singleton() {\n     "
  },
  {
    "path": "AndroidStub/src/main/java/com/android/internal/R.java",
    "chars": 1323,
    "preview": "package com.android.internal;\n\n/**\n * @author johnsonlee\n */\npublic final class R {\n\n    public static final class id {\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 938,
    "preview": "# Contribution Guideline\n\nThanks for considering to contribute this project. All issues and pull requests are highly app"
  },
  {
    "path": "CoreLibrary/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "CoreLibrary/build.gradle",
    "chars": 1805,
    "preview": "import com.android.build.gradle.api.ApplicationVariant\nimport com.android.build.gradle.api.LibraryVariant\nimport com.goo"
  },
  {
    "path": "CoreLibrary/gradle.properties",
    "chars": 1,
    "preview": "\n"
  },
  {
    "path": "CoreLibrary/proguard-rules.pro",
    "chars": 662,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
  },
  {
    "path": "CoreLibrary/src/androidTest/java/com/didi/virtualapk/core/ApplicationTest.java",
    "chars": 355,
    "preview": "package com.didi.virtualapk.core;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a h"
  },
  {
    "path": "CoreLibrary/src/main/AndroidManifest.xml",
    "chars": 4176,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.didi.virtualapk.core\">\n\n    <uses-"
  },
  {
    "path": "CoreLibrary/src/main/java/android/content/ContentResolverWrapper.java",
    "chars": 1680,
    "preview": "package android.content;\n\nimport android.annotation.TargetApi;\nimport android.os.Build;\n\n/**\n * Wrapper of {@link Conten"
  },
  {
    "path": "CoreLibrary/src/main/java/android/databinding/DataBinderMapperProxy.java",
    "chars": 3672,
    "preview": "package android.databinding;\n\nimport android.support.annotation.NonNull;\nimport android.util.Log;\nimport android.view.Vi"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/PluginManager.java",
    "chars": 16486,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/delegate/ActivityManagerProxy.java",
    "chars": 10443,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/delegate/IContentProviderProxy.java",
    "chars": 4264,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/delegate/LocalService.java",
    "chars": 8179,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/delegate/RemoteContentProvider.java",
    "chars": 7715,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/delegate/RemoteService.java",
    "chars": 2118,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/delegate/StubActivity.java",
    "chars": 1086,
    "preview": "package com.didi.virtualapk.delegate;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.conten"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/ActivityLifecycleCallbacksProxy.java",
    "chars": 3658,
    "preview": "package com.didi.virtualapk.internal;\n\nimport android.app.Activity;\nimport android.app.ActivityThread;\nimport android.ap"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/ComponentsHandler.java",
    "chars": 6328,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/Constants.java",
    "chars": 1351,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/LoadedPlugin.java",
    "chars": 52434,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/PluginContentResolver.java",
    "chars": 4002,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/PluginContext.java",
    "chars": 3443,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/ResourcesManager.java",
    "chars": 16011,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/StubActivityInfo.java",
    "chars": 3991,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/VAInstrumentation.java",
    "chars": 10050,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/utils/DexUtil.java",
    "chars": 5308,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/utils/PackageParserCompat.java",
    "chars": 3779,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/utils/PluginUtil.java",
    "chars": 10379,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/internal/utils/Settings.java",
    "chars": 1459,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/utils/Reflector.java",
    "chars": 13903,
    "preview": "package com.didi.virtualapk.utils;\n\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullabl"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/utils/RunUtil.java",
    "chars": 4491,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/java/com/didi/virtualapk/utils/ZipVerifyUtil.java",
    "chars": 5826,
    "preview": "/*\n * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. All rights reserved.\n *\n * Licensed u"
  },
  {
    "path": "CoreLibrary/src/main/res/values/strings.xml",
    "chars": 74,
    "preview": "<resources>\n    <string name=\"app_name\">CoreLibrary</string>\n</resources>\n"
  },
  {
    "path": "CoreLibrary/src/test/java/com/didi/virtualapk/core/ExampleUnitTest.java",
    "chars": 317,
    "preview": "package com.didi.virtualapk.core;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * To work on unit tes"
  },
  {
    "path": "CoreLibrary/upload.gradle",
    "chars": 2334,
    "preview": "apply plugin: 'com.github.dcendents.android-maven'\napply plugin: 'com.jfrog.bintray'\n\ndef GROUP_ID = 'com.didi.virtualap"
  },
  {
    "path": "LICENSE",
    "chars": 11412,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "PluginDemo/app/build.gradle",
    "chars": 1832,
    "preview": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion VERSION_COMPILE_SDK\n    buildToolsVersion VERSI"
  },
  {
    "path": "PluginDemo/app/gradle.properties",
    "chars": 51,
    "preview": "#android.enableD8=false\nandroid.useDexArchive=false"
  },
  {
    "path": "PluginDemo/app/proguard-rules.pro",
    "chars": 3878,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
  },
  {
    "path": "PluginDemo/app/src/main/AndroidManifest.xml",
    "chars": 6707,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package="
  },
  {
    "path": "PluginDemo/app/src/main/aidl/com/didi/virtualapk/demo/aidl/Book.aidl",
    "chars": 56,
    "preview": "package com.didi.virtualapk.demo.aidl;\n\nparcelable Book;"
  },
  {
    "path": "PluginDemo/app/src/main/aidl/com/didi/virtualapk/demo/aidl/IBookManager.aidl",
    "chars": 368,
    "preview": "package com.didi.virtualapk.demo.aidl;\n\nimport com.didi.virtualapk.demo.aidl.Book;\nimport com.didi.virtualapk.demo.aidl."
  },
  {
    "path": "PluginDemo/app/src/main/aidl/com/didi/virtualapk/demo/aidl/IOnNewBookArrivedListener.aidl",
    "chars": 168,
    "preview": "package com.didi.virtualapk.demo.aidl;\n\nimport com.didi.virtualapk.demo.aidl.Book;\n\ninterface IOnNewBookArrivedListener "
  },
  {
    "path": "PluginDemo/app/src/main/aidl/com/didi/virtualapk/demo/binderpool/IBinderPool.aidl",
    "chars": 254,
    "preview": "package com.didi.virtualapk.demo.binderpool;\n\ninterface IBinderPool {\n\n    /**\n     * @param binderCode, the unique toke"
  },
  {
    "path": "PluginDemo/app/src/main/aidl/com/didi/virtualapk/demo/binderpool/ICompute.aidl",
    "chars": 95,
    "preview": "package com.didi.virtualapk.demo.binderpool;\n\ninterface ICompute {\n    int add(int a, int b);\n}"
  },
  {
    "path": "PluginDemo/app/src/main/aidl/com/didi/virtualapk/demo/binderpool/ISecurityCenter.aidl",
    "chars": 148,
    "preview": "package com.didi.virtualapk.demo.binderpool;\n\ninterface ISecurityCenter {\n    String encrypt(String content);\n    String"
  },
  {
    "path": "PluginDemo/app/src/main/aidl/com/didi/virtualapk/demo/manualbinder/Book.aidl",
    "chars": 64,
    "preview": "package com.didi.virtualapk.demo.manualbinder;\n\nparcelable Book;"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/MainActivity.java",
    "chars": 2569,
    "preview": "package com.didi.virtualapk.demo;\n\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimp"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/MyApplication.java",
    "chars": 828,
    "preview": "package com.didi.virtualapk.demo;\n\nimport com.didi.virtualapk.demo.utils.MyUtils;\n\nimport android.app.Application;\nimpor"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/SecondActivity.java",
    "chars": 2652,
    "preview": "package com.didi.virtualapk.demo;\n\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\nimpo"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/ThirdActivity.java",
    "chars": 1666,
    "preview": "package com.didi.virtualapk.demo;\n\nimport com.didi.virtualapk.demo.R;\n\nimport android.app.Activity;\nimport android.conte"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/aidl/Book.java",
    "chars": 1042,
    "preview": "package com.didi.virtualapk.demo.aidl;\n\nimport android.os.Parcel;\nimport android.os.Parcelable;\n\npublic class Book imple"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/aidl/BookManagerActivity.java",
    "chars": 4895,
    "preview": "package com.didi.virtualapk.demo.aidl;\n\nimport java.util.List;\nimport com.didi.virtualapk.demo.R;\nimport com.didi.virtua"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/aidl/BookManagerService.java",
    "chars": 4769,
    "preview": "package com.didi.virtualapk.demo.aidl;\n\nimport java.util.List;\nimport java.util.concurrent.CopyOnWriteArrayList;\nimport "
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/binderpool/BinderPool.java",
    "chars": 3859,
    "preview": "package com.didi.virtualapk.demo.binderpool;\n\nimport java.util.concurrent.CountDownLatch;\n\nimport android.content.Compon"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/binderpool/BinderPoolActivity.java",
    "chars": 1869,
    "preview": "package com.didi.virtualapk.demo.binderpool;\n\nimport com.didi.virtualapk.demo.R;\nimport android.app.Activity;\nimport and"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/binderpool/BinderPoolService.java",
    "chars": 639,
    "preview": "package com.didi.virtualapk.demo.binderpool;\n\nimport android.app.Service;\nimport android.content.Intent;\nimport android."
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/binderpool/ComputeImpl.java",
    "chars": 235,
    "preview": "package com.didi.virtualapk.demo.binderpool;\n\nimport android.os.RemoteException;\n\npublic class ComputeImpl extends IComp"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/binderpool/SecurityCenterImpl.java",
    "chars": 585,
    "preview": "package com.didi.virtualapk.demo.binderpool;\n\nimport android.os.RemoteException;\n\npublic class SecurityCenterImpl extend"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/manager/BookManager.java",
    "chars": 549,
    "preview": "package com.didi.virtualapk.demo.manager;\n\nimport com.didi.virtualapk.demo.aidl.IBookManager;\n\nimport android.os.IBinder"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/manager/UserManager.java",
    "chars": 109,
    "preview": "package com.didi.virtualapk.demo.manager;\n\npublic class UserManager {\n\n    public static int sUserId = 1;\n\n}\n"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/manualbinder/Book.java",
    "chars": 922,
    "preview": "package com.didi.virtualapk.demo.manualbinder;\n\nimport android.os.Parcel;\nimport android.os.Parcelable;\n\npublic class Bo"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/manualbinder/BookManagerImpl.java",
    "chars": 3789,
    "preview": "package com.didi.virtualapk.demo.manualbinder;\n\nimport java.util.List;\n\nimport android.os.Binder;\nimport android.os.IBin"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/manualbinder/IBookManager.java",
    "chars": 591,
    "preview": "package com.didi.virtualapk.demo.manualbinder;\n\nimport java.util.List;\n\nimport android.os.IBinder;\nimport android.os.IIn"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/messenger/MessengerActivity.java",
    "chars": 2364,
    "preview": "package com.didi.virtualapk.demo.messenger;\n\nimport com.didi.virtualapk.demo.R;\nimport com.didi.virtualapk.demo.R.layout"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/messenger/MessengerService.java",
    "chars": 1758,
    "preview": "package com.didi.virtualapk.demo.messenger;\n\nimport com.didi.virtualapk.demo.utils.MyConstants;\n\nimport android.app.Serv"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/model/User.java",
    "chars": 1587,
    "preview": "package com.didi.virtualapk.demo.model;\n\nimport java.io.Serializable;\n\nimport com.didi.virtualapk.demo.aidl.Book;\n\nimpor"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/provider/BookProvider.java",
    "chars": 4272,
    "preview": "package com.didi.virtualapk.demo.provider;\n\nimport android.content.ContentProvider;\nimport android.content.ContentValues"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/provider/DbOpenHelper.java",
    "chars": 1139,
    "preview": "package com.didi.virtualapk.demo.provider;\n\nimport android.content.Context;\nimport android.database.sqlite.SQLiteDatabas"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/provider/ProviderActivity.java",
    "chars": 2081,
    "preview": "package com.didi.virtualapk.demo.provider;\n\nimport com.didi.virtualapk.demo.R;\nimport com.didi.virtualapk.demo.aidl.Book"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/socket/TCPClientActivity.java",
    "chars": 5127,
    "preview": "package com.didi.virtualapk.demo.socket;\n\nimport java.io.*;\nimport java.net.Socket;\nimport java.sql.Date;\nimport java.te"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/socket/TCPServerService.java",
    "chars": 3214,
    "preview": "package com.didi.virtualapk.demo.socket;\n\nimport java.io.BufferedReader;\nimport java.io.BufferedWriter;\nimport java.io.I"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/utils/MyConstants.java",
    "chars": 440,
    "preview": "package com.didi.virtualapk.demo.utils;\n\nimport android.os.Environment;\n\npublic class MyConstants {\n    public static fi"
  },
  {
    "path": "PluginDemo/app/src/main/java/com/didi/virtualapk/demo/utils/MyUtils.java",
    "chars": 1135,
    "preview": "package com.didi.virtualapk.demo.utils;\n\nimport java.io.Closeable;\nimport java.io.IOException;\nimport java.util.List;\n\ni"
  },
  {
    "path": "PluginDemo/app/src/main/res/drawable/edit.xml",
    "chars": 621,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n\n    <it"
  },
  {
    "path": "PluginDemo/app/src/main/res/layout/activity_binder_pool.xml",
    "chars": 434,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "PluginDemo/app/src/main/res/layout/activity_book_manager.xml",
    "chars": 1488,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "PluginDemo/app/src/main/res/layout/activity_main.xml",
    "chars": 871,
    "preview": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/too"
  },
  {
    "path": "PluginDemo/app/src/main/res/layout/activity_messenger.xml",
    "chars": 434,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "PluginDemo/app/src/main/res/layout/activity_provider.xml",
    "chars": 434,
    "preview": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/t"
  },
  {
    "path": "PluginDemo/app/src/main/res/layout/activity_second.xml",
    "chars": 646,
    "preview": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/too"
  },
  {
    "path": "PluginDemo/app/src/main/res/layout/activity_tcpclient.xml",
    "chars": 1563,
    "preview": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/too"
  },
  {
    "path": "PluginDemo/app/src/main/res/layout/activity_third.xml",
    "chars": 646,
    "preview": "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/too"
  },
  {
    "path": "PluginDemo/app/src/main/res/values/colors.xml",
    "chars": 114,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <color name=\"reveal_color\">#1b000000</color>\n\n</resources>"
  },
  {
    "path": "PluginDemo/app/src/main/res/values/strings.xml",
    "chars": 598,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <string name=\"app_name\">Chapter_2</string>\n    <string name=\"hel"
  },
  {
    "path": "PluginDemo/app/src/main/res/values/styles.xml",
    "chars": 1315,
    "preview": "<resources>\r\n\r\n    <!--\r\n        Base application theme, dependent on API level. This theme is replaced\r\n        by AppB"
  },
  {
    "path": "PluginDemo/build.gradle",
    "chars": 569,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\nbuildscript {\n    re"
  },
  {
    "path": "PluginDemo/gradle/wrapper/gradle-wrapper.properties",
    "chars": 230,
    "preview": "#Mon Dec 28 10:00:20 PST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "PluginDemo/gradlew",
    "chars": 4971,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "PluginDemo/gradlew.bat",
    "chars": 2404,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
  },
  {
    "path": "PluginDemo/make.sh",
    "chars": 231,
    "preview": "./gradlew clean assemblePlugin\nadb push app/build/outputs/apk/app-beijing-release-unsigned.apk /sdcard/Test.apk\nadb shel"
  },
  {
    "path": "PluginDemo/settings.gradle",
    "chars": 15,
    "preview": "include ':app'\n"
  },
  {
    "path": "README.md",
    "chars": 4309,
    "preview": "# Android 9.0 supported! Please use [the lastest release](https://github.com/didi/VirtualAPK/releases).\n\n# <img src=\"img"
  },
  {
    "path": "RELEASE-NOTES.md",
    "chars": 1801,
    "preview": "# Release Notes\n\n## com.didi.virtualapk:core:0.9.0\n开源的第一个版本,支持了几乎所有 Android 特性,目前已经被大家广泛使用。\n\n## com.didi.virtualapk:core"
  },
  {
    "path": "app/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "chars": 1453,
    "preview": "apply plugin: 'com.android.application'\napply plugin: 'com.didi.virtualapk.host'\n\nandroid {\n    compileSdkVersion VERSIO"
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 3877,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
  },
  {
    "path": "app/src/androidTest/java/com/didi/virtualapk/ApplicationTest.java",
    "chars": 350,
    "preview": "package com.didi.virtualapk;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a href=\""
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 2672,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package="
  },
  {
    "path": "app/src/main/java/com/didi/virtualapk/MainActivity.java",
    "chars": 6369,
    "preview": "package com.didi.virtualapk;\n\nimport android.Manifest;\nimport android.app.AlertDialog;\nimport android.content.Context;\ni"
  },
  {
    "path": "app/src/main/java/com/didi/virtualapk/VAApplication.java",
    "chars": 575,
    "preview": "package com.didi.virtualapk;\n\nimport android.app.Application;\nimport android.content.Context;\nimport android.util.Log;\n\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "chars": 1538,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmln"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "chars": 208,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"color"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "chars": 211,
    "preview": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "chars": 324,
    "preview": "<resources>\n    <string name=\"app_name\">VirtualAPK</string>\n    <string name=\"open_plugin\">加载插件</string>\n    <string nam"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "chars": 384,
    "preview": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"HostTheme\" parent=\"Theme.AppCompat.Light.DarkActionBa"
  },
  {
    "path": "app/src/main/res/values-en/strings.xml",
    "chars": 385,
    "preview": "<resources>\n    <string name=\"app_name\">VirtualAPK-EN</string>\n    <string name=\"open_plugin\">open plugin</string>\n    <"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "chars": 358,
    "preview": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as s"
  },
  {
    "path": "app/src/test/java/com/didi/virtualapk/ExampleUnitTest.java",
    "chars": 312,
    "preview": "package com.didi.virtualapk;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * To work on unit tests, s"
  },
  {
    "path": "build.gradle",
    "chars": 782,
    "preview": "buildscript {\n    System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'\n\n    repositories {\n      "
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 230,
    "preview": "#Mon Dec 05 15:48:51 CST 2016\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradle.properties",
    "chars": 752,
    "preview": "## Project-wide Gradle settings.\n#\n# For more details on how to configure your build environment visit\n# http://www.grad"
  },
  {
    "path": "gradlew",
    "chars": 4971,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2404,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
  },
  {
    "path": "keystore/test.cer",
    "chars": 1241,
    "preview": "-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIEWWZdhTANBgkqhkiG9w0BAQsFADBfMQ4wDAYDVQQGDAV6aF9jbjEQMA4G\r\nA1UECBMHYmVpam"
  },
  {
    "path": "settings.gradle",
    "chars": 60,
    "preview": "include ':app'\ninclude ':CoreLibrary'\ninclude ':AndroidStub'"
  },
  {
    "path": "virtualapk-gradle-plugin/build.gradle",
    "chars": 993,
    "preview": "buildscript {\n    repositories {\n        mavenLocal()\n        google()\n        mavenCentral()\n        jcenter()\n    }\n  "
  },
  {
    "path": "virtualapk-gradle-plugin/gradle/wrapper/gradle-wrapper.properties",
    "chars": 230,
    "preview": "#Wed Sep 27 15:30:56 CST 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "virtualapk-gradle-plugin/gradle.properties",
    "chars": 64,
    "preview": "GROUP_ID=com.didi.virtualapk\nARTIFACT_ID=gradle\nVERSION=0.9.8.6\n"
  },
  {
    "path": "virtualapk-gradle-plugin/gradlew",
    "chars": 4971,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "virtualapk-gradle-plugin/gradlew.bat",
    "chars": 2404,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/BasePlugin.groovy",
    "chars": 7320,
    "preview": "package com.didi.virtualapk\n\nimport com.android.build.gradle.AppExtension\nimport com.android.build.gradle.AppPlugin\nimpo"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/Constants.groovy",
    "chars": 125,
    "preview": "package com.didi.virtualapk\n\npublic final class Constants {\n    public static final String GRADLE_3_1_0 = 'va.gradle.3.1"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/VAExtention.groovy",
    "chars": 5033,
    "preview": "package com.didi.virtualapk\n\nimport com.android.build.gradle.internal.scope.VariantScope\nimport com.didi.virtualapk.coll"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/VAHostPlugin.groovy",
    "chars": 12835,
    "preview": "package com.didi.virtualapk\n\nimport com.android.build.gradle.api.ApplicationVariant\nimport com.android.build.gradle.inte"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/VAPlugin.groovy",
    "chars": 11232,
    "preview": "package com.didi.virtualapk\n\nimport com.android.build.gradle.AppPlugin\nimport com.android.build.gradle.internal.api.Appl"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/AXmlEditor.groovy",
    "chars": 9101,
    "preview": "package com.didi.virtualapk.aapt\n\n/**\n * Class to edit aapt-generated hex xml file\n */\npublic class AXmlEditor extends A"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/Aapt.groovy",
    "chars": 5891,
    "preview": "package com.didi.virtualapk.aapt\n\nimport com.didi.virtualapk.collector.res.ResourceEntry\nimport com.didi.virtualapk.coll"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/ArscEditor.groovy",
    "chars": 29470,
    "preview": "package com.didi.virtualapk.aapt\n\n/**\n * Class to edit aapt-generated resources.arsc file\n */\npublic class ArscEditor ex"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/AssetEditor.groovy",
    "chars": 13298,
    "preview": "package com.didi.virtualapk.aapt\n\nimport javax.management.RuntimeMBeanException\n\n/**\n * Class to edit aapt-generated ass"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/CppHexEditor.groovy",
    "chars": 3962,
    "preview": "package com.didi.virtualapk.aapt\n\nimport java.nio.ByteBuffer\nimport java.nio.ByteOrder\n\n/**\n * Class of c++ hex file (li"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/ResAttr.groovy",
    "chars": 2416,
    "preview": "package com.didi.virtualapk.aapt\n\n/**\n * enum from libs/androidfw/Command.cpp\n */\npublic final class ResAttr {\n\n    publ"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/ResStringFlag.groovy",
    "chars": 225,
    "preview": "package com.didi.virtualapk.aapt\n\n/**\n * enum from include/androidfw/ResourceTypes.h\n */\npublic final class ResStringFla"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/ResStringPoolSpan.groovy",
    "chars": 268,
    "preview": "package com.didi.virtualapk.aapt\n\n/**\n * enum from include/androidfw/ResourceTypes.h\n */\npublic final class ResStringPoo"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/ResTableEntry.groovy",
    "chars": 276,
    "preview": "package com.didi.virtualapk.aapt\n\n/**\n * enum from include/androidfw/ResourceTypes.h\n */\npublic final class ResTableEntr"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/ResTableType.groovy",
    "chars": 170,
    "preview": "package com.didi.virtualapk.aapt\n\n/**\n * enum from include/androidfw/ResourceTypes.h\n */\npublic final class ResTableType"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/ResType.groovy",
    "chars": 1268,
    "preview": "package com.didi.virtualapk.aapt\n\n/**\n * enum from include/androidfw/ResourceTypes.h\n */\npublic final class ResType {\n  "
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/ResValueDataType.groovy",
    "chars": 229,
    "preview": "package com.didi.virtualapk.aapt\n\n/**\n * enum from include/androidfw/ResourceTypes.h\n */\npublic final class ResValueData"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/SymbolParser.groovy",
    "chars": 5984,
    "preview": "package com.didi.virtualapk.aapt\n\n/**\n * Class to parse aapt-generated text symbols file (intermediates/symbols/R.txt)\n "
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/aapt/packageinfo",
    "chars": 120,
    "preview": "Editor of ARSC file, forked from https://github.com/wequick/Small and made some improvements. Thanks to the Small team.\n"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/collector/HostClassAndResCollector.groovy",
    "chars": 1998,
    "preview": "package com.didi.virtualapk.collector\n\nimport com.didi.virtualapk.collector.dependence.AarDependenceInfo\nimport com.didi"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/collector/HostJniLibsCollector.groovy",
    "chars": 6566,
    "preview": "package com.didi.virtualapk.collector\n\nimport com.android.SdkConstants\nimport com.android.annotations.NonNull\nimport com"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/collector/ResourceCollector.groovy",
    "chars": 10721,
    "preview": "package com.didi.virtualapk.collector\n\nimport com.android.build.gradle.tasks.ProcessAndroidResources\nimport com.didi.vir"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/collector/dependence/AarDependenceInfo.groovy",
    "chars": 4793,
    "preview": "package com.didi.virtualapk.collector.dependence\n\nimport com.android.SdkConstants\nimport com.android.build.gradle.intern"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/collector/dependence/DependenceInfo.groovy",
    "chars": 1431,
    "preview": "package com.didi.virtualapk.collector.dependence\n\n/**\n * Represents a library in Android Project\n *\n * @author zhengtao\n"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/collector/dependence/JarDependenceInfo.groovy",
    "chars": 761,
    "preview": "package com.didi.virtualapk.collector.dependence\n\nimport com.android.builder.model.JavaLibrary\nimport com.didi.virtualap"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/collector/res/ResourceEntry.groovy",
    "chars": 2063,
    "preview": "package com.didi.virtualapk.collector.res\n/**\n * Represent a resource entry(e.g. drawable, anim, attr, layout...) in and"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/collector/res/StyleableEntry.groovy",
    "chars": 1939,
    "preview": "package com.didi.virtualapk.collector.res\n\n/**\n * Represent styleable item in R symbol file\n * e.g.\n * int[] styleable T"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/hooker/DxTaskHooker.groovy",
    "chars": 3694,
    "preview": "package com.didi.virtualapk.hooker\n\nimport com.android.build.gradle.api.ApkVariant\nimport com.android.build.gradle.inter"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/hooker/GradleTaskHooker.groovy",
    "chars": 2605,
    "preview": "package com.didi.virtualapk.hooker\n\nimport com.android.build.gradle.api.ApkVariant\nimport com.android.build.gradle.inter"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/hooker/MergeAssetsHooker.groovy",
    "chars": 2654,
    "preview": "package com.didi.virtualapk.hooker\n\nimport com.android.build.gradle.api.ApkVariant\nimport com.android.build.gradle.tasks"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/hooker/MergeJniLibsHooker.groovy",
    "chars": 1642,
    "preview": "package com.didi.virtualapk.hooker\n\nimport com.android.build.gradle.AndroidConfig\nimport com.android.build.gradle.AppExt"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/hooker/MergeManifestsHooker.groovy",
    "chars": 5859,
    "preview": "package com.didi.virtualapk.hooker\n\nimport com.android.build.gradle.api.ApkVariant\nimport com.android.build.gradle.inter"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/hooker/PrepareDependenciesHooker.groovy",
    "chars": 7320,
    "preview": "package com.didi.virtualapk.hooker\n\nimport com.android.build.gradle.api.ApkVariant\nimport com.android.build.gradle.inter"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/hooker/ProcessResourcesHooker.groovy",
    "chars": 9922,
    "preview": "package com.didi.virtualapk.hooker\n\nimport com.android.build.gradle.AndroidConfig\nimport com.android.build.gradle.AppExt"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/hooker/ProguardHooker.groovy",
    "chars": 2706,
    "preview": "package com.didi.virtualapk.hooker\n\nimport com.android.build.gradle.api.ApkVariant\nimport com.android.build.gradle.inter"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/hooker/ShrinkResourcesHooker.groovy",
    "chars": 1425,
    "preview": "package com.didi.virtualapk.hooker\n\nimport com.android.build.api.transform.TransformException\nimport com.android.build.a"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/hooker/TaskHookerManager.groovy",
    "chars": 2604,
    "preview": "package com.didi.virtualapk.hooker\n\nimport com.android.build.gradle.AppExtension\nimport com.android.build.gradle.interna"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/tasks/AssemblePlugin.groovy",
    "chars": 3101,
    "preview": "package com.didi.virtualapk.tasks\n\nimport com.android.build.gradle.api.ApkVariant\nimport com.android.build.gradle.intern"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/transform/StripClassAndResTransform.groovy",
    "chars": 4286,
    "preview": "package com.didi.virtualapk.transform\n\nimport com.android.build.api.transform.*\nimport com.android.build.gradle.api.Appl"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/transform/TransformWrapper.groovy",
    "chars": 3129,
    "preview": "package com.didi.virtualapk.transform\n\nimport com.android.build.api.transform.*\nimport com.didi.virtualapk.utils.Log\n\npu"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/utils/CheckList.groovy",
    "chars": 938,
    "preview": "package com.didi.virtualapk.utils\n\nclass CheckList {\n    Map<String, Boolean> mMap = new LinkedHashMap<>()\n    String va"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/utils/FileBinaryCategory.groovy",
    "chars": 754,
    "preview": "package com.didi.virtualapk.utils\n\n/**\n * Extend << operator to copy file\n * @author zhengtao\n */\nclass FileBinaryCatego"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/utils/FileUtil.groovy",
    "chars": 1666,
    "preview": "package com.didi.virtualapk.utils\n/**\n * Created by qiaopu on 2017/9/4.\n */\npublic class FileUtil {\n    \n    public stat"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/utils/PackagingUtils.java",
    "chars": 8618,
    "preview": "/*\n * Copyright (C) 2013 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
  },
  {
    "path": "virtualapk-gradle-plugin/src/main/groovy/com.didi.virtualapk/utils/Reflect.java",
    "chars": 29602,
    "preview": "/*\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance "
  }
]

// ... and 11 more files (download for full content)

About this extraction

This page contains the full source code of the didi/VirtualAPK GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 211 files (640.5 KB), approximately 148.5k tokens, and a symbol index with 906 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!