apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy31Service.java
public class Proxy31Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy30Service.java
public class Proxy30Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy23Service.java
public class Proxy23Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy20Service.java
public class Proxy20Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy22Service.java
public class Proxy22Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy24Service.java
public class Proxy24Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy33Service.java
public class Proxy33Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy08Service.java
public class Proxy08Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy15Service.java
public class Proxy15Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy28Service.java
public class Proxy28Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy25Service.java
public class Proxy25Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy404Service.java
public class Proxy404Service extends Service {

    private static final boolean DEBUG_LIFECYCLE = ApkBuild.DEBUG_LIFECYCLE;
    private String TAG = getClass().getSimpleName();

    @Override
    public IBinder onBind(Intent intent) {
        if (DEBUG_LIFECYCLE)
            ApkLogger.get().debug(TAG + " - onBind", null);
        if (intent != null && intent.hasExtra(ApkConstant.EXTRA_APK_TARGET_INTENT)) {
            Intent target = intent.getParcelableExtra(ApkConstant.EXTRA_APK_TARGET_INTENT);
            return HookService_Manager.onBindService(this, target);
        }
        return new Proxy404Service.ProxyBinder();
    }

    @Override
    public void onCreate() {
        if (DEBUG_LIFECYCLE)
            ApkLogger.get().debug(TAG + " - onCreate", null);
        super.onCreate();
    }

    @Override
    public void onStart(Intent intent, int startId) {
        if (DEBUG_LIFECYCLE)
            ApkLogger.get().debug(TAG + " - onStart", null);
        super.onStart(intent, startId);
        if (intent != null && intent.hasExtra(ApkConstant.EXTRA_APK_TARGET_INTENT)) {
            Intent target = intent.getParcelableExtra(ApkConstant.EXTRA_APK_TARGET_INTENT);
            HookService_Manager.onStartService(this, target, startId);
        }
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        if (DEBUG_LIFECYCLE)
            ApkLogger.get().debug(TAG + " - onStartCommandService", null);
        if (intent != null && intent.hasExtra(ApkConstant.EXTRA_APK_TARGET_INTENT)) {
            Intent target = intent.getParcelableExtra(ApkConstant.EXTRA_APK_TARGET_INTENT);
            return HookService_Manager.onStartCommandService(this, target, flags, startId);
        }
        return super.onStartCommand(intent, flags, startId);
    }


    @Override
    public void onRebind(Intent intent) {
        if (DEBUG_LIFECYCLE)
            ApkLogger.get().debug(TAG + " - onRebind", null);
        if (intent != null && intent.hasExtra(ApkConstant.EXTRA_APK_TARGET_INTENT)) {
            Intent target = intent.getParcelableExtra(ApkConstant.EXTRA_APK_TARGET_INTENT);
            HookService_Manager.onRebindService(this, target);
        }
        super.onRebind(intent);
    }

    @Override
    public boolean onUnbind(Intent intent) {
        if (DEBUG_LIFECYCLE)
            ApkLogger.get().debug(TAG + " - onUnbind", null);
        if (intent != null && intent.hasExtra(ApkConstant.EXTRA_APK_TARGET_INTENT)) {
            Intent target = intent.getParcelableExtra(ApkConstant.EXTRA_APK_TARGET_INTENT);
            return HookService_Manager.onUnbindService(this, target);
        }
        return super.onUnbind(intent);
    }

    @Override
    public void onDestroy() {
        if (DEBUG_LIFECYCLE)
            ApkLogger.get().debug(TAG + " - onDestroy", null);
        super.onDestroy();
        HookService_Manager.onDestroyService(this);
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        if (DEBUG_LIFECYCLE)
            ApkLogger.get().debug(TAG + " - onConfigurationChanged", null);
        super.onConfigurationChanged(newConfig);
        HookService_Manager.onConfigurationChangedService(this, newConfig);
    }

    @Override
    public void onLowMemory() {
        if (DEBUG_LIFECYCLE)
            ApkLogger.get().debug(TAG + " - onLowMemory", null);
        super.onLowMemory();
        HookService_Manager.onLowMemoryService(this);
    }

    @Override
    public void onTrimMemory(int level) {
        if (DEBUG_LIFECYCLE)
            ApkLogger.get().debug(TAG + " - onTrimMemory", null);
        super.onTrimMemory(level);
        HookService_Manager.onTrimMemoryService(this, level);
    }

    @Override
    public void onTaskRemoved(Intent rootIntent) {
        if (DEBUG_LIFECYCLE)
            ApkLogger.get().debug(TAG + " - onTaskRemoved", null);
        super.onTaskRemoved(rootIntent);
        HookService_Manager.onTaskRemovedService(this, rootIntent);
    }

