Get a SDK

For the latest documentation, please refer to:

SDK Integration

Step 1. Dependency

implementation "com.tencent:mmkv-static:1.2.10"
implementation ""
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.5.30"

Step 2. Initialization

Add the following code to initialize in Application#attachBaseContext


Please note that after calling `init()`, if the `FCore.get().isClient()` condition is true, please try not to do other initialization in the Application. If you encounter any problems, please contact technical support.

override fun attachBaseContext(base: Context) {
    if(FCore.isClient()) {
    // do something...

override fun onCreate() {
    if(FCore.isClient()) {
    // do something...

Step 3. Installation

Method 1: App Clone

This method relies on the application that is already installed on the system. If the application is uninstalled from the system, the cloned app will also disappear.

FCore.get().installPackageAsUser("package_name", USER_ID)

Method 2: Running without installation

This method supports running without installation and will not be affected by system installation or uninstallation.

FCore.get().installPackageAsUser(new File("/sdcard/wechat.apk"), USER_ID)

Step 4. Launch sandboxed application

FCore.get().launchApk("package_name", USER_ID)

API Documentation

Method Description
initInitialize sandbox
isInstalledCheck if the app is installed in the sandbox
installPackageAsUserClone App into sandbox according to package name
installPackageAsUserClone App into sandbox via apk file
uninstallPackageUninstall an App installed in the sandbox globally
uninstallPackageAsUserUninstall an App installed in the sandbox by user
getInstalledApplicationsGet all applications installed in the sandbox
getApplicationInfoGet application info of an App in the sandbox
getPackageInfoGet package info of an application in the sandbox
getLaunchIntentForPackageGet LauncherIntent of an App
launchApkLaunch App in sandbox
launchIntentLaunch App via Intent
isRunningCheck if an App is running
clearPackageClear App data
stopPackageStop an app from running
stopAllPackagesStop all running applications
setAutoForegroundSet auto start/close notification bar to automatically close notification bar when no process is active
Internal Process
Method Description
findProcessRecordFinding process information
addProcessMonitorAdding sandboxed internal process listeners
removeProcessMonitorRemoving sandboxed internal process listeners
Kernel User
Method Description
getUsersGetting users in the sandbox
createUserCreate users in the sandbox
deleteUserDelete users in the sandbox (all application information will be deleted)
APP Data
Method Description
exportAppDataExport all data of a certain application
importAppDataImport all data of a certain application
APP Rules
Method Description
addRuleAdd a rule
setAllowSystemInteractionWhether to allow interaction with system applications when the sandbox cannot find broadcasts, activities, etc
setHideRootHide root status
setHideSimHide SIM card status
setHideVPNHide VPN status
setVisitExternalAppAllow sandboxed applications to perceive external applications
setDisableKillPrevent application crashes
setDisableNetworkDisable application network
setHidePathHide multi-open path and storage path
getSpaceLanguageGet the simulated language of a certain space
setSpaceLanguageSet the simulated language of a certain space (e.g. Chinese: zh)
getSpaceRegionGet the simulated region of a certain space
setSpaceRegionSet the simulated region of a certain space (e.g. China: CN)
getSpaceTimeZoneGet the simulated time zone of a certain space
setSpaceTimeZoneSet the simulated time zone of a certain space (e.g. Shanghai: Asia/Shanghai)
App Permissions
Method Description
getPermissionGet app permission rules
updatePermissionUpdate app permission rules
revokePermissionRemove app permission rules (the app will follow the actual permissions of the host APP)
Kernel Configuration
Method Description
enableOptRuleWhether to enable rule-based blocking of push notifications, third-party SDKs, hot updates, ads, etc. to optimize app running speed. If an application exception occurs, please turn off
setAutoPreloadApplicationIntelligent preloading of applications, where the kernel automatically loads applications based on usage to accelerate startup speed. Default: on
preloadApplicationCountDefault number of preloaded applications: 2
setPreloadProcessCountSet the number of preloading processes to speed up application startup. Default: 3
setBackToHomeWhether to return to the host app when the sandbox app exits
setSpaceTaskDescriptionPrefixSet the application prefix in the recent tasks list (default: F{user ID})
setEnableLauncherViewWhether to enable splash screen
restartCoreSystemRestart the kernel (all applications will be killed)
Kernel Virtual GPS Location
Method Description
disableFakeLocationDisable virtual location for a certain user
enableFakeLocationEnable virtual location for a certain user
setLocationSet virtual location parameters for a certain user
getLocationGet virtual location parameters for a certain user
setGlobalLocationSet global virtual location parameters
getGlobalLocationGet global virtual location parameters

Rule Configuration System

When dealing with various applications, SpaceCore supports configuring different runtime parameters and virtual machine parameters to achieve adaptation. SpaceCore supports a powerful rule configuration system that can customize exclusive rules for each application. The rule library can be dynamically updated through cloud configuration. The supported rule functions are gradually under development.

PackageRule.Builder builder = new PackageRule.Builder("",
    /* Scoped process. Leave blank if the scope is all processes */
    "", "", "", "")
    // disable a Activity
    // disable a broadcast
    // disable a service
    // disable a ContentProvider
    // preloading process, can pre-start a certain process to speed up the runtime experience
    // disable a process from starting
    // deny access to a file
    // redirect a certain file
    .addRedirectIO("/proc/self/cmdline", "/proc/self/fake-cmdline")
    // hide root
    // hide SIM
    // hide VPN
    // many more...
    // set language
    // set region
    // set timezone

PackageRule build =;

// add a rule

// if there are multiple rules, put them in FRule
FRule fRule = new FRule(,,;

// support fetching configuration content from remote cloud
String json = new Gson().toJson(fRule);
// load json rule