优化某些问题

pull/2/head
Milk 4 years ago
parent 1ab1405d66
commit 2664202ab5
  1. 86
      Bcore/black-fake/src/main/java/android/app/ActivityThread.java
  2. 19
      Bcore/black-fake/src/main/java/android/app/ContentProviderHolder.java
  3. 14
      Bcore/black-fake/src/main/java/android/content/IContentProvider.java
  4. 101
      Bcore/black-fake/src/main/java/android/content/SyncInfo.java
  5. 174
      Bcore/black-fake/src/main/java/android/content/SyncStatusInfo.java
  6. 33
      Bcore/black-fake/src/main/java/android/location/LocationRequest.java
  7. 60
      Bcore/black-fake/src/main/java/android/os/ParcelableException.java
  8. 2
      Bcore/black-fake/src/main/java/reflection/MirrorReflection.java
  9. 4
      Bcore/black-fake/src/main/java/reflection/android/app/ActivityManagerNative.java
  10. 4
      Bcore/black-fake/src/main/java/reflection/android/app/ActivityManagerOreo.java
  11. 7
      Bcore/black-fake/src/main/java/reflection/android/app/ActivityThread.java
  12. 4
      Bcore/black-fake/src/main/java/reflection/android/app/AppOpsManager.java
  13. 4
      Bcore/black-fake/src/main/java/reflection/android/app/ApplicationThreadNative.java
  14. 4
      Bcore/black-fake/src/main/java/reflection/android/app/ContextImpl.java
  15. 4
      Bcore/black-fake/src/main/java/reflection/android/app/IActivityManager.java
  16. 4
      Bcore/black-fake/src/main/java/reflection/android/app/IActivityTaskManager.java
  17. 4
      Bcore/black-fake/src/main/java/reflection/android/app/IAlarmManager.java
  18. 4
      Bcore/black-fake/src/main/java/reflection/android/app/IApplicationThreadOreo.java
  19. 4
      Bcore/black-fake/src/main/java/reflection/android/app/LoadedApk.java
  20. 4
      Bcore/black-fake/src/main/java/reflection/android/app/job/IJobScheduler.java
  21. 4
      Bcore/black-fake/src/main/java/reflection/android/app/servertransaction/ClientTransaction.java
  22. 4
      Bcore/black-fake/src/main/java/reflection/android/app/servertransaction/LaunchActivityItem.java
  23. 4
      Bcore/black-fake/src/main/java/reflection/android/content/ContentProviderHolderOreo.java
  24. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/ApplicationInfoL.java
  25. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/ApplicationInfoN.java
  26. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/ILauncherApps.java
  27. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/PackageParser.java
  28. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/PackageParserJellyBean.java
  29. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/PackageParserJellyBean17.java
  30. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/PackageParserLollipop.java
  31. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/PackageParserLollipop22.java
  32. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/PackageParserMarshmallow.java
  33. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/PackageParserNougat.java
  34. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/PackageParserPie.java
  35. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/ParceledListSlice.java
  36. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/ParceledListSliceJBMR2.java
  37. 4
      Bcore/black-fake/src/main/java/reflection/android/content/pm/SigningInfo.java
  38. 4
      Bcore/black-fake/src/main/java/reflection/android/os/BaseBundle.java
  39. 4
      Bcore/black-fake/src/main/java/reflection/android/os/Bundle.java
  40. 4
      Bcore/black-fake/src/main/java/reflection/android/os/BundleICS.java
  41. 4
      Bcore/black-fake/src/main/java/reflection/android/os/Handler.java
  42. 4
      Bcore/black-fake/src/main/java/reflection/android/os/IDeviceIdentifiersPolicyService.java
  43. 4
      Bcore/black-fake/src/main/java/reflection/android/os/ServiceManager.java
  44. 4
      Bcore/black-fake/src/main/java/reflection/android/os/mount/IMountService.java
  45. 4
      Bcore/black-fake/src/main/java/reflection/android/os/storage/IStorageManager.java
  46. 4
      Bcore/black-fake/src/main/java/reflection/android/os/storage/StorageManager.java
  47. 4
      Bcore/black-fake/src/main/java/reflection/android/os/storage/StorageVolume.java
  48. 4
      Bcore/black-fake/src/main/java/reflection/android/providers/Settings.java
  49. 4
      Bcore/black-fake/src/main/java/reflection/android/util/Singleton.java
  50. 4
      Bcore/black-fake/src/main/java/reflection/com/android/internal/app/IAppOpsService.java
  51. 4
      Bcore/black-fake/src/main/java/reflection/com/android/internal/telephony/ITelephony.java
  52. 4
      Bcore/black-fake/src/main/java/reflection/com/android/internal/telephony/ITelephonyRegistry.java
  53. 4
      Bcore/black-fake/src/main/java/reflection/libcore/io/Libcore.java
  54. 2
      Bcore/consumer-rules.pro
  55. 2
      Bcore/proguard-rules.pro
  56. 2
      Bcore/src/main/java/top/niunaijun/blackbox/BlackBoxCore.java
  57. 18
      Bcore/src/main/java/top/niunaijun/blackbox/BlackDexCore.java
  58. 9
      Bcore/src/main/java/top/niunaijun/blackbox/app/BActivityThread.java
  59. 4
      Bcore/src/main/java/top/niunaijun/blackbox/core/system/am/ActivityStack.java
  60. 11
      Bcore/src/main/java/top/niunaijun/blackbox/core/system/os/BStorageManagerService.java
  61. 6
      Bcore/src/main/java/top/niunaijun/blackbox/core/system/pm/PackageManagerCompat.java
  62. 2
      Bcore/src/main/java/top/niunaijun/blackbox/fake/delegate/AppInstrumentation.java
  63. 6
      Bcore/src/main/java/top/niunaijun/blackbox/fake/delegate/ContentProviderDelegate.java
  64. 2
      Bcore/src/main/java/top/niunaijun/blackbox/fake/hook/BinderInvocationStub.java
  65. 13
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/HCallbackProxy.java
  66. 6
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/IActivityManagerProxy.java
  67. 4
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/IActivityTaskManagerProxy.java
  68. 4
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/IAlarmManagerProxy.java
  69. 8
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/IAppOpsManagerProxy.java
  70. 6
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/IDeviceIdentifiersPolicyProxy.java
  71. 4
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/IJobServiceProxy.java
  72. 4
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/ILauncherAppsProxy.java
  73. 4
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/IPackageManagerProxy.java
  74. 6
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/IStorageManagerProxy.java
  75. 4
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/ITelephonyManagerProxy.java
  76. 4
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/ITelephonyRegistryProxy.java
  77. 2
      Bcore/src/main/java/top/niunaijun/blackbox/fake/service/libcore/OsStub.java
  78. 4
      Bcore/src/main/java/top/niunaijun/blackbox/utils/compat/ApplicationThreadCompat.java
  79. 8
      Bcore/src/main/java/top/niunaijun/blackbox/utils/compat/BundleCompat.java
  80. 2
      Bcore/src/main/java/top/niunaijun/blackbox/utils/compat/ContextCompat.java
  81. 16
      Bcore/src/main/java/top/niunaijun/blackbox/utils/compat/PackageParserCompat.java
  82. 4
      Bcore/src/main/java/top/niunaijun/blackbox/utils/compat/ParceledListSliceCompat.java
  83. 1
      Bcore/src/main/jni/DexDump.cpp
  84. 2
      README.md
  85. 29
      app/build.gradle
  86. 5
      app/src/main/AndroidManifest.xml
  87. 5
      app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  88. 5
      app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  89. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher.png
  90. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  91. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher.png
  92. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  93. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher.png
  94. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  95. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  96. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  97. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  98. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  99. 2
      app/src/main/res/values/strings.xml