    private class ProxyBinder extends Binder {

        @Override
        public String toString() {
            return Proxy404Service.this.getClass().getName() + "$" + super.toString();
        }

    }
}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy00Service.java
public class Proxy00Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy03Service.java
public class Proxy03Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/hook/activity/HookActivity_Component.java
public class HookActivity_Component {


    private HookActivity_Component() {
    }

    // launch mode
    public static final String SINGLE_TASK = "SINGLE_TASK";
    public static final String SINGLE_INSTANCE = "SINGLE_INSTANCE";
    public static final String SINGLE_TOP = "SINGLE_TOP";
    public static final String STANDARD = "STANDARD";

    // COMPONENTMAP
    private static final Map<String, Class> COMPONENTMAP = new HashMap<>();
    // CLASSES
    private static final Class<?>[] CLASSES = new Class[]{
            ProxyTaskActivity.class,
            ProxyInstanceActivity.class,
            ProxyTopActivity.class,
            ProxyStandardActivity.class,
    };
    // index
    private static int index = 0;

    public static Intent modify(Intent raw) {
        if (!raw.hasExtra(ApkConstant.EXTRA_APK_MODIFIED)
                && raw != null
                && raw.getComponent() != null
                && raw.hasExtra(ApkConstant.EXTRA_APK_PATH)) {
            String key = ApkComponentModifier.getKey(raw);
            Class<?> clazz = null;
            if (raw.hasExtra(ApkConstant.EXTRA_APK_PROXY)) {
                String proxyClass = raw.getStringExtra(ApkConstant.EXTRA_APK_PROXY);
                try {
                    clazz = HookActivity_Component.class.getClassLoader().loadClass(proxyClass);
                } catch (ClassNotFoundException e) {
                }
            }
            if (clazz == null) {
                if (COMPONENTMAP.containsKey(key)) {
                    clazz = COMPONENTMAP.get(key);
                } else {
                    String launchMode = "";
                    if (raw.hasExtra(ApkConstant.EXTRA_APK_LAUNCH_MODE)) {
                        launchMode = raw.getStringExtra(ApkConstant.EXTRA_APK_LAUNCH_MODE);
                    }
                    if (launchMode.equals(SINGLE_TASK)) {
                        index = 0;
                    } else if (launchMode.equals(SINGLE_INSTANCE)) {
                        index = 1;
                    } else if (launchMode.equals(SINGLE_TOP)) {
                        index = 2;
                    } else if (launchMode.equals(STANDARD)) {
                        index = 3;
                    }
                    if (index >= CLASSES.length) {
                        clazz = Proxy404Activity.class;
                    } else {
                        clazz = CLASSES[index];
                        COMPONENTMAP.put(key, clazz);
                    }
                }
            }
            Intent newIntent = new Intent();
            ComponentName componentName = new ComponentName(raw.getComponent().getPackageName(), clazz.getName());
            newIntent.setComponent(componentName);
            newIntent.putExtra(ApkConstant.EXTRA_APK_TARGET_INTENT, raw);
            newIntent.putExtra(ApkConstant.EXTRA_APK_MODIFIED, clazz.getName());
            return newIntent;
        }
        return raw;
    }

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy17Service.java
public class Proxy17Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy19Service.java
public class Proxy19Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy18Service.java
public class Proxy18Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/hook/modify/ApkComponentModifier.java
public class ApkComponentModifier {

    private ApkComponentModifier() {
    }

    public static String getKey(Intent intent) {
        return getPath(intent) + "@" + getClassName(intent);
    }

    public static String getPath(Intent intent) {
        if (intent != null && intent.hasExtra(ApkConstant.EXTRA_APK_PATH)) {
            return intent.getStringExtra(ApkConstant.EXTRA_APK_PATH);
        }
        return null;
    }

    public static String getClassName(Intent intent) {
        if (intent != null && intent.getComponent() != null) {
            return intent.getComponent().getClassName();
        }
        return null;
    }
}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy21Service.java
public class Proxy21Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy07Service.java
public class Proxy07Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy13Service.java
public class Proxy13Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy12Service.java
public class Proxy12Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy01Service.java
public class Proxy01Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy09Service.java
public class Proxy09Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy27Service.java
public class Proxy27Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy14Service.java
public class Proxy14Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy26Service.java
public class Proxy26Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy11Service.java
public class Proxy11Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/core/constant/ApkConstant.java
public interface ApkConstant {

    String EXTRA_APK_PATH = "apkbox_extra_path";
    String EXTRA_APK_PROXY = "apkbox_extra_proxy";
    String EXTRA_APK_EXTRAS = "apkbox_extra_extras";
    String EXTRA_APK_THEME = "apkbox_extra_theme";
    String EXTRA_APK_MODIFIED = "apkbox_extra_modified";
    String EXTRA_APK_LAUNCH_MODE = "apkbox_extra_launch_mode";
    String EXTRA_APK_TARGET_INTENT = "apkbox_extra_target_intent";

