diff --git a/520ApkBox/.gitignore b/520ApkBox-NewBlackbox/.gitignore
similarity index 100%
rename from 520ApkBox/.gitignore
rename to 520ApkBox-NewBlackbox/.gitignore
diff --git a/520ApkBox/BCore/black-fake/.gitignore b/520ApkBox-NewBlackbox/Bcore/.gitignore
similarity index 100%
rename from 520ApkBox/BCore/black-fake/.gitignore
rename to 520ApkBox-NewBlackbox/Bcore/.gitignore
diff --git a/520ApkBox-NewBlackbox/Bcore/build.gradle.kts b/520ApkBox-NewBlackbox/Bcore/build.gradle.kts
new file mode 100644
index 0000000..3e45a20
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/build.gradle.kts
@@ -0,0 +1,94 @@
+plugins {
+ id("com.android.library")
+ id("org.jetbrains.kotlin.android")
+}
+
+android {
+
+ namespace = "com.vcore"
+ compileSdk = (rootProject.ext["compileSdk"] as Int)
+
+
+ defaultConfig {
+ minSdk = (rootProject.ext["minSdk"] as Int)
+ consumerProguardFiles("consumer-rules.pro")
+ vectorDrawables {
+ useSupportLibrary = true
+ }
+
+ ndk.apply{
+ abiFilters.add("armeabi-v7a")
+ abiFilters.add("arm64-v8a")
+ }
+ // signingConfig = signingConfigs.getByName("debug")
+
+ }
+ val cmake = rootProject.ext["cmakeVersion"] as String
+ externalNativeBuild {
+ cmake {
+ path = file("src/main/cpp/CMakeLists.txt")
+ version = cmake
+ }
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false //not tested yet
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+ debug {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ }
+ kotlinOptions {
+ jvmTarget = "17"
+ }
+ buildFeatures{
+ aidl = true
+ prefab = true
+ viewBinding = true
+ }
+
+ packagingOptions.apply {
+ jniLibs {
+ // 排除所有其他文件模式
+ excludes.add("**/libshadowhook.so")
+ }
+ }
+
+}
+
+// it make update dependency update easy
+val ktxversion = "1.13.1"
+val stdlib_version = "1.9.24"
+val hiddenapibypass = "4.3"
+val xcrashversion = "3.1.0"
+val shadowhook = "1.0.9"
+val googlematerial = "1.12.0"
+
+
+dependencies {
+ implementation("androidx.appcompat:appcompat") {
+ exclude(group = "com.android.support", module = "support-compat")
+ }
+ implementation("androidx.core:core-ktx:$ktxversion")
+ implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$stdlib_version")
+ implementation ("com.iqiyi.xcrash:xcrash-android-lib:$xcrashversion")
+ implementation("com.google.android.material:material:$googlematerial")
+ implementation ("org.lsposed.hiddenapibypass:hiddenapibypass:$hiddenapibypass")
+ implementation("com.bytedance.android:shadowhook:$shadowhook")
+ implementation ("top.canyie.pine:core:0.2.9")
+ implementation ("top.canyie.pine:xposed:0.1.0")
+
+}
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/consumer-rules.pro b/520ApkBox-NewBlackbox/Bcore/consumer-rules.pro
new file mode 100644
index 0000000..f46cc03
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/consumer-rules.pro
@@ -0,0 +1,5 @@
+
+-keep class com.vcore.** {*; }
+-keep class black.** {*; }
+-keep class android.** {*; }
+-keep class com.android.** {*; }
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/proguard-rules.pro b/520ApkBox-NewBlackbox/Bcore/proguard-rules.pro
new file mode 100644
index 0000000..8bdd86e
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/proguard-rules.pro
@@ -0,0 +1,5 @@
+
+-keep class com.vcore.** {*; }
+-keep class black.** {*; }
+-keep class android.** {*; }
+-keep class com.android.** {*; }
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/AndroidManifest.xml b/520ApkBox-NewBlackbox/Bcore/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b2faeef
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/AndroidManifest.xml
@@ -0,0 +1,2457 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/accounts/IAccountAuthenticator.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/accounts/IAccountAuthenticator.aidl
similarity index 80%
rename from 520ApkBox/android-mirror/src/main/aidl/android/accounts/IAccountAuthenticator.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/accounts/IAccountAuthenticator.aidl
index fe5c9ea..7d19a1f 100644
--- a/520ApkBox/android-mirror/src/main/aidl/android/accounts/IAccountAuthenticator.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/accounts/IAccountAuthenticator.aidl
@@ -1,19 +1,3 @@
-/*
- * Copyright (C) 2009 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.accounts;
import android.accounts.IAccountAuthenticatorResponse;
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/accounts/IAccountAuthenticatorResponse.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/accounts/IAccountAuthenticatorResponse.aidl
new file mode 100644
index 0000000..5de0175
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/accounts/IAccountAuthenticatorResponse.aidl
@@ -0,0 +1,11 @@
+package android.accounts;
+import android.os.Bundle;
+
+/**
+ * The interface used to return responses from an {@link IAccountAuthenticator}
+ */
+interface IAccountAuthenticatorResponse {
+ void onResult(in Bundle value);
+ void onRequestContinued();
+ void onError(int errorCode, String errorMessage);
+}
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/accounts/IAccountManagerResponse.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/accounts/IAccountManagerResponse.aidl
similarity index 100%
rename from 520ApkBox/android-mirror/src/main/aidl/android/accounts/IAccountManagerResponse.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/accounts/IAccountManagerResponse.aidl
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/app/IActivityManager/ContentProviderHolder.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/IActivityManager/ContentProviderHolder.aidl
similarity index 100%
rename from 520ApkBox/android-mirror/src/main/aidl/android/app/IActivityManager/ContentProviderHolder.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/IActivityManager/ContentProviderHolder.aidl
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/IServiceConnection.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/IServiceConnection.aidl
new file mode 100644
index 0000000..9cf84c8
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/IServiceConnection.aidl
@@ -0,0 +1,8 @@
+package android.app;
+
+import android.content.ComponentName;
+
+/** @hide */
+interface IServiceConnection {
+ void connected(in ComponentName name, IBinder service);
+}
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/IStopUserCallback.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/IStopUserCallback.aidl
new file mode 100644
index 0000000..a6f1cc0
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/IStopUserCallback.aidl
@@ -0,0 +1,10 @@
+package android.app;
+
+/**
+ * Callback to find out when we have finished stopping a user.
+ * {@hide}
+ */
+interface IStopUserCallback {
+ void userStopped(int userId);
+ void userStopAborted(int userId);
+}
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/IWallpaperManagerCallback.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/IWallpaperManagerCallback.aidl
new file mode 100644
index 0000000..19ac832
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/IWallpaperManagerCallback.aidl
@@ -0,0 +1,6 @@
+package android.app;
+
+/** @hide */
+interface IWallpaperManagerCallback {
+ void onWallpaperChanged();
+}
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/job/IJobCallback.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/job/IJobCallback.aidl
new file mode 100644
index 0000000..6512138
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/job/IJobCallback.aidl
@@ -0,0 +1,46 @@
+package android.app.job;
+
+import android.app.job.JobWorkItem;
+
+/**
+ * The server side of the JobScheduler IPC protocols. The app-side implementation
+ * invokes on this interface to indicate completion of the (asynchronous) instructions
+ * issued by the server.
+ *
+ * In all cases, the 'who' parameter is the caller's service binder, used to track
+ * which Job Service instance is reporting.
+ *
+ */
+interface IJobCallback {
+ /**
+ * Immediate callback to the system after sending a start signal, used to quickly detect ANR.
+ *
+ * @param jobId Unique integer used to identify this job.
+ * @param ongoing True to indicate that the client is processing the job. False if the job is
+ * complete
+ */
+ void acknowledgeStartMessage(int jobId, boolean ongoing);
+ /**
+ * Immediate callback to the system after sending a stop signal, used to quickly detect ANR.
+ *
+ * @param jobId Unique integer used to identify this job.
+ * @param reschedule Whether or not to reschedule this job.
+ */
+ void acknowledgeStopMessage(int jobId, boolean reschedule);
+ /*
+ * Called to deqeue next work item for the job.
+ */
+ JobWorkItem dequeueWork(int jobId);
+ /*
+ * Called to report that job has completed processing a work item.
+ */
+ boolean completeWork(int jobId, int workId);
+ /*
+ * Tell the job manager that the client is done with its execution, so that it can go on to
+ * the next one and stop attributing wakelock time to us etc.
+ *
+ * @param jobId Unique integer used to identify this job.
+ * @param reschedule Whether or not to reschedule this job.
+ */
+ void jobFinished(int jobId, boolean reschedule);
+}
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/app/job/IJobService.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/job/IJobService.aidl
similarity index 100%
rename from 520ApkBox/android-mirror/src/main/aidl/android/app/job/IJobService.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/job/IJobService.aidl
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/job/JobWorkItem.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/job/JobWorkItem.aidl
new file mode 100644
index 0000000..05f3cf9
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/app/job/JobWorkItem.aidl
@@ -0,0 +1,4 @@
+// JobWorkItem.aidl
+package android.app.job;
+
+parcelable JobWorkItem;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/IIntentReceiver.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/IIntentReceiver.aidl
new file mode 100644
index 0000000..2c9949d
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/IIntentReceiver.aidl
@@ -0,0 +1,15 @@
+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.
+ *
+ */
+interface IIntentReceiver {
+ void performReceive(in Intent intent, int resultCode, String data,
+ in Bundle extras, boolean ordered, boolean sticky, int sendingUser);
+}
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/ISyncAdapter.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/ISyncAdapter.aidl
new file mode 100644
index 0000000..8ca515c
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/ISyncAdapter.aidl
@@ -0,0 +1,38 @@
+package android.content;
+
+import android.accounts.Account;
+import android.os.Bundle;
+import android.content.ISyncContext;
+
+/**
+ * Interface used to control the sync activity on a SyncAdapter
+ */
+interface ISyncAdapter {
+ /**
+ * Initiate a sync for this account. SyncAdapter-specific parameters may
+ * be specified in extras, which is guaranteed to not be null.
+ *
+ * @param syncContext the ISyncContext used to indicate the progress of the sync. When
+ * the sync is finished (successfully or not) ISyncContext.onFinished() must be called.
+ * @param authority the authority that should be synced
+ * @param account the account that should be synced
+ * @param extras SyncAdapter-specific parameters
+ */
+ void startSync(ISyncContext syncContext, String authority,
+ in Account account, in Bundle extras);
+
+ /**
+ * Cancel the most recently initiated sync. Due to race conditions, this may arrive
+ * after the ISyncContext.onFinished() for that sync was called.
+ * @param syncContext the ISyncContext that was passed to {@link #startSync}
+ */
+ void cancelSync(ISyncContext syncContext);
+
+ /**
+ * Initialize the SyncAdapter for this account and authority.
+ *
+ * @param account the account that should be synced
+ * @param authority the authority that should be synced
+ */
+ void initialize(in Account account, String authority);
+}
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/ISyncContext.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/ISyncContext.aidl
new file mode 100644
index 0000000..a1b4460
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/ISyncContext.aidl
@@ -0,0 +1,22 @@
+package android.content;
+
+import android.content.SyncResult;
+
+/**
+ * Interface used by the SyncAdapter to indicate its progress.
+ * @hide
+ */
+interface ISyncContext {
+ /**
+ * Call to indicate that the SyncAdapter is making progress. E.g., if this SyncAdapter
+ * downloads or sends records to/from the server, this may be called after each record
+ * is downloaded or uploaded.
+ */
+ void sendHeartbeat();
+
+ /**
+ * Signal that the corresponding sync session is completed.
+ * @param result information about this sync session
+ */
+ void onFinished(in SyncResult result);
+}
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/content/ISyncStatusObserver.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/ISyncStatusObserver.aidl
similarity index 98%
rename from 520ApkBox/android-mirror/src/main/aidl/android/content/ISyncStatusObserver.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/ISyncStatusObserver.aidl
index 88ea23a..9c718c9 100644
--- a/520ApkBox/android-mirror/src/main/aidl/android/content/ISyncStatusObserver.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/ISyncStatusObserver.aidl
@@ -1,6 +1,5 @@
package android.content;
-
interface ISyncStatusObserver {
void onStatusChanged(int which);
}
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/content/SyncStatusInfo.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/SyncStatusInfo.aidl
similarity index 100%
rename from 520ApkBox/android-mirror/src/main/aidl/android/content/SyncStatusInfo.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/SyncStatusInfo.aidl
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/content/pm/IPackageDataObserver.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageDataObserver.aidl
similarity index 100%
rename from 520ApkBox/android-mirror/src/main/aidl/android/content/pm/IPackageDataObserver.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageDataObserver.aidl
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageDeleteObserver2.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageDeleteObserver2.aidl
new file mode 100644
index 0000000..5e829d7
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageDeleteObserver2.aidl
@@ -0,0 +1,8 @@
+package android.content.pm;
+
+import android.content.Intent;
+
+interface IPackageDeleteObserver2 {
+ void onUserActionRequired(in Intent intent);
+ void onPackageDeleted(String packageName, int returnCode, String msg);
+}
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/content/pm/IPackageInstallObserver.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageInstallObserver.aidl
similarity index 99%
rename from 520ApkBox/android-mirror/src/main/aidl/android/content/pm/IPackageInstallObserver.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageInstallObserver.aidl
index 4ec7d4b..7b82182 100644
--- a/520ApkBox/android-mirror/src/main/aidl/android/content/pm/IPackageInstallObserver.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageInstallObserver.aidl
@@ -6,4 +6,3 @@ package android.content.pm;
interface IPackageInstallObserver {
void packageInstalled(in String packageName, int returnCode);
}
-
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageInstallObserver2.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageInstallObserver2.aidl
new file mode 100644
index 0000000..696ed12
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageInstallObserver2.aidl
@@ -0,0 +1,29 @@
+package android.content.pm;
+
+import android.content.Intent;
+import android.os.Bundle;
+
+/**
+ * API for installation callbacks from the Package Manager. In certain result cases
+ * additional information will be provided.
+ */
+interface IPackageInstallObserver2 {
+ void onUserActionRequired(in Intent intent);
+
+ /**
+ * The install operation has completed. {@code returnCode} holds a numeric code
+ * indicating success or failure. In certain cases the {@code extras} Bundle will
+ * contain additional details:
+ *
+ *
+ *
+ *
INSTALL_FAILED_DUPLICATE_PERMISSION
+ *
Two strings are provided in the extras bundle: EXTRA_EXISTING_PERMISSION
+ * is the name of the permission that the app is attempting to define, and
+ * EXTRA_EXISTING_PACKAGE is the package name of the app which has already
+ * defined the permission.
+ *
+ *
+ */
+ void onPackageInstalled(String basePackageName, int returnCode, String msg, in Bundle extras);
+}
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/content/pm/IPackageInstallerCallback.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageInstallerCallback.aidl
similarity index 100%
rename from 520ApkBox/android-mirror/src/main/aidl/android/content/pm/IPackageInstallerCallback.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageInstallerCallback.aidl
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/content/pm/IPackageInstallerSession.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageInstallerSession.aidl
similarity index 100%
rename from 520ApkBox/android-mirror/src/main/aidl/android/content/pm/IPackageInstallerSession.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/content/pm/IPackageInstallerSession.aidl
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/database/IContentObserver.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/database/IContentObserver.aidl
similarity index 92%
rename from 520ApkBox/android-mirror/src/main/aidl/android/database/IContentObserver.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/database/IContentObserver.aidl
index e395dc7..01b116d 100644
--- a/520ApkBox/android-mirror/src/main/aidl/android/database/IContentObserver.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/database/IContentObserver.aidl
@@ -2,8 +2,7 @@ package android.database;
import android.net.Uri;
-interface IContentObserver
-{
+interface IContentObserver {
/**
* This method is called when an update occurs to the cursor that is being
* observed. selfUpdate is true if the update was caused by a call to
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/location/ILocationListener.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/location/ILocationListener.aidl
similarity index 91%
rename from 520ApkBox/android-mirror/src/main/aidl/android/location/ILocationListener.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/location/ILocationListener.aidl
index 1571ae2..1d4ffcb 100644
--- a/520ApkBox/android-mirror/src/main/aidl/android/location/ILocationListener.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/location/ILocationListener.aidl
@@ -4,10 +4,9 @@ package android.location;
import android.location.Location;
import android.os.Bundle;
-interface ILocationListener
-{
+interface ILocationListener {
void onLocationChanged(in Location location);
void onStatusChanged(String provider, int status, in Bundle extras);
void onProviderEnabled(String provider);
void onProviderDisabled(String provider);
-}
\ No newline at end of file
+}
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/net/IConnectivityManager.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/net/IConnectivityManager.aidl
similarity index 92%
rename from 520ApkBox/android-mirror/src/main/aidl/android/net/IConnectivityManager.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/net/IConnectivityManager.aidl
index b60a420..dea1546 100644
--- a/520ApkBox/android-mirror/src/main/aidl/android/net/IConnectivityManager.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/net/IConnectivityManager.aidl
@@ -4,7 +4,7 @@ import android.net.NetworkInfo;
import android.net.LinkProperties;
interface IConnectivityManager {
-NetworkInfo getActiveNetworkInfo();
+ NetworkInfo getActiveNetworkInfo();
NetworkInfo getActiveNetworkInfoForUid(int uid, boolean ignoreBlocked);
NetworkInfo getNetworkInfo(int networkType);
@@ -13,4 +13,4 @@ NetworkInfo getActiveNetworkInfo();
boolean requestRouteToHostAddress(int networkType, int address);
LinkProperties getActiveLinkProperties();
LinkProperties getLinkProperties(int networkType);
-}
\ No newline at end of file
+}
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/net/wifi/IWifiScanner.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/net/wifi/IWifiScanner.aidl
similarity index 85%
rename from 520ApkBox/android-mirror/src/main/aidl/android/net/wifi/IWifiScanner.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/net/wifi/IWifiScanner.aidl
index 3e71a5f..5d654b8 100644
--- a/520ApkBox/android-mirror/src/main/aidl/android/net/wifi/IWifiScanner.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/net/wifi/IWifiScanner.aidl
@@ -3,9 +3,7 @@ package android.net.wifi;
import android.os.Messenger;
import android.os.Bundle;
-interface IWifiScanner
-{
+interface IWifiScanner {
Messenger getMessenger();
-
Bundle getAvailableChannels(int band);
}
diff --git a/520ApkBox/android-mirror/src/main/aidl/android/os/ISystemUpdateManager.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/os/ISystemUpdateManager.aidl
similarity index 99%
rename from 520ApkBox/android-mirror/src/main/aidl/android/os/ISystemUpdateManager.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/os/ISystemUpdateManager.aidl
index cfce210..3ce3285 100644
--- a/520ApkBox/android-mirror/src/main/aidl/android/os/ISystemUpdateManager.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/android/os/ISystemUpdateManager.aidl
@@ -6,4 +6,4 @@ import android.os.PersistableBundle;
interface ISystemUpdateManager {
Bundle retrieveSystemUpdateInfo();
void updateSystemUpdateInfo(in PersistableBundle data);
-}
\ No newline at end of file
+}
diff --git a/520ApkBox/android-mirror/src/main/aidl/com/android/internal/widget/ILockSettings.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/android/internal/widget/ILockSettings.aidl
similarity index 98%
rename from 520ApkBox/android-mirror/src/main/aidl/com/android/internal/widget/ILockSettings.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/android/internal/widget/ILockSettings.aidl
index 7c725f8..6ebc673 100644
--- a/520ApkBox/android-mirror/src/main/aidl/com/android/internal/widget/ILockSettings.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/android/internal/widget/ILockSettings.aidl
@@ -3,4 +3,4 @@ package com.android.internal.widget;
interface ILockSettings {
void setRecoverySecretTypes(in int[] secretTypes);
int[] getRecoverySecretTypes();
-}
\ No newline at end of file
+}
diff --git a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/IBActivityThread.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/IBActivityThread.aidl
similarity index 88%
rename from 520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/IBActivityThread.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/IBActivityThread.aidl
index 8e9530d..2704177 100644
--- a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/IBActivityThread.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/IBActivityThread.aidl
@@ -1,5 +1,5 @@
// IBActivityThread.aidl
-package top.niunaijun.blackbox.core;
+package com.vcore.core;
// Declare any non-default types here with import statements
@@ -9,7 +9,7 @@ import android.content.Intent;
import java.util.List;
import android.content.pm.ResolveInfo;
import android.content.pm.ActivityInfo;
-import top.niunaijun.blackbox.entity.am.ReceiverData;
+import com.vcore.entity.am.ReceiverData;
interface IBActivityThread {
IBinder getActivityThread();
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/IEmpty.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/IEmpty.aidl
new file mode 100644
index 0000000..8ed4449
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/IEmpty.aidl
@@ -0,0 +1,7 @@
+// IBActivityThread.aidl
+package com.vcore.core;
+
+// Declare any non-default types here with import statements
+interface IEmpty {
+
+}
diff --git a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/accounts/IBAccountManagerService.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/accounts/IBAccountManagerService.aidl
similarity index 92%
rename from 520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/accounts/IBAccountManagerService.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/accounts/IBAccountManagerService.aidl
index f2f577a..ae7af25 100644
--- a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/accounts/IBAccountManagerService.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/accounts/IBAccountManagerService.aidl
@@ -1,4 +1,4 @@
-package top.niunaijun.blackbox.core.system.accounts;
+package com.vcore.core.system.accounts;
import android.accounts.IAccountManagerResponse;
import android.accounts.Account;
@@ -10,7 +10,6 @@ import android.os.UserHandle;
import java.util.Map;
-
interface IBAccountManagerService {
String getPassword(in Account account, int userId);
String getUserData(in Account account, String key, int userId);
@@ -68,10 +67,10 @@ interface IBAccountManagerService {
void unregisterAccountListener(in String[] accountTypes, String opPackageName, int userId);
/* Check if the package in a user can access an account */
-// boolean hasAccountAccess(in Account account, String packageName, in UserHandle userHandle);
+ // boolean hasAccountAccess(in Account account, String packageName, in UserHandle userHandle);
/* Crate an intent to request account access for package and a given user id */
-// IntentSender createRequestAccountAccessIntentSenderAsUser(in Account account,
-// String packageName, in UserHandle userHandle);
+ // IntentSender createRequestAccountAccessIntentSenderAsUser(in Account account,
+ // String packageName, in UserHandle userHandle);
-// void onAccountAccessed(String token);
+ // void onAccountAccessed(String token);
}
diff --git a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/am/IBActivityManagerService.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/am/IBActivityManagerService.aidl
similarity index 84%
rename from 520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/am/IBActivityManagerService.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/am/IBActivityManagerService.aidl
index 5c7245e..d1c08f4 100644
--- a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/am/IBActivityManagerService.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/am/IBActivityManagerService.aidl
@@ -1,5 +1,5 @@
// IBActivityManagerService.aidl
-package top.niunaijun.blackbox.core.system.am;
+package com.vcore.core.system.am;
import android.content.Intent;
import android.content.ComponentName;
@@ -8,15 +8,14 @@ import android.content.pm.ProviderInfo;
import android.os.IBinder;
import java.lang.String;
import android.app.IServiceConnection;
-import top.niunaijun.blackbox.entity.AppConfig;
-import top.niunaijun.blackbox.entity.UnbindRecord;
+import com.vcore.entity.AppConfig;
+import com.vcore.entity.UnbindRecord;
import android.os.Bundle;
-import top.niunaijun.blackbox.entity.am.RunningAppProcessInfo;
-import top.niunaijun.blackbox.entity.am.PendingResultData;
-import top.niunaijun.blackbox.entity.am.RunningServiceInfo;
+import com.vcore.entity.am.RunningAppProcessInfo;
+import com.vcore.entity.am.PendingResultData;
+import com.vcore.entity.am.RunningServiceInfo;
// Declare any non-default types here with import statements
-
interface IBActivityManagerService {
AppConfig initProcess(String packageName, String processName, int userId);
void restartProcess(String packageName, String processName, int userId);
@@ -33,7 +32,6 @@ interface IBActivityManagerService {
void stopServiceToken(in ComponentName className, in IBinder token, int userId);
- void onStartCommand(in Intent proxyIntent, int userId);
UnbindRecord onServiceUnbind(in Intent proxyIntent, int userId);
void onServiceDestroy(in Intent proxyIntent, int userId);
@@ -41,7 +39,7 @@ interface IBActivityManagerService {
Intent sendBroadcast(in Intent intent, String resolvedType, int userId);
IBinder peekService(in Intent intent, String resolvedType, int userId);
- void onActivityCreated(int taskId, IBinder token, IBinder activityRecord);
+ void onActivityCreated(int taskId, IBinder token, String activityToken);
void onActivityResumed(IBinder token);
void onActivityDestroyed(IBinder token);
void onFinishActivity(IBinder token);
diff --git a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/am/IBJobManagerService.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/am/IBJobManagerService.aidl
similarity index 84%
rename from 520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/am/IBJobManagerService.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/am/IBJobManagerService.aidl
index 97d9b36..9fd9b29 100644
--- a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/am/IBJobManagerService.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/am/IBJobManagerService.aidl
@@ -1,19 +1,17 @@
// IBJobManagerService.aidl
-package top.niunaijun.blackbox.core.system.am;
+package com.vcore.core.system.am;
import android.content.Intent;
import android.content.ComponentName;
import android.os.IBinder;
import java.lang.String;
import android.app.job.JobInfo;
-import top.niunaijun.blackbox.entity.JobRecord;
+import com.vcore.entity.JobRecord;
// Declare any non-default types here with import statements
-
interface IBJobManagerService {
JobInfo schedule(in JobInfo info, int userId);
JobRecord queryJobRecord(String processName, int jobId, int userId);
void cancelAll(String processName, int userId);
int cancel(String processName, int jobId, int userId);
-
}
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/device/IDeviceManagerService.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/device/IDeviceManagerService.aidl
new file mode 100644
index 0000000..c4efcea
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/device/IDeviceManagerService.aidl
@@ -0,0 +1,12 @@
+// IDeviceManagerService.aidl
+package com.vcore.core.system.device;
+
+// Declare any non-default types here with import statements
+interface IDeviceManagerService {
+ /**
+ * Demonstrates some basic types that you can use as parameters
+ * and return values in AIDL.
+ */
+ void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
+ double aDouble, String aString);
+}
\ No newline at end of file
diff --git a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/location/IBLocationManagerService.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/location/IBLocationManagerService.aidl
similarity index 86%
rename from 520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/location/IBLocationManagerService.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/location/IBLocationManagerService.aidl
index a7de050..34304b6 100644
--- a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/location/IBLocationManagerService.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/location/IBLocationManagerService.aidl
@@ -1,12 +1,11 @@
// IFakeLocationManager.aidl
-package top.niunaijun.blackbox.core.system.location;
+package com.vcore.core.system.location;
-import top.niunaijun.blackbox.entity.location.BLocation;
-import top.niunaijun.blackbox.entity.location.BCell;
+import com.vcore.entity.location.BLocation;
+import com.vcore.entity.location.BCell;
import java.util.List;
-
interface IBLocationManagerService {
int getPattern(int userId, String pkg);
diff --git a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/notification/IBNotificationManagerService.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/notification/IBNotificationManagerService.aidl
similarity index 94%
rename from 520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/notification/IBNotificationManagerService.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/notification/IBNotificationManagerService.aidl
index 8de080d..52f4bb8 100644
--- a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/notification/IBNotificationManagerService.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/notification/IBNotificationManagerService.aidl
@@ -1,5 +1,5 @@
// IBNotificationManagerService.aidl
-package top.niunaijun.blackbox.core.system.notification;
+package com.vcore.core.system.notification;
// Declare any non-default types here with import statements
import android.app.Notification;
@@ -7,7 +7,6 @@ import android.app.NotificationChannel;
import android.app.NotificationChannelGroup;
interface IBNotificationManagerService {
-
NotificationChannel getNotificationChannel(String channelId, int userId);
List getNotificationChannels(String packageName, int userId);
diff --git a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/os/IBStorageManagerService.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/os/IBStorageManagerService.aidl
similarity index 87%
rename from 520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/os/IBStorageManagerService.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/os/IBStorageManagerService.aidl
index 8b9e915..d97fc6b 100644
--- a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/os/IBStorageManagerService.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/os/IBStorageManagerService.aidl
@@ -1,12 +1,11 @@
// IBStorageManagerService.aidl
-package top.niunaijun.blackbox.core.system.os;
+package com.vcore.core.system.os;
import android.os.storage.StorageVolume;
import java.lang.String;
import android.net.Uri;
// Declare any non-default types here with import statements
-
interface IBStorageManagerService {
StorageVolume[] getVolumeList(int uid, String packageName, int flags, int userId);
Uri getUriForFile(String file);
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/pm/BPackageSettings.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/pm/BPackageSettings.aidl
new file mode 100644
index 0000000..21ff1bc
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/pm/BPackageSettings.aidl
@@ -0,0 +1,5 @@
+// BPackageSettings.aidl
+package com.vcore.core.system.pm;
+
+// Declare any non-default types here with import statements
+parcelable BPackageSettings;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/pm/IBPackageInstallerService.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/pm/IBPackageInstallerService.aidl
new file mode 100644
index 0000000..c109597
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/pm/IBPackageInstallerService.aidl
@@ -0,0 +1,13 @@
+// IBPackageInstallerService.aidl
+package com.vcore.core.system.pm;
+
+import com.vcore.core.system.pm.BPackageSettings;
+import com.vcore.entity.pm.InstallOption;
+
+// Declare any non-default types here with import statements
+interface IBPackageInstallerService {
+ int installPackageAsUser(in BPackageSettings ps, int userId);
+ int uninstallPackageAsUser(in BPackageSettings ps, boolean removeApp, int userId);
+ int clearPackage(in BPackageSettings ps, int userId);
+ int updatePackage(in BPackageSettings ps);
+}
diff --git a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/pm/IBPackageManagerService.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/pm/IBPackageManagerService.aidl
similarity index 91%
rename from 520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/pm/IBPackageManagerService.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/pm/IBPackageManagerService.aidl
index 1613405..05c73d5 100644
--- a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/pm/IBPackageManagerService.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/pm/IBPackageManagerService.aidl
@@ -1,5 +1,5 @@
// IBPackageManagerService.aidl
-package top.niunaijun.blackbox.core.system.pm;
+package com.vcore.core.system.pm;
// Declare any non-default types here with import statements
import android.content.pm.ApplicationInfo;
@@ -11,12 +11,13 @@ import android.content.pm.ProviderInfo;
import android.content.Intent;
import android.content.ComponentName;
import java.util.List;
-import top.niunaijun.blackbox.entity.pm.InstallResult;
-import top.niunaijun.blackbox.entity.pm.InstallOption;
-import top.niunaijun.blackbox.entity.pm.InstalledPackage;
-
+import com.vcore.entity.pm.InstallResult;
+import com.vcore.entity.pm.InstallOption;
+import com.vcore.entity.pm.InstalledPackage;
interface IBPackageManagerService {
+ int getUidByPid(int pid);
+
ResolveInfo resolveService(in Intent intent, int flags, String resolvedType, int userId);
ResolveInfo resolveActivity(in Intent intent, int flags, String resolvedType, int userId);
ProviderInfo resolveContentProvider(String authority, int flag, int userId);
diff --git a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/pm/IBXposedManagerService.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/pm/IBXposedManagerService.aidl
similarity index 75%
rename from 520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/pm/IBXposedManagerService.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/pm/IBXposedManagerService.aidl
index 86fa504..9196275 100644
--- a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/pm/IBXposedManagerService.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/pm/IBXposedManagerService.aidl
@@ -1,9 +1,9 @@
// IBXposedManagerService.aidl
-package top.niunaijun.blackbox.core.system.pm;
+package com.vcore.core.system.pm;
import java.util.List;
-import top.niunaijun.blackbox.entity.pm.InstalledModule;
+import com.vcore.entity.pm.InstalledModule;
interface IBXposedManagerService {
boolean isXPEnable();
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/user/BUserInfo.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/user/BUserInfo.aidl
new file mode 100644
index 0000000..042c01a
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/user/BUserInfo.aidl
@@ -0,0 +1,5 @@
+// BUserInfo.aidl
+package com.vcore.core.system.user;
+
+// Declare any non-default types here with import statements
+parcelable BUserInfo;
diff --git a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/user/IBUserManagerService.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/user/IBUserManagerService.aidl
similarity index 75%
rename from 520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/user/IBUserManagerService.aidl
rename to 520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/user/IBUserManagerService.aidl
index 896e865..d5f7fbb 100644
--- a/520ApkBox/Bcore/src/main/aidl/top/niunaijun/blackbox/core/system/user/IBUserManagerService.aidl
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/core/system/user/IBUserManagerService.aidl
@@ -1,11 +1,10 @@
// IBUserManagerService.aidl
-package top.niunaijun.blackbox.core.system.user;
+package com.vcore.core.system.user;
// Declare any non-default types here with import statements
-import top.niunaijun.blackbox.core.system.user.BUserInfo;
+import com.vcore.core.system.user.BUserInfo;
import java.util.List;
-
interface IBUserManagerService {
BUserInfo getUserInfo(int userId);
boolean exists(int userId);
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/AppConfig.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/AppConfig.aidl
new file mode 100644
index 0000000..4ecff2f
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/AppConfig.aidl
@@ -0,0 +1,5 @@
+// AppConfig.aidl
+package com.vcore.entity;
+
+// Declare any non-default types here with import statements
+parcelable AppConfig;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/JobRecord.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/JobRecord.aidl
new file mode 100644
index 0000000..4884e8a
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/JobRecord.aidl
@@ -0,0 +1,5 @@
+// JobRecord.aidl
+package com.vcore.entity;
+
+// Declare any non-default types here with import statements
+parcelable JobRecord;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/UnbindRecord.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/UnbindRecord.aidl
new file mode 100644
index 0000000..f105d4e
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/UnbindRecord.aidl
@@ -0,0 +1,3 @@
+package com.vcore.entity;
+
+parcelable UnbindRecord;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/am/PendingResultData.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/am/PendingResultData.aidl
new file mode 100644
index 0000000..f3884e1
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/am/PendingResultData.aidl
@@ -0,0 +1,3 @@
+package com.vcore.entity.am;
+
+parcelable PendingResultData;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/am/ReceiverData.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/am/ReceiverData.aidl
new file mode 100644
index 0000000..06f2a97
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/am/ReceiverData.aidl
@@ -0,0 +1,3 @@
+package com.vcore.entity.am;
+
+parcelable ReceiverData;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/am/RunningAppProcessInfo.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/am/RunningAppProcessInfo.aidl
new file mode 100644
index 0000000..07af8a4
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/am/RunningAppProcessInfo.aidl
@@ -0,0 +1,3 @@
+package com.vcore.entity.am;
+
+parcelable RunningAppProcessInfo;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/am/RunningServiceInfo.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/am/RunningServiceInfo.aidl
new file mode 100644
index 0000000..76c918f
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/am/RunningServiceInfo.aidl
@@ -0,0 +1,3 @@
+package com.vcore.entity.am;
+
+parcelable RunningServiceInfo;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/device/BDeviceConfig.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/device/BDeviceConfig.aidl
new file mode 100644
index 0000000..38a47b9
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/device/BDeviceConfig.aidl
@@ -0,0 +1,5 @@
+// BDeviceConfig.aidl
+package com.vcore.entity.device;
+
+// Declare any non-default types here with import statements
+parcelable BDeviceConfig;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/location/BCell.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/location/BCell.aidl
new file mode 100644
index 0000000..05c4f71
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/location/BCell.aidl
@@ -0,0 +1,3 @@
+package com.vcore.entity.location;
+
+parcelable BCell;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/location/BLocation.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/location/BLocation.aidl
new file mode 100644
index 0000000..9d22312
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/location/BLocation.aidl
@@ -0,0 +1,4 @@
+package com.vcore.entity.location;
+
+// Declare any non-default types here with import statements
+parcelable BLocation;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/location/BLocationConfig.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/location/BLocationConfig.aidl
new file mode 100644
index 0000000..133d461
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/location/BLocationConfig.aidl
@@ -0,0 +1,3 @@
+package com.vcore.entity.location;
+
+parcelable BLocationConfig;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/pm/InstallOption.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/pm/InstallOption.aidl
new file mode 100644
index 0000000..bf2f7f4
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/pm/InstallOption.aidl
@@ -0,0 +1,3 @@
+package com.vcore.entity.pm;
+
+parcelable InstallOption;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/pm/InstallResult.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/pm/InstallResult.aidl
new file mode 100644
index 0000000..7901163
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/pm/InstallResult.aidl
@@ -0,0 +1,3 @@
+package com.vcore.entity.pm;
+
+parcelable InstallResult;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/pm/InstalledModule.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/pm/InstalledModule.aidl
new file mode 100644
index 0000000..d3ed2e0
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/pm/InstalledModule.aidl
@@ -0,0 +1,3 @@
+package com.vcore.entity.pm;
+
+parcelable InstalledModule;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/pm/InstalledPackage.aidl b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/pm/InstalledPackage.aidl
new file mode 100644
index 0000000..26710de
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/aidl/com/vcore/entity/pm/InstalledPackage.aidl
@@ -0,0 +1,3 @@
+package com.vcore.entity.pm;
+
+parcelable InstalledPackage;
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/BoxCore.cpp b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/BoxCore.cpp
new file mode 100644
index 0000000..023708c
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/BoxCore.cpp
@@ -0,0 +1,143 @@
+#define CORE_CLASS "com/vcore/core/NativeCore"
+#include "BoxCore.h"
+#include "Log.h"
+#include "IO.h"
+#include
+#include "JniHook/JniHook.h"
+#include "Hook/VMClassLoaderHook.h"
+#include "Hook/UnixFileSystemHook.h"
+#include "Hook/LinuxHook.h"
+#include "Hook/SystemPropertiesHook.h"
+#include "Hook/BinderHook.h"
+#include "Hook/RuntimeHook.h"
+
+
+
+struct {
+ JavaVM *vm;
+ jclass NativeCoreClass;
+ jmethodID getCallingUidId;
+ jmethodID redirectPathString;
+ jmethodID redirectPathFile;
+ int api_level;
+} VMEnv;
+
+JNIEnv *getEnv() {
+ JNIEnv *env;
+ VMEnv.vm->GetEnv(reinterpret_cast(&env), JNI_VERSION_1_6);
+ return env;
+}
+
+JNIEnv *ensureEnvCreated() {
+ JNIEnv *env = getEnv();
+ if (env == nullptr) {
+ VMEnv.vm->AttachCurrentThread(&env, nullptr);
+ }
+ return env;
+}
+
+int BoxCore::getCallingUid(int orig) {
+ JNIEnv *env = ensureEnvCreated();
+ return env->CallStaticIntMethod(VMEnv.NativeCoreClass, VMEnv.getCallingUidId, orig);
+}
+
+jstring BoxCore::redirectPathString(JNIEnv *env, jstring path) {
+ env = ensureEnvCreated();
+ return (jstring) env->CallStaticObjectMethod(VMEnv.NativeCoreClass, VMEnv.redirectPathString, path);
+}
+
+jobject BoxCore::redirectPathFile(JNIEnv *env, jobject path) {
+ env = ensureEnvCreated();
+ return env->CallStaticObjectMethod(VMEnv.NativeCoreClass, VMEnv.redirectPathFile, path);
+}
+
+int BoxCore::getApiLevel() {
+ return VMEnv.api_level;
+}
+
+JavaVM *BoxCore::getJavaVM() {
+ return VMEnv.vm;
+}
+
+void nativeHook(JNIEnv *env) {
+ BaseHook::init(env);
+ UnixFileSystemHook::init(env);
+ LinuxHook::init(env);
+ VMClassLoaderHook::init(env);
+
+ // SystemPropertiesHook会引起小米k40,安卓11上的抖音崩溃
+ // SystemPropertiesHook::init(env);
+ RuntimeHook::init(env);
+ BinderHook::init(env);
+}
+
+void hideXposed(JNIEnv *env, jclass clazz) {
+ ALOGD("Hiding Xposed!");
+ VMClassLoaderHook::hideXposed();
+}
+
+void init(JNIEnv *env, jobject clazz, jint api_level) {
+ ALOGD("NativeCore init.");
+ VMEnv.api_level = api_level;
+ VMEnv.NativeCoreClass = (jclass) env->NewGlobalRef(env->FindClass(CORE_CLASS));
+ VMEnv.getCallingUidId = env->GetStaticMethodID(VMEnv.NativeCoreClass, "getCallingUid", "(I)I");
+ VMEnv.redirectPathString = env->GetStaticMethodID(VMEnv.NativeCoreClass, "redirectPath", "(Ljava/lang/String;)Ljava/lang/String;");
+ VMEnv.redirectPathFile = env->GetStaticMethodID(VMEnv.NativeCoreClass, "redirectPath", "(Ljava/io/File;)Ljava/io/File;");
+ JniHook::InitJniHook(env, api_level);
+}
+
+// IO类添加重定向规则
+void addIORule(JNIEnv *env, jclass clazz, jstring target_path, jstring relocate_path) {
+ IO::addRule(env->GetStringUTFChars(target_path, JNI_FALSE),env->GetStringUTFChars(relocate_path, JNI_FALSE));
+}
+
+// IO类添加白名单规则
+void addWhiteList(JNIEnv *env, jclass clazz, jstring path) {
+ IO::addWhiteList(env->GetStringUTFChars(path, JNI_FALSE));
+}
+
+void enableIO(JNIEnv *env, jclass clazz) {
+ nativeHook(env);
+}
+
+static JNINativeMethod gMethods[] = {
+ {"hideXposed", "()V", (void *) hideXposed},
+ {"addIORule", "(Ljava/lang/String;Ljava/lang/String;)V", (void *) addIORule},
+ {"enableIO", "()V", (void *) enableIO},
+ {"init", "(I)V", (void *) init},
+ {"addWhiteList", "(Ljava/lang/String;)V", (void *) addWhiteList},
+};
+
+int registerNativeMethods(JNIEnv *env, const char *className,JNINativeMethod *gMethods, int numMethods) {
+ jclass clazz;
+ clazz = env->FindClass(className);
+ if (clazz == nullptr) {
+ return JNI_FALSE;
+ }
+
+ if (env->RegisterNatives(clazz, gMethods, numMethods) < 0) {
+ return JNI_FALSE;
+ }
+ return JNI_TRUE;
+}
+
+int registerNatives(JNIEnv *env) {
+ if (!registerNativeMethods(env, CORE_CLASS, gMethods, sizeof(gMethods) / sizeof(gMethods[0]))) {
+ return JNI_FALSE;
+ }
+ return JNI_TRUE;
+}
+
+void registerMethod(JNIEnv *jenv) {
+ registerNatives(jenv);
+}
+
+JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) {
+ JNIEnv *env;
+ VMEnv.vm = vm;
+ if (vm->GetEnv(reinterpret_cast(&env), JNI_VERSION_1_6) != JNI_OK) {
+ return JNI_EVERSION;
+ }
+ registerMethod(env);
+ return JNI_VERSION_1_6;
+}
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/BoxCore.h b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/BoxCore.h
new file mode 100644
index 0000000..6069959
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/BoxCore.h
@@ -0,0 +1,19 @@
+#ifndef BLACKBOX_BOXCORE_H
+#define BLACKBOX_BOXCORE_H
+
+#include
+#include
+
+
+class BoxCore {
+public:
+ static JavaVM *getJavaVM();
+ static int getApiLevel();
+ static int getCallingUid(int orig);
+ static jstring redirectPathString(JNIEnv *env, jstring path);
+ static jobject redirectPathFile(JNIEnv *env, jobject path);
+ static void replaceFD(JNIEnv *env, jobject fd);
+};
+
+
+#endif // BLACKBOX_BOXCORE_H
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/CMakeLists.txt b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/CMakeLists.txt
new file mode 100644
index 0000000..62ee679
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/CMakeLists.txt
@@ -0,0 +1,54 @@
+# For more information about using CMake with Android Studio, read the
+# documentation: https://d.android.com/studio/projects/add-native-code.html
+
+# Sets the minimum version of CMake required to build the native library.
+
+cmake_minimum_required(VERSION 3.4.1)
+enable_language(ASM)
+project(vcore)
+
+# Creates and names a library, sets it as either STATIC
+# or SHARED, and provides the relative paths to its source code.
+# You can define multiple libraries, and CMake builds them for you.
+# Gradle automatically packages shared libraries with your APK.
+include_directories(JniHook)
+include_directories(./)
+aux_source_directory(./ SRC1)
+aux_source_directory(Hook SRC2)
+aux_source_directory(JniHook SRC3)
+add_compile_options(-w)
+
+add_library( # Sets the name of the library.
+ vcore
+ # Sets the library as a shared library.
+ SHARED
+ # Provides a relative path to your source file(s).
+ BoxCore.cpp
+ ${SRC1}
+ ${SRC2}
+ ${SRC3})
+
+# Searches for a specified prebuilt library and stores the path as a
+# variable. Because CMake includes system libraries in the search path by
+# default, you only need to specify the name of the public NDK library
+# you want to add. CMake verifies that the library exists before
+# completing its build.
+
+find_library( # Sets the name of the path variable.
+ log-lib
+
+ # Specifies the name of the NDK library that
+ # you want CMake to locate.
+ log)
+
+# Specifies libraries CMake should link to your target library. You
+# can link multiple libraries, such as libraries you define in this
+# build script, prebuilt third-party libraries, or system libraries.
+find_package(shadowhook REQUIRED CONFIG)
+target_link_libraries( # Specifies the target library.
+ vcore
+ # Links the target library to the log library
+ # included in the NDK.
+ ${log-lib}
+ z
+ shadowhook::shadowhook)
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/BaseHook.cpp b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/BaseHook.cpp
new file mode 100644
index 0000000..e7e961a
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/BaseHook.cpp
@@ -0,0 +1,5 @@
+#include "BaseHook.h"
+
+void BaseHook::init(JNIEnv *env) {
+
+}
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/BaseHook.h b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/BaseHook.h
new file mode 100644
index 0000000..6505bfb
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/BaseHook.h
@@ -0,0 +1,12 @@
+#ifndef BLACKBOX_BASEHOOK_H
+#define BLACKBOX_BASEHOOK_H
+
+#include
+#include
+
+class BaseHook {
+public:
+ static void init(JNIEnv *env);
+};
+
+#endif // BLACKBOX_BASEHOOK_H
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/BinderHook.cpp b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/BinderHook.cpp
new file mode 100644
index 0000000..1dd21a3
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/BinderHook.cpp
@@ -0,0 +1,15 @@
+#include "BinderHook.h"
+#include
+#include
+#include "UnixFileSystemHook.h"
+#import "JniHook/JniHook.h"
+
+HOOK_JNI(jint, getCallingUid, JNIEnv *env, jobject obj) {
+ int orig = orig_getCallingUid(env, obj);
+ return BoxCore::getCallingUid(orig);
+}
+
+void BinderHook::init(JNIEnv *env) {
+ const char *clazz = "android/os/Binder";
+ JniHook::HookJniFun(env, clazz, "getCallingUid", "()I", (void *) new_getCallingUid, (void **) (&orig_getCallingUid), true);
+}
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/BinderHook.h b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/BinderHook.h
new file mode 100644
index 0000000..d9cb6ad
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/BinderHook.h
@@ -0,0 +1,11 @@
+#ifndef BLACKBOX_BINDERHOOK_H
+#define BLACKBOX_BINDERHOOK_H
+
+#include "BaseHook.h"
+
+class BinderHook : public BaseHook{
+public:
+ static void init(JNIEnv *env);
+};
+
+#endif // BLACKBOX_BINDERHOOK_H
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/LinuxHook.cpp b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/LinuxHook.cpp
new file mode 100644
index 0000000..7b3150a
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/LinuxHook.cpp
@@ -0,0 +1,189 @@
+#include "LinuxHook.h"
+#import "JniHook/JniHook.h"
+#include "IO.h"
+
+HOOK_JNI(jboolean, access, JNIEnv *env, jobject obj, jstring path, jint mode) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_access(env, obj, redirect, mode);
+}
+
+HOOK_JNI(void, chmod, JNIEnv *env, jobject obj, jstring path, jint mode) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_chmod(env, obj, redirect, mode);
+}
+
+HOOK_JNI(void, chown, JNIEnv *env, jobject obj, jstring path, jint mode, jint gid) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_chown(env, obj, redirect, mode, gid);
+}
+
+HOOK_JNI(void, execv, JNIEnv *env, jobject obj, jstring filename, jobjectArray argv) {
+ jstring redirect = IO::redirectPath(env, filename);
+ return orig_execv(env, obj, redirect, argv);
+}
+
+HOOK_JNI(void, execve, JNIEnv *env, jobject obj, jstring filename, jobjectArray argv, jobjectArray envp) {
+ jstring redirect = IO::redirectPath(env, filename);
+ return orig_execve(env, obj, redirect, argv, envp);
+}
+
+HOOK_JNI(jbyteArray, getxattr, JNIEnv *env, jobject obj, jstring path, jstring name) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_getxattr(env, obj, redirect, name);
+}
+
+HOOK_JNI(void, lchown, JNIEnv *env, jobject obj, jstring path, jint uid, jint gid) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_lchown(env, obj, redirect, uid, gid);
+}
+
+HOOK_JNI(void, link, JNIEnv *env, jobject obj, jstring oldPath, jstring newPath) {
+ jstring redirectOldPath = IO::redirectPath(env, oldPath);
+ jstring redirectNewPath = IO::redirectPath(env, newPath);
+ return orig_link(env, obj, redirectOldPath, redirectNewPath);
+}
+
+HOOK_JNI(jobjectArray, listxattr, JNIEnv *env, jobject obj, jstring path) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_listxattr(env, obj, redirect);
+}
+
+HOOK_JNI(jobject, lstat, JNIEnv *env, jobject obj, jstring path) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_lstat(env, obj, redirect);
+}
+
+HOOK_JNI(void, mkdir, JNIEnv *env, jobject obj, jstring path, jint mode) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_mkdir(env, obj, redirect, mode);
+}
+
+HOOK_JNI(void, mkfifo, JNIEnv *env, jobject obj, jstring path, jint mode) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_mkfifo(env, obj, redirect, mode);
+}
+
+HOOK_JNI(jobject, open, JNIEnv *env, jobject obj, jstring path, jint flags, jint mode) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_open(env, obj, redirect, flags, mode);
+}
+
+HOOK_JNI(jstring, readlink, JNIEnv *env, jobject obj, jstring path) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_readlink(env, obj, redirect);
+}
+
+HOOK_JNI(jstring, realpath, JNIEnv *env, jobject obj, jstring path) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_realpath(env, obj, redirect);
+}
+
+HOOK_JNI(void, remove, JNIEnv *env, jobject obj, jstring path) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_remove(env, obj, redirect);
+}
+
+HOOK_JNI(void, removexattr, JNIEnv *env, jobject obj, jstring path, jstring name) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_removexattr(env, obj, redirect, name);
+}
+
+HOOK_JNI(void, rename, JNIEnv *env, jobject obj, jstring oldPath, jstring newPath) {
+ jstring redirectOldPath = IO::redirectPath(env, oldPath);
+ jstring redirectNewPath = IO::redirectPath(env, newPath);
+ return orig_rename(env, obj, redirectOldPath, redirectNewPath);
+}
+
+HOOK_JNI(void, setxattr, JNIEnv *env, jobject obj, jstring path, jstring name, jbyteArray value, jint flags) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_setxattr(env, obj, redirect, name, value, flags);
+}
+
+HOOK_JNI(jobject, stat, JNIEnv *env, jobject obj, jstring path) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_stat(env, obj, redirect);
+}
+
+HOOK_JNI(jobject, statvfs, JNIEnv *env, jobject obj, jstring path) {
+ jstring redirect = IO::redirectPath(env, path);
+ return orig_statvfs(env, obj, redirect);
+}
+
+HOOK_JNI(void, symlink, JNIEnv *env, jobject obj, jstring oldPath, jstring newPath) {
+ jstring redirectOldPath = IO::redirectPath(env, oldPath);
+ jstring redirectNewPath = IO::redirectPath(env, newPath);
+ return orig_symlink(env, obj, redirectOldPath, redirectNewPath);
+}
+
+HOOK_JNI(void, unlink, JNIEnv *env, jobject obj, jstring pathname) {
+ jstring redirect = IO::redirectPath(env, pathname);
+ return orig_unlink(env, obj, redirect);
+}
+
+void LinuxHook::init(JNIEnv *env) {
+ JniHook::HookJniFun(env, "libcore/io/Linux", "access", "(Ljava/lang/String;I)Z",
+ (void *) new_access, (void **) (&orig_access), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "chmod", "(Ljava/lang/String;I)V",
+ (void *) new_chmod, (void **) (&orig_chmod), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "chown", "(Ljava/lang/String;II)V",
+ (void *) new_chown, (void **) (&orig_chown), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "execv", "(Ljava/lang/String;[Ljava/lang/String;)V",
+ (void *) new_execv, (void **) (&orig_execv), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "execve", "(Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;)V",
+ (void *) new_execve, (void **) (&orig_execve), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "getxattr", "(Ljava/lang/String;Ljava/lang/String;)[B",
+ (void *) new_getxattr, (void **) (&orig_getxattr), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "lchown", "(Ljava/lang/String;II)V",
+ (void *) new_lchown, (void **) (&orig_lchown), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "link", "(Ljava/lang/String;Ljava/lang/String;)V",
+ (void *) new_link, (void **) (&orig_link), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "listxattr", "(Ljava/lang/String;)[Ljava/lang/String;",
+ (void *) new_listxattr, (void **) (&orig_listxattr), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "lstat", "(Ljava/lang/String;)Landroid/system/StructStat;",
+ (void *) new_lstat, (void **) (&orig_lstat), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "mkdir", "(Ljava/lang/String;I)V",
+ (void *) new_mkdir, (void **) (&orig_mkdir), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "mkfifo", "(Ljava/lang/String;I)V",
+ (void *) new_mkfifo, (void **) (&orig_mkfifo), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "open", "(Ljava/lang/String;II)Ljava/io/FileDescriptor;",
+ (void *) new_open, (void **) (&orig_open), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "readlink", "(Ljava/lang/String;)Ljava/lang/String;",
+ (void *) new_readlink, (void **) (&orig_readlink), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "realpath", "(Ljava/lang/String;)Ljava/lang/String;",
+ (void *) new_realpath, (void **) (&orig_realpath), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "remove", "(Ljava/lang/String;)V",
+ (void *) new_remove, (void **) (&orig_remove), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "removexattr", "(Ljava/lang/String;Ljava/lang/String;)V",
+ (void *) new_removexattr, (void **) (&orig_removexattr), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "rename", "(Ljava/lang/String;Ljava/lang/String;)V",
+ (void *) new_rename, (void **) (&orig_rename), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "stat", "(Ljava/lang/String;)Landroid/system/StructStat;",
+ (void *) new_stat, (void **) (&orig_stat), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "statvfs", "(Ljava/lang/String;)Landroid/system/StructStatVfs;",
+ (void *) new_statvfs, (void **) (&orig_statvfs), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "symlink", "(Ljava/lang/String;Ljava/lang/String;)V",
+ (void *) new_symlink, (void **) (&orig_symlink), false);
+
+ JniHook::HookJniFun(env, "libcore/io/Linux", "unlink", "(Ljava/lang/String;)V",
+ (void *) new_unlink, (void **) (&orig_unlink), false);
+}
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/LinuxHook.h b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/LinuxHook.h
new file mode 100644
index 0000000..74f63f5
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/LinuxHook.h
@@ -0,0 +1,11 @@
+#ifndef BLACKBOX_LINUXHOOK_H
+#define BLACKBOX_LINUXHOOK_H
+
+#include "BaseHook.h"
+
+class LinuxHook : public BaseHook {
+public:
+ static void init(JNIEnv *env);
+};
+
+#endif // BLACKBOX_LINUXHOOK_H
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/RuntimeHook.cpp b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/RuntimeHook.cpp
new file mode 100644
index 0000000..a83f56f
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/RuntimeHook.cpp
@@ -0,0 +1,31 @@
+#include "RuntimeHook.h"
+#import "JniHook/JniHook.h"
+#include "BoxCore.h"
+
+HOOK_JNI(jstring, nativeLoad, JNIEnv *env, jobject obj, jstring name, jobject class_loader) {
+ const char *nameC = env->GetStringUTFChars(name, JNI_FALSE);
+ ALOGD("nativeLoad: %s", nameC);
+ jstring result = orig_nativeLoad(env, obj, name, class_loader);
+ env->ReleaseStringUTFChars(name, nameC);
+ return result;
+}
+
+HOOK_JNI(jstring, nativeLoadNew, JNIEnv *env, jobject obj, jstring name, jobject class_loader,
+ jobject caller) {
+ const char *nameC = env->GetStringUTFChars(name, JNI_FALSE);
+ ALOGD("nativeLoad: %s", nameC);
+ jstring result = orig_nativeLoadNew(env, obj, name, class_loader, caller);
+ env->ReleaseStringUTFChars(name, nameC);
+ return result;
+}
+
+void RuntimeHook::init(JNIEnv *env) {
+ const char *className = "java/lang/Runtime";
+ if (BoxCore::getApiLevel() >= __ANDROID_API_Q__) {
+ JniHook::HookJniFun(env, className, "nativeLoad","(Ljava/lang/String;Ljava/lang/ClassLoader;Ljava/lang/Class;)Ljava/lang/String;",
+ (void *) new_nativeLoadNew, (void **) (&orig_nativeLoadNew), true);
+ } else {
+ JniHook::HookJniFun(env, className, "nativeLoad","(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/String;",
+ (void *) new_nativeLoad, (void **) (&orig_nativeLoad), true);
+ }
+}
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/RuntimeHook.h b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/RuntimeHook.h
new file mode 100644
index 0000000..2fd56dc
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/RuntimeHook.h
@@ -0,0 +1,12 @@
+#ifndef BLACKBOX_RUNTIMEHOOK_H
+#define BLACKBOX_RUNTIMEHOOK_H
+
+#include "BaseHook.h"
+#include
+
+class RuntimeHook : public BaseHook {
+public:
+ static void init(JNIEnv *env);
+};
+
+#endif // BLACKBOX_RUNTIMEHOOK_H
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/SystemPropertiesHook.cpp b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/SystemPropertiesHook.cpp
new file mode 100644
index 0000000..0592511
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/SystemPropertiesHook.cpp
@@ -0,0 +1,59 @@
+#include
+#include "SystemPropertiesHook.h"
+#include "IO.h"
+#include "BoxCore.h"
+#import "JniHook/JniHook.h"
+#include "Log.h"
+
+static std::map prop_map;
+
+HOOK_JNI(jstring, native_get, JNIEnv *env, jobject obj, jstring key, jstring def) {
+ const char *key_str = env->GetStringUTFChars(key, JNI_FALSE);
+ const char *def_str = env->GetStringUTFChars(def, JNI_FALSE);
+ if (key == nullptr || def == nullptr) {
+ return orig_native_get(env, obj, key, def);
+ }
+
+ auto ret = prop_map.find(key_str);
+ if (ret != prop_map.end()) {
+ const char *ret_value = ret->second.c_str();
+ return env->NewStringUTF(ret_value);
+ }
+
+ env->ReleaseStringUTFChars(key, key_str);
+ env->ReleaseStringUTFChars(key, def_str);
+ return orig_native_get(env, obj, key, def);
+}
+
+HOOK_JNI(int, __system_property_get, const char *name, char *value) {
+ if (name == nullptr || value == nullptr) {
+ return orig___system_property_get(name, value);
+ }
+
+ ALOGD(name, value);
+ auto ret = prop_map.find(name);
+ if (ret != prop_map.end()) {
+ const char *ret_value = ret->second.c_str();
+ strcpy(value, ret_value);
+ return strlen(ret_value);
+ }
+ return orig___system_property_get(name, value);
+}
+
+void SystemPropertiesHook::init(JNIEnv *env) {
+ prop_map.insert(map::value_type("ro.product.board", "umi"));
+ prop_map.insert(map::value_type("ro.product.brand", "Xiaomi"));
+ prop_map.insert(map::value_type("ro.product.device", "umi"));
+ prop_map.insert(map::value_type("ro.build.display.id","QKQ1.191117.002 test-keys"));
+ prop_map.insert(map::value_type("ro.build.host", "c5-miui-ota-bd074.bj"));
+ prop_map.insert(map::value_type("ro.build.id", "QKQ1.191117.002"));
+ prop_map.insert(map::value_type("ro.product.manufacturer", "Xiaomi"));
+ prop_map.insert(map::value_type("ro.product.model", "Mi 10"));
+ prop_map.insert(map::value_type("ro.product.name", "umi"));
+ prop_map.insert(map::value_type("ro.build.tags", "release-keys"));
+ prop_map.insert(map::value_type("ro.build.type", "user"));
+ prop_map.insert(map::value_type("ro.build.user", "builder"));
+ JniHook::HookJniFun(env, "android/os/SystemProperties","native_get", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;",
+ (void *) new_native_get, (void **) (&orig_native_get), true);
+ shadowhook_hook_sym_name("libc.so", "__system_property_get",(void *)new___system_property_get,(void **) &orig___system_property_get);
+}
\ No newline at end of file
diff --git a/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/SystemPropertiesHook.h b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/SystemPropertiesHook.h
new file mode 100644
index 0000000..66d2d46
--- /dev/null
+++ b/520ApkBox-NewBlackbox/Bcore/src/main/cpp/Hook/SystemPropertiesHook.h
@@ -0,0 +1,13 @@
+#ifndef BLACKBOX_SYSTEMPROPERTIESHOOK_H
+#define BLACKBOX_SYSTEMPROPERTIESHOOK_H
+
+#include