@ -1,86 +0,0 @@
package android.app;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ProviderInfo;
import android.os.Handler;
import android.os.IBinder;
import android.util.ArrayMap;
import java.lang.ref.WeakReference;
import java.util.Map;
import java.util.Objects;
/**
* Created by Milk on 2021/5/7.
* * _
* (`ω
*  つ0
* しーJ
* 此处无Bug
*/
public class ActivityThread {
public H mH = null;
public AppBindData mBoundApplication;
public Application mInitialApplication;
public Instrumentation mInstrumentation;
public Map<String, WeakReference<?>> mPackages;
public Map<IBinder, ActivityClientRecord> mActivities;
public ArrayMap<ProviderKey, Object> mProviderMap;
static class H extends Handler {
}
public static ActivityThread currentActivityThread() {
throw new RuntimeException();
}
public String getProcessName() {
throw new RuntimeException();
}
public Handler getHandler() {
throw new RuntimeException();
}
public ContentProviderHolder installProvider(Context context,
ContentProviderHolder holder, ProviderInfo info,
boolean noisy, boolean noReleaseNeeded, boolean stable) {
throw new RuntimeException();
}
static final class AppBindData {
}
public static final class ActivityClientRecord {
public Activity activity;
public IBinder token;
public ActivityInfo activityInfo;
public Intent intent;
}
public static final class ProviderKey {
public final String authority;
public final int userId;
public ProviderKey(String authority, int userId) {
this.authority = authority;
this.userId = userId;
}
@Override
public boolean equals(Object o) {
if (o instanceof ProviderKey) {
final ProviderKey other = (ProviderKey) o;
return Objects.equals(authority, other.authority) && userId == other.userId;
}
return false;
}
@Override
public int hashCode() {
return ((authority != null) ? authority.hashCode() : 0) ^ userId;
}
}
}

@ -1,19 +0,0 @@
package android.app;
import android.content.IContentProvider;
import android.content.pm.ProviderInfo;
import android.os.IBinder;
/**
* Created by Milk on 2021/5/7.
* * _
* (`ω
*  つ0
* しーJ
* 此处无Bug
*/
public class ContentProviderHolder {
public final ProviderInfo info = null;
public IContentProvider provider;
public IBinder connection;
}

@ -1,14 +0,0 @@
package android.content;
import android.os.IInterface;
/**
* Created by Milk on 2021/5/7.
* * _
* (`ω
*  つ0
* しーJ
* 此处无Bug
*/
public interface IContentProvider extends IInterface {
}

@ -1,101 +0,0 @@
/*
* 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.content;
import android.accounts.Account;
import android.os.Parcel;
import android.os.Parcelable;
/**
* Information about the sync operation that is currently underway.
*/
public class SyncInfo implements Parcelable {
/**
* Used when the caller receiving this object doesn't have permission to access the accounts
* on device.
* @See Manifest.permission.GET_ACCOUNTS
*/
private static final Account REDACTED_ACCOUNT = new Account("*****", "*****");
/** @hide */
public final int authorityId;
/**
* The {@link Account} that is currently being synced.
*/
public final Account account;
/**
* The authority of the provider that is currently being synced.
*/
public final String authority;
/**
* The start time of the current sync operation in milliseconds since boot.
* This is represented in elapsed real time.
* See {@link android.os.SystemClock#elapsedRealtime()}.
*/
public final long startTime;
/**
* Creates a SyncInfo object with an unusable Account. Used when the caller receiving this
* object doesn't have access to the accounts on the device.
* @See Manifest.permission.GET_ACCOUNTS
* @hide
*/
public static SyncInfo createAccountRedacted(
int authorityId, String authority, long startTime) {
throw new RuntimeException("Stub!");
}
/** @hide */
public SyncInfo(int authorityId, Account account, String authority, long startTime) {
throw new RuntimeException("Stub!");
}
/** @hide */
public SyncInfo(SyncInfo other) {
throw new RuntimeException("Stub!");
}
/** @hide */
public int describeContents() {
return 0;
}
/** @hide */
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeInt(authorityId);
parcel.writeParcelable(account, flags);
parcel.writeString(authority);
parcel.writeLong(startTime);
}
SyncInfo(Parcel parcel) {
throw new RuntimeException("Stub!");
}
public static final Creator<SyncInfo> CREATOR = new Creator<SyncInfo>() {
public SyncInfo createFromParcel(Parcel in) {
return new SyncInfo(in);
}
public SyncInfo[] newArray(int size) {
return new SyncInfo[size];
}
};
}