    String SERVICE_APK_BOX_MANAGER = "apkbox_manager_service";

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy02Service.java
public class Proxy02Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy06Service.java
public class Proxy06Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy29Service.java
public class Proxy29Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy16Service.java
public class Proxy16Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy32Service.java
public class Proxy32Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy10Service.java
public class Proxy10Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy05Service.java
public class Proxy05Service extends Proxy404Service {

}
apkbox/src/main/java/com/liangmayong/apkbox/proxy/service/Proxy04Service.java
public class Proxy04Service extends Proxy404Service {

}


Question: import android.content.ComponentName;
import android.content.Intent;
import com.liangmayong.apkbox.core.constant.ApkConstant;
import com.liangmayong.apkbox.hook.activity.HookActivity_Component;
import com.liangmayong.apkbox.hook.modify.ApkComponentModifier;
import com.liangmayong.apkbox.proxy.service.Proxy00Service;
import com.liangmayong.apkbox.proxy.service.Proxy01Service;
import com.liangmayong.apkbox.proxy.service.Proxy02Service;
import com.liangmayong.apkbox.proxy.service.Proxy03Service;
import com.liangmayong.apkbox.proxy.service.Proxy04Service;
import com.liangmayong.apkbox.proxy.service.Proxy05Service;
import com.liangmayong.apkbox.proxy.service.Proxy06Service;
import com.liangmayong.apkbox.proxy.service.Proxy07Service;
import com.liangmayong.apkbox.proxy.service.Proxy08Service;
import com.liangmayong.apkbox.proxy.service.Proxy09Service;
import com.liangmayong.apkbox.proxy.service.Proxy10Service;
import com.liangmayong.apkbox.proxy.service.Proxy11Service;
import com.liangmayong.apkbox.proxy.service.Proxy12Service;
import com.liangmayong.apkbox.proxy.service.Proxy13Service;
import com.liangmayong.apkbox.proxy.service.Proxy14Service;
import com.liangmayong.apkbox.proxy.service.Proxy15Service;
import com.liangmayong.apkbox.proxy.service.Proxy16Service;
import com.liangmayong.apkbox.proxy.service.Proxy17Service;
import com.liangmayong.apkbox.proxy.service.Proxy18Service;
import com.liangmayong.apkbox.proxy.service.Proxy19Service;
import com.liangmayong.apkbox.proxy.service.Proxy20Service;
import com.liangmayong.apkbox.proxy.service.Proxy21Service;
import com.liangmayong.apkbox.proxy.service.Proxy22Service;
import com.liangmayong.apkbox.proxy.service.Proxy23Service;
import com.liangmayong.apkbox.proxy.service.Proxy24Service;
import com.liangmayong.apkbox.proxy.service.Proxy25Service;
import com.liangmayong.apkbox.proxy.service.Proxy26Service;
import com.liangmayong.apkbox.proxy.service.Proxy27Service;
import com.liangmayong.apkbox.proxy.service.Proxy28Service;
import com.liangmayong.apkbox.proxy.service.Proxy29Service;
import com.liangmayong.apkbox.proxy.service.Proxy30Service;
import com.liangmayong.apkbox.proxy.service.Proxy31Service;
import com.liangmayong.apkbox.proxy.service.Proxy32Service;
import com.liangmayong.apkbox.proxy.service.Proxy33Service;
import com.liangmayong.apkbox.proxy.service.Proxy404Service;
import java.util.HashMap;
import java.util.Map;
/**
 The MIT License (MIT)

 Copyright (c) 2017 LiangMaYong ( ibeam@qq.com )

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/ or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in all
 copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 **/
package com.liangmayong.apkbox.hook.service;




/**
 * Created by LiangMaYong on 2017/4/5.
 */
public class HookService_Component {

    private HookService_Component() {
    }

    // COMPONENTMAP
    private static final Map<String, Class> COMPONENTMAP = new HashMap<>();
    // CLASSES
    private static final Class<?>[] CLASSES = new Class[]{
            Proxy00Service.class,
            Proxy01Service.class,
            Proxy02Service.class,
            Proxy03Service.class,
            Proxy04Service.class,
            Proxy05Service.class,
            Proxy06Service.class,
            Proxy07Service.class,
            Proxy08Service.class,
            Proxy09Service.class,
            Proxy10Service.class,
            Proxy11Service.class,
            Proxy12Service.class,
            Proxy13Service.class,
Answer:             Proxy14Service.class,