@ -1,174 +0,0 @@
package android.content;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
import java.util.ArrayList;
public class SyncStatusInfo implements Parcelable {
static final int VERSION = 2;
public final int authorityId;
public long totalElapsedTime;
public int numSyncs;
public int numSourcePoll;
public int numSourceServer;
public int numSourceLocal;
public int numSourceUser;
public int numSourcePeriodic;
public long lastSuccessTime;
public int lastSuccessSource;
public long lastFailureTime;
public int lastFailureSource;
public String lastFailureMesg;
public long initialFailureTime;
public boolean pending;
public boolean initialize;
// Warning: It is up to the external caller to ensure there are
// no race conditions when accessing this list
private ArrayList<Long> periodicSyncTimes;
private static final String TAG = "Sync";
public SyncStatusInfo(int authorityId) {
this.authorityId = authorityId;
}
public int getLastFailureMesgAsInt(int def) {
return 0;
}
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeInt(VERSION);
parcel.writeInt(authorityId);
parcel.writeLong(totalElapsedTime);
parcel.writeInt(numSyncs);
parcel.writeInt(numSourcePoll);
parcel.writeInt(numSourceServer);
parcel.writeInt(numSourceLocal);
parcel.writeInt(numSourceUser);
parcel.writeLong(lastSuccessTime);
parcel.writeInt(lastSuccessSource);
parcel.writeLong(lastFailureTime);
parcel.writeInt(lastFailureSource);
parcel.writeString(lastFailureMesg);
parcel.writeLong(initialFailureTime);
parcel.writeInt(pending ? 1 : 0);
parcel.writeInt(initialize ? 1 : 0);
if (periodicSyncTimes != null) {
parcel.writeInt(periodicSyncTimes.size());
for (long periodicSyncTime : periodicSyncTimes) {
parcel.writeLong(periodicSyncTime);
}
} else {
parcel.writeInt(-1);
}
}
public SyncStatusInfo(Parcel parcel) {
int version = parcel.readInt();
if (version != VERSION && version != 1) {
Log.w("SyncStatusInfo", "Unknown version: " + version);
}
authorityId = parcel.readInt();
totalElapsedTime = parcel.readLong();
numSyncs = parcel.readInt();
numSourcePoll = parcel.readInt();
numSourceServer = parcel.readInt();
numSourceLocal = parcel.readInt();
numSourceUser = parcel.readInt();
lastSuccessTime = parcel.readLong();
lastSuccessSource = parcel.readInt();
lastFailureTime = parcel.readLong();
lastFailureSource = parcel.readInt();
lastFailureMesg = parcel.readString();
initialFailureTime = parcel.readLong();
pending = parcel.readInt() != 0;
initialize = parcel.readInt() != 0;
if (version == 1) {
periodicSyncTimes = null;
} else {
int N = parcel.readInt();
if (N < 0) {
periodicSyncTimes = null;
} else {
periodicSyncTimes = new ArrayList<Long>();
for (int i=0; i<N; i++) {
periodicSyncTimes.add(parcel.readLong());
}
}
}
}
public SyncStatusInfo(SyncStatusInfo other) {
authorityId = other.authorityId;
totalElapsedTime = other.totalElapsedTime;
numSyncs = other.numSyncs;
numSourcePoll = other.numSourcePoll;
numSourceServer = other.numSourceServer;
numSourceLocal = other.numSourceLocal;
numSourceUser = other.numSourceUser;
numSourcePeriodic = other.numSourcePeriodic;
lastSuccessTime = other.lastSuccessTime;
lastSuccessSource = other.lastSuccessSource;
lastFailureTime = other.lastFailureTime;
lastFailureSource = other.lastFailureSource;
lastFailureMesg = other.lastFailureMesg;
initialFailureTime = other.initialFailureTime;
pending = other.pending;
initialize = other.initialize;
if (other.periodicSyncTimes != null) {
periodicSyncTimes = new ArrayList<Long>(other.periodicSyncTimes);
}
}
public void setPeriodicSyncTime(int index, long when) {
// The list is initialized lazily when scheduling occurs so we need to make sure
// we initialize elements < index to zero (zero is ignore for scheduling purposes)
ensurePeriodicSyncTimeSize(index);
periodicSyncTimes.set(index, when);
}
public long getPeriodicSyncTime(int index) {
if (periodicSyncTimes != null && index < periodicSyncTimes.size()) {
return periodicSyncTimes.get(index);
} else {
return 0;
}
}
public void removePeriodicSyncTime(int index) {
if (periodicSyncTimes != null && index < periodicSyncTimes.size()) {
periodicSyncTimes.remove(index);
}
}
public static final Creator<SyncStatusInfo> CREATOR = new Creator<SyncStatusInfo>() {
public SyncStatusInfo createFromParcel(Parcel in) {
return new SyncStatusInfo(in);
}
public SyncStatusInfo[] newArray(int size) {
return new SyncStatusInfo[size];
}
};
private void ensurePeriodicSyncTimeSize(int index) {
if (periodicSyncTimes == null) {
periodicSyncTimes = new ArrayList<>(0);
}
final int requiredSize = index + 1;
if (periodicSyncTimes.size() < requiredSize) {
for (int i = periodicSyncTimes.size(); i < requiredSize; i++) {
periodicSyncTimes.add((long) 0);
}
}
}
}

@ -1,33 +0,0 @@
package android.location;
import android.os.Parcel;
import android.os.Parcelable;
public final class LocationRequest implements Parcelable {
public String getProvider() {
return null;
}
public static final Creator<LocationRequest> CREATOR = new Creator<LocationRequest>() {
@Override
public LocationRequest createFromParcel(Parcel in) {
return null;
}
@Override
public LocationRequest[] newArray(int size) {
return null;
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
}
}

@ -1,60 +0,0 @@
package android.os;
import android.annotation.TargetApi;
import java.io.IOException;
/**
* Wrapper class that offers to transport typical {@link Throwable} across a
* {@link Binder} call. This class is typically used to transport exceptions
* that cannot be modified to add {@link Parcelable} behavior, such as
* {@link IOException}.
* <ul>
* <li>The wrapped throwable must be defined as system class (that is, it must
* be in the same {@link ClassLoader} as {@link Parcelable}).
* <li>The wrapped throwable must support the
* {@link Throwable#Throwable(String)} constructor.
* <li>The receiver side must catch any thrown {@link ParcelableException} and
* call {@link #maybeRethrow(Class)} for all expected exception types.
* </ul>
*/
@TargetApi(Build.VERSION_CODES.O)
public final class ParcelableException extends RuntimeException implements Parcelable {
public ParcelableException(Throwable t) {
super(t);
}
public <T extends Throwable> void maybeRethrow(Class<T> clazz) throws T {
throw new RuntimeException("Stub!");
}
public static Throwable readFromParcel(Parcel in) {
throw new RuntimeException("Stub!");
}
public static void writeToParcel(Parcel out, Throwable t) {
throw new RuntimeException("Stub!");
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
throw new RuntimeException("Stub!");
}
public static final Creator<ParcelableException> CREATOR = new Creator<ParcelableException>() {
@Override
public ParcelableException createFromParcel(Parcel source) {
return new ParcelableException(readFromParcel(source));
}
@Override
public ParcelableException[] newArray(int size) {
return new ParcelableException[size];
}
};
}

@ -1,4 +1,4 @@
package mirror;
package reflection;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Constructor;

@ -1,9 +1,9 @@
package mirror.android.app;
package reflection.android.app;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
/**
* Created by Milk on 5/20/21.

@ -1,8 +1,8 @@
package mirror.android.app;
package reflection.android.app;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
/**
* Created by Milk on 5/20/21.

@ -1,4 +1,4 @@
package mirror.android.app;
package reflection.android.app;
import android.app.Activity;
@ -16,7 +16,7 @@ import android.util.ArrayMap;
import java.util.List;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
/**
* Created by Milk on 5/20/21.
@ -27,8 +27,7 @@ import mirror.MirrorReflection;
* 此处无Bug
*/
public class ActivityThread {
public static final String NAME = "android.app.ActivityThread";
public static final MirrorReflection REF = MirrorReflection.on(NAME);
public static final MirrorReflection REF = MirrorReflection.on("android.app.ActivityThread");
public static MirrorReflection.StaticMethodWrapper<Object> currentActivityThread = REF.staticMethod("currentActivityThread");
public static MirrorReflection.FieldWrapper<Object> mBoundApplication = REF.field("mBoundApplication");

@ -1,8 +1,8 @@
package mirror.android.app;
package reflection.android.app;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
/**
* Created by Milk on 5/20/21.

@ -1,9 +1,9 @@
package mirror.android.app;
package reflection.android.app;
import android.os.IBinder;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
/**
* Created by Milk on 5/20/21.

@ -1,9 +1,9 @@
package mirror.android.app;
package reflection.android.app;
import android.content.pm.PackageManager;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class ContextImpl {
public static final MirrorReflection REF = MirrorReflection.on("android.app.ContextImpl");

@ -1,9 +1,9 @@
package mirror.android.app;
package reflection.android.app;
import android.content.pm.ProviderInfo;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class IActivityManager {
public static final MirrorReflection REF = MirrorReflection.on("android.app.IActivityManager");

@ -1,9 +1,9 @@
package mirror.android.app;
package reflection.android.app;
import android.os.IBinder;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class IActivityTaskManager {

@ -1,9 +1,9 @@
package mirror.android.app;
package reflection.android.app;
import android.os.IBinder;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class IAlarmManager {
public static class Stub {

@ -1,9 +1,9 @@
package mirror.android.app;
package reflection.android.app;
import android.os.IBinder;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class IApplicationThreadOreo {
public static final class Stub {

@ -1,9 +1,9 @@
package mirror.android.app;
package reflection.android.app;
import android.app.Application;
import android.app.Instrumentation;
import android.content.pm.ApplicationInfo;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class LoadedApk {
public static final MirrorReflection REF = MirrorReflection.on("android.app.LoadedApk");

@ -1,9 +1,9 @@
package mirror.android.app.job;
package reflection.android.app.job;
import android.os.IBinder;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class IJobScheduler {
public static class Stub {

@ -1,8 +1,8 @@
package mirror.android.app.servertransaction;
package reflection.android.app.servertransaction;
import java.util.List;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class ClientTransaction {
public static final MirrorReflection REF = MirrorReflection.on("android.app.servertransaction.ClientTransaction");

@ -1,8 +1,8 @@
package mirror.android.app.servertransaction;
package reflection.android.app.servertransaction;
import android.content.Intent;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class LaunchActivityItem {
public static final MirrorReflection REF = MirrorReflection.on("android.app.servertransaction.LaunchActivityItem");

@ -1,9 +1,9 @@
package mirror.android.content;
package reflection.android.content;
import android.content.pm.ProviderInfo;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class ContentProviderHolderOreo {
public static final MirrorReflection REF = MirrorReflection.on("android.app.ContentProviderHolder");

@ -1,8 +1,8 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.content.pm.ApplicationInfo;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class ApplicationInfoL {
public static final MirrorReflection REF = MirrorReflection.on(ApplicationInfo.class);

@ -1,8 +1,8 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.content.pm.ApplicationInfo;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class ApplicationInfoN {
public static final MirrorReflection REF = MirrorReflection.on(ApplicationInfo.class);

@ -1,8 +1,8 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class ILauncherApps {

@ -1,8 +1,8 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.util.DisplayMetrics;
import java.io.File;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class PackageParser {
public static final MirrorReflection REF = MirrorReflection.on(android.content.pm.PackageParser.class);

@ -1,11 +1,11 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.content.pm.PackageParser;
import android.util.DisplayMetrics;
import java.io.File;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class PackageParserJellyBean {
public static final MirrorReflection REF = MirrorReflection.on(android.content.pm.PackageParser.class);

@ -1,11 +1,11 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.content.pm.PackageParser;
import android.util.DisplayMetrics;
import java.io.File;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class PackageParserJellyBean17 {
public static final MirrorReflection REF = MirrorReflection.on(android.content.pm.PackageParser.class);

@ -1,10 +1,10 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.content.pm.PackageParser;
import java.io.File;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class PackageParserLollipop {
public static final MirrorReflection REF = MirrorReflection.on(android.content.pm.PackageParser.class);

@ -1,10 +1,10 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.content.pm.PackageParser;
import java.io.File;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class PackageParserLollipop22 {
public static final MirrorReflection REF = MirrorReflection.on(android.content.pm.PackageParser.class);

@ -1,10 +1,10 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.content.pm.PackageParser;
import java.io.File;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class PackageParserMarshmallow {
public static final MirrorReflection REF = MirrorReflection.on(android.content.pm.PackageParser.class);

@ -1,8 +1,8 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.content.pm.PackageParser;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class PackageParserNougat {
public static final MirrorReflection REF = MirrorReflection.on(android.content.pm.PackageParser.class);

@ -1,8 +1,8 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.content.pm.PackageParser;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class PackageParserPie {
public static final MirrorReflection REF = MirrorReflection.on(android.content.pm.PackageParser.class);

@ -1,8 +1,8 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.os.Parcelable;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class ParceledListSlice {
public static final MirrorReflection REF = MirrorReflection.on("android.content.pm.ParceledListSlice");

@ -1,10 +1,10 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.os.Parcelable;
import java.util.List;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class ParceledListSliceJBMR2 {
public static final MirrorReflection REF = MirrorReflection.on("android.content.pm.ParceledListSlice");

@ -1,8 +1,8 @@
package mirror.android.content.pm;
package reflection.android.content.pm;
import android.content.pm.PackageParser;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
/**
* Created by Milk on 4/16/21.

@ -1,8 +1,8 @@
package mirror.android.os;
package reflection.android.os;
import android.os.Parcel;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class BaseBundle {
public static final MirrorReflection REF = MirrorReflection.on("android.os.BaseBundle");

@ -1,8 +1,8 @@
package mirror.android.os;
package reflection.android.os;
import android.os.IBinder;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class Bundle {
public static final MirrorReflection REF = MirrorReflection.on(android.os.Bundle.class);

@ -1,8 +1,8 @@
package mirror.android.os;
package reflection.android.os;
import android.os.Parcel;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class BundleICS {
public static final MirrorReflection REF = MirrorReflection.on(android.os.Bundle.class);

@ -1,6 +1,6 @@
package mirror.android.os;
package reflection.android.os;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class Handler {
public static final MirrorReflection REF = MirrorReflection.on(android.os.Handler.class);

@ -1,9 +1,9 @@
package mirror.android.os;
package reflection.android.os;
import android.os.IBinder;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class IDeviceIdentifiersPolicyService {
public static class Stub {

@ -1,11 +1,11 @@
package mirror.android.os;
package reflection.android.os;
import android.os.IBinder;
import android.os.IInterface;
import java.util.Map;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class ServiceManager {
public static final MirrorReflection REF = MirrorReflection.on("android.os.ServiceManager");

@ -1,9 +1,9 @@
package mirror.android.os.mount;
package reflection.android.os.mount;
import android.os.IBinder;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class IMountService {
public static class Stub {

@ -1,9 +1,9 @@
package mirror.android.os.storage;
package reflection.android.os.storage;
import android.os.IBinder;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class IStorageManager {
public static class Stub {

@ -1,8 +1,8 @@
package mirror.android.os.storage;
package reflection.android.os.storage;
import android.os.storage.StorageVolume;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
/**
* Created by Milk on 4/10/21.

@ -1,8 +1,8 @@
package mirror.android.os.storage;
package reflection.android.os.storage;
import java.io.File;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
/**
* Created by Milk on 4/10/21.

@ -1,11 +1,11 @@
package mirror.android.providers;
package reflection.android.providers;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class Settings {

@ -1,7 +1,7 @@
package mirror.android.util;
package reflection.android.util;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class Singleton {
public static final MirrorReflection REF = MirrorReflection.on("android.util.Singleton");

@ -1,9 +1,9 @@
package mirror.com.android.internal.app;
package reflection.com.android.internal.app;
import android.os.IBinder;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class IAppOpsService {

@ -1,9 +1,9 @@
package mirror.com.android.internal.telephony;
package reflection.com.android.internal.telephony;
import android.os.IBinder;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class ITelephony {
public static class Stub {

@ -1,9 +1,9 @@
package mirror.com.android.internal.telephony;
package reflection.com.android.internal.telephony;
import android.os.IBinder;
import android.os.IInterface;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class ITelephonyRegistry {

@ -1,6 +1,6 @@
package mirror.libcore.io;
package reflection.libcore.io;
import mirror.MirrorReflection;
import reflection.MirrorReflection;
public class Libcore {
public static final String NAME = "libcore.io.Libcore";

@ -22,6 +22,6 @@
-keep class top.niunaijun.blackbox.** {*; }
-keep class top.niunaijun.jnihook.** {*; }
-keep class mirror.** {*; }
-keep class reflection.** {*; }
-keep class android.** {*; }
-keep class com.android.** {*; }

@ -22,6 +22,6 @@
-keep class top.niunaijun.blackbox.** {*; }
-keep class top.niunaijun.jnihook.** {*; }
-keep class mirror.** {*; }
-keep class reflection.** {*; }
-keep class android.** {*; }
-keep class com.android.** {*; }

@ -35,7 +35,7 @@ import java.util.HashMap;
import java.util.Map;
import me.weishu.reflection.Reflection;
import mirror.android.app.ActivityThread;
import reflection.android.app.ActivityThread;
import top.niunaijun.blackbox.fake.frameworks.BStorageManager;
import top.niunaijun.blackbox.core.system.ServiceManager;

@ -37,7 +37,11 @@ public class BlackDexCore {
public boolean dumpDex(String packageName) {
InstallResult installResult = BlackBoxCore.get().installPackage(packageName);
if (installResult.success) {
return BlackBoxCore.get().launchApk(packageName);
boolean b = BlackBoxCore.get().launchApk(packageName);
if (!b) {
BlackBoxCore.get().uninstallPackage(installResult.packageName);
}
return b;
} else {
return false;
}
@ -46,7 +50,11 @@ public class BlackDexCore {
public boolean dumpDex(File file) {
InstallResult installResult = BlackBoxCore.get().installPackage(file);
if (installResult.success) {
return BlackBoxCore.get().launchApk(installResult.packageName);
boolean b = BlackBoxCore.get().launchApk(installResult.packageName);
if (!b) {
BlackBoxCore.get().uninstallPackage(installResult.packageName);
}
return b;
} else {
return false;
}
@ -55,7 +63,11 @@ public class BlackDexCore {
public boolean dumpDex(Uri file) {
InstallResult installResult = BlackBoxCore.get().installPackage(file);
if (installResult.success) {
return BlackBoxCore.get().launchApk(installResult.packageName);
boolean b = BlackBoxCore.get().launchApk(installResult.packageName);
if (!b) {
BlackBoxCore.get().uninstallPackage(installResult.packageName);
}
return b;
} else {
return false;
}

@ -13,8 +13,6 @@ import android.os.ConditionVariable;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Process;
import android.util.Log;
import java.io.File;
import java.util.ArrayList;
@ -22,16 +20,15 @@ import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import mirror.android.app.ActivityThread;
import mirror.android.app.ContextImpl;
import mirror.android.app.LoadedApk;
import reflection.android.app.ActivityThread;
import reflection.android.app.ContextImpl;
import reflection.android.app.LoadedApk;
import top.niunaijun.blackbox.core.IBActivityThread;
import top.niunaijun.blackbox.core.VMCore;
import top.niunaijun.blackbox.entity.AppConfig;
import top.niunaijun.blackbox.core.IOCore;
import top.niunaijun.blackbox.entity.dump.DumpResult;
import top.niunaijun.blackbox.utils.Slog;
import top.niunaijun.blackbox.utils.compat.ContextCompat;
import top.niunaijun.blackbox.BlackBoxCore;
/**

@ -20,8 +20,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import mirror.android.app.ActivityManagerNative;
import mirror.android.app.IActivityManager;
import reflection.android.app.ActivityManagerNative;
import reflection.android.app.IActivityManager;
import top.niunaijun.blackbox.BlackBoxCore;
import top.niunaijun.blackbox.proxy.ProxyManifest;
import top.niunaijun.blackbox.core.system.pm.BPackageManagerService;

@ -1,15 +1,10 @@
package top.niunaijun.blackbox.core.system.os;
import android.net.Uri;
import android.os.Process;
import android.os.RemoteException;
import android.os.storage.StorageVolume;
import java.io.File;
import top.niunaijun.blackbox.core.env.BEnvironment;
import top.niunaijun.blackbox.BlackBoxCore;
import top.niunaijun.blackbox.proxy.ProxyManifest;
import top.niunaijun.blackbox.core.system.ISystemService;
import top.niunaijun.blackbox.core.system.user.BUserHandle;
import top.niunaijun.blackbox.utils.compat.BuildCompat;
@ -35,11 +30,11 @@ public class BStorageManagerService extends IBStorageManagerService.Stub impleme
@Override
public StorageVolume[] getVolumeList(int uid, String packageName, int flags, int userId) throws RemoteException {
try {
StorageVolume[] storageVolumes = mirror.android.os.storage.StorageManager.getVolumeList.call(BUserHandle.getUserId(Process.myUid()), 0);
StorageVolume[] storageVolumes = reflection.android.os.storage.StorageManager.getVolumeList.call(BUserHandle.getUserId(Process.myUid()), 0);
for (StorageVolume storageVolume : storageVolumes) {
mirror.android.os.storage.StorageVolume.mPath.set(storageVolume, BEnvironment.getExternalUserDir(userId));
reflection.android.os.storage.StorageVolume.mPath.set(storageVolume, BEnvironment.getExternalUserDir(userId));
if (BuildCompat.isPie()) {
mirror.android.os.storage.StorageVolume.mInternalPath.set(storageVolume, BEnvironment.getExternalUserDir(userId));
reflection.android.os.storage.StorageVolume.mInternalPath.set(storageVolume, BEnvironment.getExternalUserDir(userId));
}
}
return storageVolumes;

@ -17,9 +17,9 @@ import android.os.Build;
import java.util.HashSet;
import java.util.Set;
import mirror.android.content.pm.ApplicationInfoL;
import mirror.android.content.pm.ApplicationInfoN;
import mirror.android.content.pm.SigningInfo;
import reflection.android.content.pm.ApplicationInfoL;
import reflection.android.content.pm.ApplicationInfoN;
import reflection.android.content.pm.SigningInfo;
import top.niunaijun.blackbox.core.env.BEnvironment;
import top.niunaijun.blackbox.BlackBoxCore;
import top.niunaijun.blackbox.core.env.AppSystemEnv;

@ -10,7 +10,7 @@ import android.util.Log;
import java.lang.reflect.Field;
import mirror.android.app.ActivityThread;
import reflection.android.app.ActivityThread;
import top.niunaijun.blackbox.BlackBoxCore;
import top.niunaijun.blackbox.fake.hook.HookManager;
import top.niunaijun.blackbox.fake.hook.IInjectHook;

@ -8,9 +8,9 @@ import java.lang.reflect.Proxy;
import java.util.HashSet;
import java.util.Set;
import mirror.android.app.IActivityManager;
import mirror.android.content.ContentProviderHolderOreo;
import mirror.android.providers.Settings;
import reflection.android.app.IActivityManager;
import reflection.android.content.ContentProviderHolderOreo;
import reflection.android.providers.Settings;
import top.niunaijun.blackbox.BlackBoxCore;
import top.niunaijun.blackbox.fake.service.provider.ContentProviderStub;
import top.niunaijun.blackbox.fake.service.provider.SettingsProviderStub;

@ -11,7 +11,7 @@ import androidx.annotation.Nullable;
import java.io.FileDescriptor;
import java.util.Map;
import mirror.android.os.ServiceManager;
import reflection.android.os.ServiceManager;
/**
* Created by Milk on 3/30/21.

@ -3,7 +3,6 @@ package top.niunaijun.blackbox.fake.service;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import androidx.annotation.NonNull;
@ -11,11 +10,9 @@ import androidx.annotation.NonNull;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import mirror.android.app.ActivityManagerNative;
import mirror.android.app.ActivityThread;
import mirror.android.app.IActivityManager;
import mirror.android.app.servertransaction.ClientTransaction;
import mirror.android.app.servertransaction.LaunchActivityItem;
import reflection.android.app.ActivityThread;
import reflection.android.app.servertransaction.ClientTransaction;
import reflection.android.app.servertransaction.LaunchActivityItem;
import top.niunaijun.blackbox.BlackBoxCore;
import top.niunaijun.blackbox.app.BActivityThread;
import top.niunaijun.blackbox.fake.hook.IInjectHook;
@ -36,7 +33,7 @@ public class HCallbackProxy implements IInjectHook, Handler.Callback {
private AtomicBoolean mBeing = new AtomicBoolean(false);
private Handler.Callback getHCallback() {
return mirror.android.os.Handler.mCallback.get(getH());
return reflection.android.os.Handler.mCallback.get(getH());
}
private Handler getH() {
@ -50,7 +47,7 @@ public class HCallbackProxy implements IInjectHook, Handler.Callback {
if (mOtherCallback != null && (mOtherCallback == this || mOtherCallback.getClass().getName().equals(this.getClass().getName()))) {
mOtherCallback = null;
}
mirror.android.os.Handler.mCallback.set(getH(), this);
reflection.android.os.Handler.mCallback.set(getH(), this);
}
@Override

@ -2,10 +2,10 @@ package top.niunaijun.blackbox.fake.service;
import java.lang.reflect.Method;
import mirror.android.app.ActivityManagerNative;
import mirror.android.app.ActivityManagerOreo;
import reflection.android.app.ActivityManagerNative;
import reflection.android.app.ActivityManagerOreo;
import mirror.android.util.Singleton;
import reflection.android.util.Singleton;
import top.niunaijun.blackbox.BlackBoxCore;
import top.niunaijun.blackbox.fake.delegate.ContentProviderDelegate;
import top.niunaijun.blackbox.fake.hook.ProxyMethod;

@ -1,7 +1,7 @@
package top.niunaijun.blackbox.fake.service;
import mirror.android.app.IActivityTaskManager;
import mirror.android.os.ServiceManager;
import reflection.android.app.IActivityTaskManager;
import reflection.android.os.ServiceManager;
import top.niunaijun.blackbox.fake.hook.BinderInvocationStub;
import top.niunaijun.blackbox.fake.hook.ScanClass;

@ -4,8 +4,8 @@ import android.content.Context;
import java.lang.reflect.Method;
import mirror.android.app.IAlarmManager;
import mirror.android.os.ServiceManager;
import reflection.android.app.IAlarmManager;
import reflection.android.os.ServiceManager;
import top.niunaijun.blackbox.fake.hook.BinderInvocationStub;
import top.niunaijun.blackbox.fake.hook.MethodHook;
import top.niunaijun.blackbox.fake.hook.ProxyMethod;

@ -7,8 +7,8 @@ import android.os.IInterface;
import java.lang.reflect.Method;
import mirror.android.os.ServiceManager;
import mirror.com.android.internal.app.IAppOpsService;
import reflection.android.os.ServiceManager;
import reflection.com.android.internal.app.IAppOpsService;
import top.niunaijun.blackbox.BlackBoxCore;
import top.niunaijun.blackbox.fake.hook.BinderInvocationStub;
import top.niunaijun.blackbox.fake.hook.MethodHook;
@ -36,10 +36,10 @@ public class IAppOpsManagerProxy extends BinderInvocationStub {
@Override
protected void inject(Object baseInvocation, Object proxyInvocation) {
if (mirror.android.app.AppOpsManager.mService != null) {
if (reflection.android.app.AppOpsManager.mService != null) {
AppOpsManager appOpsManager = (AppOpsManager) BlackBoxCore.getContext().getSystemService(Context.APP_OPS_SERVICE);
try {
mirror.android.app.AppOpsManager.mService.set(appOpsManager, (IInterface) getProxyInvocation());
reflection.android.app.AppOpsManager.mService.set(appOpsManager, (IInterface) getProxyInvocation());
} catch (Exception e) {
e.printStackTrace();
}

@ -3,8 +3,8 @@ package top.niunaijun.blackbox.fake.service;
import java.lang.reflect.Method;
import mirror.android.os.IDeviceIdentifiersPolicyService;
import mirror.android.os.ServiceManager;
import reflection.android.os.IDeviceIdentifiersPolicyService;
import reflection.android.os.ServiceManager;
import top.niunaijun.blackbox.BlackBoxCore;
import top.niunaijun.blackbox.fake.hook.BinderInvocationStub;
import top.niunaijun.blackbox.fake.hook.MethodHook;
@ -41,7 +41,7 @@ public class IDeviceIdentifiersPolicyProxy extends BinderInvocationStub {
}
@ProxyMethod(name = "getSerialForPackage")
public static class x extends MethodHook {
public static class GetSerialForPackage extends MethodHook {
@Override
protected Object hook(Object who, Method method, Object[] args) throws Throwable {
// args[0] = BlackBoxCore.getHostPkg();

@ -5,8 +5,8 @@ import android.os.IBinder;
import java.lang.reflect.Method;
import mirror.android.app.job.IJobScheduler;
import mirror.android.os.ServiceManager;
import reflection.android.app.job.IJobScheduler;
import reflection.android.os.ServiceManager;
import top.niunaijun.blackbox.fake.hook.BinderInvocationStub;
import top.niunaijun.blackbox.fake.hook.MethodHook;
import top.niunaijun.blackbox.fake.hook.ProxyMethod;

@ -4,8 +4,8 @@ import android.content.Context;
import java.lang.reflect.Method;
import mirror.android.content.pm.ILauncherApps;
import mirror.android.os.ServiceManager;
import reflection.android.content.pm.ILauncherApps;
import reflection.android.os.ServiceManager;
import top.niunaijun.blackbox.fake.hook.BinderInvocationStub;
import top.niunaijun.blackbox.utils.MethodParameterUtils;

@ -15,8 +15,8 @@ import android.os.Process;
import java.lang.reflect.Method;
import java.util.List;
import mirror.android.app.ActivityThread;
import mirror.android.app.ContextImpl;
import reflection.android.app.ActivityThread;
import reflection.android.app.ContextImpl;
import top.niunaijun.blackbox.BlackBoxCore;
import top.niunaijun.blackbox.app.BActivityThread;
import top.niunaijun.blackbox.fake.hook.BinderInvocationStub;

@ -5,9 +5,9 @@ import android.os.Process;
import java.lang.reflect.Method;
import mirror.android.os.ServiceManager;
import mirror.android.os.mount.IMountService;
import mirror.android.os.storage.IStorageManager;
import reflection.android.os.ServiceManager;
import reflection.android.os.mount.IMountService;
import reflection.android.os.storage.IStorageManager;
import top.niunaijun.blackbox.BlackBoxCore;
import top.niunaijun.blackbox.app.BActivityThread;
import top.niunaijun.blackbox.fake.hook.BinderInvocationStub;

@ -5,8 +5,8 @@ import android.os.IBinder;
import java.lang.reflect.Method;
import mirror.android.os.ServiceManager;
import mirror.com.android.internal.telephony.ITelephony;
import reflection.android.os.ServiceManager;
import reflection.com.android.internal.telephony.ITelephony;
import top.niunaijun.blackbox.BlackBoxCore;
import top.niunaijun.blackbox.fake.hook.BinderInvocationStub;
import top.niunaijun.blackbox.fake.hook.MethodHook;

@ -2,8 +2,8 @@ package top.niunaijun.blackbox.fake.service;
import java.lang.reflect.Method;
import mirror.android.os.ServiceManager;
import mirror.com.android.internal.telephony.ITelephonyRegistry;
import reflection.android.os.ServiceManager;
import reflection.com.android.internal.telephony.ITelephonyRegistry;
import top.niunaijun.blackbox.fake.hook.BinderInvocationStub;
import top.niunaijun.blackbox.fake.hook.MethodHook;
import top.niunaijun.blackbox.fake.hook.ProxyMethod;

@ -2,7 +2,7 @@ package top.niunaijun.blackbox.fake.service.libcore;
import java.lang.reflect.Method;
import mirror.libcore.io.Libcore;
import reflection.libcore.io.Libcore;
import top.niunaijun.blackbox.fake.hook.ClassInvocationStub;
import top.niunaijun.blackbox.core.IOCore;

@ -3,8 +3,8 @@ package top.niunaijun.blackbox.utils.compat;
import android.os.IBinder;
import android.os.IInterface;
import mirror.android.app.ApplicationThreadNative;
import mirror.android.app.IApplicationThreadOreo;
import reflection.android.app.ApplicationThreadNative;
import reflection.android.app.IApplicationThreadOreo;
public class ApplicationThreadCompat {

@ -6,15 +6,15 @@ import android.os.Bundle;
import android.os.IBinder;
import android.os.Parcel;
import mirror.android.os.BaseBundle;
import mirror.android.os.BundleICS;
import reflection.android.os.BaseBundle;
import reflection.android.os.BundleICS;
public class BundleCompat {
public static IBinder getBinder(Bundle bundle, String key) {
if (Build.VERSION.SDK_INT >= 18) {
return bundle.getBinder(key);
} else {
return mirror.android.os.Bundle.getIBinder.call(bundle, key);
return reflection.android.os.Bundle.getIBinder.call(bundle, key);
}
}
@ -22,7 +22,7 @@ public class BundleCompat {
if (Build.VERSION.SDK_INT >= 18) {
bundle.putBinder(key, value);
} else {
mirror.android.os.Bundle.putIBinder.call(bundle, key, value);
reflection.android.os.Bundle.putIBinder.call(bundle, key, value);
}
}

@ -3,7 +3,7 @@ package top.niunaijun.blackbox.utils.compat;
import android.content.Context;
import android.content.ContextWrapper;
import mirror.android.app.ContextImpl;
import reflection.android.app.ContextImpl;
import top.niunaijun.blackbox.BlackBoxCore;
/**

@ -5,11 +5,11 @@ import android.content.pm.PackageParser.Package;
import android.util.DisplayMetrics;
import java.io.File;
import mirror.android.content.pm.PackageParserLollipop;
import mirror.android.content.pm.PackageParserLollipop22;
import mirror.android.content.pm.PackageParserMarshmallow;
import mirror.android.content.pm.PackageParserNougat;
import mirror.android.content.pm.PackageParserPie;
import reflection.android.content.pm.PackageParserLollipop;
import reflection.android.content.pm.PackageParserLollipop22;
import reflection.android.content.pm.PackageParserMarshmallow;
import reflection.android.content.pm.PackageParserNougat;
import reflection.android.content.pm.PackageParserPie;
public class PackageParserCompat {
@ -21,7 +21,7 @@ public class PackageParserCompat {
} else if (BuildCompat.isL()) {
return PackageParserLollipop.constructor.newInstance();
} else {
return mirror.android.content.pm.PackageParser.constructor.newInstance(packageFile.getAbsolutePath());
return reflection.android.content.pm.PackageParser.constructor.newInstance(packageFile.getAbsolutePath());
}
}
@ -33,7 +33,7 @@ public class PackageParserCompat {
} else if (BuildCompat.isL()) {
return PackageParserLollipop.parsePackage.callWithException(parser, packageFile, flags);
} else {
return mirror.android.content.pm.PackageParser.parsePackage.callWithException(parser, packageFile, null,
return reflection.android.content.pm.PackageParser.parsePackage.callWithException(parser, packageFile, null,
new DisplayMetrics(), flags);
}
}
@ -50,7 +50,7 @@ public class PackageParserCompat {
} else if (BuildCompat.isL()) {
PackageParserLollipop.collectCertificates.callWithException(parser, p, flags);
} else {
mirror.android.content.pm.PackageParser.collectCertificates.call(parser, p, flags);
reflection.android.content.pm.PackageParser.collectCertificates.call(parser, p, flags);
}
}
}

@ -3,8 +3,8 @@ package top.niunaijun.blackbox.utils.compat;
import java.lang.reflect.Method;
import java.util.List;
import mirror.android.content.pm.ParceledListSlice;
import mirror.android.content.pm.ParceledListSliceJBMR2;
import reflection.android.content.pm.ParceledListSlice;
import reflection.android.content.pm.ParceledListSliceJBMR2;
public class ParceledListSliceCompat {

@ -57,7 +57,6 @@ void DexDump::dumpDex(JNIEnv *env, jlong cookie, jstring dir) {
char magic[8] = {0x64, 0x65, 0x78, 0x0a, 0x30, 0x33, 0x35, 0x00};
auto base = reinterpret_cast<char *>(cookie);
auto begin = *(size_t *) (base + beginOffset * sizeof(size_t));
// auto size = *(size_t *) (base + sizeOffset * sizeof(size_t));
if (!PointerCheck::check(reinterpret_cast<void *>(begin))) {
return;
}

@ -5,7 +5,7 @@
BlackDex是一个运行在Android手机上的脱壳工具,支持5.0~12,无需依赖任何环境任何手机都可以使用,包括模拟器。只需几秒,即可对已安装包括未安装的APK进行脱壳。
## 项目声明
- 由于 [黑盒BlackBox](https://github.com/nnjun/BlackBox) 已被抄家,多的不想说了,请关注本项目或者其他未来项目吧。
由于 [黑盒BlackBox](https://github.com/nnjun/BlackBox) 已被抄家,多的不想说了,请关注本项目或者其他未来项目吧。
## 脱壳说明
本项目针对一代壳,摆脱对以往脱壳环境的困扰,几乎支持5.0以上的任何系统。并且拥有 **快速**、**方便**、**成功率高** 的优点。一般只需要几秒钟即可完成对已安装包括未安装应用脱壳。

@ -16,15 +16,38 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
// SO库架构
abiFilters 'armeabi-v7a', 'x86'
flavorDimensions "BlackBox32"
}
productFlavors {
BlackDex32 {
applicationId "top.niunaijun.blackdexa32"
ndk {
abiFilters "armeabi-v7a"
}
resValue "string", "app_name", "BlackDex32"
}
BlackDex64 {
applicationId "top.niunaijun.blackdexa64"
ndk {
abiFilters "arm64-v8a"
}
resValue "string", "app_name", "BlackDex64"
}
}
buildTypes {
debug {
debuggable true
jniDebuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release {
debuggable false
jniDebuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}

@ -11,11 +11,10 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name=".App"
android:roundIcon="@mipmap/ic_launcher_round"
android:name="top.niunaijun.blackdex.App"
android:supportsRtl="true"
android:theme="@style/Theme.BlackDex">
<activity android:name=".view.main.MainActivity">
<activity android:name="top.niunaijun.blackdex.view.main.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

@ -1,6 +1,4 @@
<resources>
<string name="app_name">BlackDex</string>
<string name="filter">过滤</string>
<string name="choose">选择</string>
<string name="log">软件日志</string>

Loading…
Cancel
Save