├── axml ├── .gitignore └── build.gradle.kts ├── app ├── .gitignore ├── src │ └── main │ │ ├── java │ │ └── org │ │ │ └── lsposed │ │ │ └── manager │ │ │ ├── util │ │ │ ├── AccessibilityUtils.java │ │ │ └── chrome │ │ │ │ └── CustomTabsURLSpan.java │ │ │ └── Constants.java │ │ ├── assets │ │ └── webview │ │ │ ├── template.html │ │ │ └── template_dark.html │ │ └── res │ │ ├── values-v28 │ │ ├── dimens.xml │ │ └── themes.xml │ │ ├── values-v29 │ │ └── settings.xml │ │ ├── values │ │ ├── settings.xml │ │ ├── dimens.xml │ │ ├── themes_overlay.xml │ │ ├── integer.xml │ │ ├── colors.xml │ │ └── strings_untranslatable.xml │ │ ├── values-sw600dp │ │ └── integer.xml │ │ ├── values-v31 │ │ └── colors.xml │ │ ├── values-night-v31 │ │ └── colors.xml │ │ ├── drawable │ │ ├── ic_home_checkable.xml │ │ ├── ic_get_app_checkable.xml │ │ ├── ic_settings_checkable.xml │ │ ├── ic_assignment_checkable.xml │ │ ├── ic_extension_checkable.xml │ │ ├── ic_launcher.xml │ │ ├── ic_baseline_home_24.xml │ │ ├── ic_baseline_add_24.xml │ │ ├── ic_baseline_get_app_24.xml │ │ ├── ic_outline_home_24.xml │ │ ├── ic_outline_get_app_24.xml │ │ ├── ic_baseline_info_24.xml │ │ ├── ic_outline_merge_type_24.xml │ │ ├── shortcut_ic_repo.xml │ │ ├── ic_baseline_arrow_back_24.xml │ │ ├── shortcut_ic_settings.xml │ │ ├── ic_keyboard_arrow_down.xml │ │ ├── ic_baseline_chat_24.xml │ │ ├── ic_outline_shield_24.xml │ │ ├── shortcut_ic_logs.xml │ │ ├── shortcut_ic_modules.xml │ │ ├── simple_menu_background.xml │ │ ├── ic_open_in_browser.xml │ │ ├── ic_round_warning_24.xml │ │ ├── ic_save.xml │ │ ├── ic_outline_invert_colors_24.xml │ │ ├── ic_outline_restore_24.xml │ │ ├── ic_baseline_search_24.xml │ │ ├── ic_round_error_outline_24.xml │ │ ├── ic_baseline_settings_backup_restore_24.xml │ │ ├── ic_launcher_round.xml │ │ ├── ic_outline_speaker_notes_24.xml │ │ ├── ic_round_check_circle_24.xml │ │ ├── ic_outline_format_color_fill_24.xml │ │ ├── ic_baseline_assignment_24.xml │ │ ├── ic_baseline_extension_24.xml │ │ ├── ic_attach_file.xml │ │ └── ic_outline_translate_24.xml │ │ ├── layout │ │ ├── item_master_switch.xml │ │ ├── dialog_title.xml │ │ ├── dialog_item.xml │ │ ├── item_log_textview.xml │ │ └── scrollable_dialog.xml │ │ ├── values-night │ │ └── colors.xml │ │ ├── menu │ │ ├── menu_repo_item.xml │ │ ├── menu_modules.xml │ │ └── menu_home.xml │ │ ├── values-v30 │ │ └── themes.xml │ │ └── anim │ │ ├── fragment_enter.xml │ │ ├── fragment_exit.xml │ │ ├── fragment_enter_pop.xml │ │ └── fragment_exit_pop.xml └── proguard-rules.pro ├── daemon ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── org │ │ │ └── lsposed │ │ │ └── lspd │ │ │ ├── Main.java │ │ │ ├── service │ │ │ └── ObfuscationManager.java │ │ │ └── util │ │ │ └── InstallerVerifier.java │ │ ├── jni │ │ ├── packagename.h │ │ ├── abx_utils │ │ │ ├── xml_attribute.hpp │ │ │ ├── const.h │ │ │ └── xml_element.hpp │ │ └── CMakeLists.txt │ │ └── res │ │ ├── drawable │ │ ├── ic_baseline_check_24.xml │ │ ├── ic_baseline_close_24.xml │ │ └── ic_baseline_block_24.xml │ │ ├── values-zh-rCN │ │ └── strings.xml │ │ ├── values-zh-rHK │ │ └── strings.xml │ │ └── values-zh-rTW │ │ └── strings.xml └── proguard-rules.pro ├── hiddenapi ├── bridge │ ├── .gitignore │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── hidden │ │ │ └── ByteBufferDexClassLoader.java │ └── build.gradle.kts └── stubs │ ├── .gitignore │ ├── src │ └── main │ │ └── java │ │ ├── android │ │ ├── os │ │ │ ├── Parcel.java │ │ │ ├── Handler.java │ │ │ ├── ResultReceiver.java │ │ │ ├── PersistableBundle.java │ │ │ ├── IInterface.java │ │ │ ├── RemoteException.java │ │ │ ├── Environment.java │ │ │ ├── UserManager.java │ │ │ ├── Parcelable.java │ │ │ ├── UserHandle.java │ │ │ ├── IPowerManager.java │ │ │ ├── Build.java │ │ │ ├── SELinux.java │ │ │ ├── IServiceCallback.java │ │ │ ├── IServiceManager.java │ │ │ ├── ShellCallback.java │ │ │ ├── Bundle.java │ │ │ ├── ServiceManager.java │ │ │ ├── SystemProperties.java │ │ │ ├── IBinder.java │ │ │ ├── IUserManager.java │ │ │ └── ShellCommand.java │ │ ├── graphics │ │ │ ├── Movie.java │ │ │ └── drawable │ │ │ │ └── Drawable.java │ │ ├── app │ │ │ ├── Application.java │ │ │ ├── Notification.java │ │ │ ├── ResourcesManager.java │ │ │ ├── NotificationChannel.java │ │ │ ├── ContextImpl.java │ │ │ ├── ContentProviderHolder.java │ │ │ ├── ActivityManager.java │ │ │ ├── IUidObserver.java │ │ │ ├── LoadedApk.java │ │ │ ├── IServiceConnection.java │ │ │ ├── ProfilerInfo.java │ │ │ └── IApplicationThread.java │ │ ├── util │ │ │ ├── TypedValue.java │ │ │ ├── DisplayMetrics.java │ │ │ └── MutableInt.java │ │ ├── content │ │ │ ├── IntentSender.java │ │ │ ├── ComponentName.java │ │ │ ├── IntentFilter.java │ │ │ ├── pm │ │ │ │ ├── ResolveInfo.java │ │ │ │ ├── VersionedPackage.java │ │ │ │ ├── PackageInfo.java │ │ │ │ ├── UserInfo.java │ │ │ │ ├── PackageInstaller.java │ │ │ │ ├── BaseParceledListSlice.java │ │ │ │ ├── PackageManager.java │ │ │ │ ├── ParceledListSlice.java │ │ │ │ ├── ApplicationInfo.java │ │ │ │ ├── IPackageInstaller.java │ │ │ │ └── PackageParser.java │ │ │ ├── res │ │ │ │ ├── ResourcesKey.java │ │ │ │ ├── Configuration.java │ │ │ │ ├── ResourcesImpl.java │ │ │ │ ├── CompatibilityInfo.java │ │ │ │ ├── TypedArray.java │ │ │ │ ├── AssetManager.java │ │ │ │ └── Resources.java │ │ │ ├── AttributionSource.java │ │ │ ├── BroadcastReceiver.java │ │ │ ├── Context.java │ │ │ ├── Intent.java │ │ │ ├── IContentProvider.java │ │ │ └── IIntentSender.java │ │ ├── webkit │ │ │ ├── WebViewFactory.java │ │ │ ├── WebViewDelegate.java │ │ │ └── WebViewFactoryProvider.java │ │ ├── system │ │ │ ├── ErrnoException.java │ │ │ ├── Int32Ref.java │ │ │ └── Os.java │ │ ├── permission │ │ │ └── IPermissionManager.java │ │ ├── ddm │ │ │ └── DdmHandleAppName.java │ │ ├── view │ │ │ └── IWindowManager.java │ │ └── annotation │ │ │ └── NonNull.java │ │ ├── com │ │ └── android │ │ │ ├── internal │ │ │ ├── os │ │ │ │ ├── ZygoteInit.java │ │ │ │ └── BinderInternal.java │ │ │ └── util │ │ │ │ └── XmlUtils.java │ │ │ └── server │ │ │ ├── SystemService.java │ │ │ ├── am │ │ │ ├── ProcessRecord.java │ │ │ └── ActivityManagerService.java │ │ │ ├── SystemServiceManager.java │ │ │ └── LocalServices.java │ │ ├── org │ │ └── xmlpull │ │ │ └── v1 │ │ │ └── XmlPullParserException.java │ │ ├── sun │ │ ├── net │ │ │ └── www │ │ │ │ ├── protocol │ │ │ │ └── jar │ │ │ │ │ └── Handler.java │ │ │ │ └── ParseUtil.java │ │ └── misc │ │ │ └── CompoundEnumeration.java │ │ ├── dalvik │ │ └── system │ │ │ ├── VMRuntime.java │ │ │ └── BaseDexClassLoader.java │ │ └── xposed │ │ └── dummy │ │ ├── XTypedArraySuperClass.java │ │ └── XResourcesSuperClass.java │ └── build.gradle.kts ├── dex2oat ├── .gitignore ├── src │ └── main │ │ └── cpp │ │ └── CMakeLists.txt └── build.gradle.kts ├── services ├── daemon-service │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── aidl │ │ │ └── org │ │ │ └── lsposed │ │ │ └── lspd │ │ │ ├── service │ │ │ ├── IRemotePreferenceCallback.aidl │ │ │ ├── ILSPSystemServerService.aidl │ │ │ ├── ILSPInjectedModuleService.aidl │ │ │ ├── ILSPApplicationService.aidl │ │ │ └── ILSPosedService.aidl │ │ │ └── models │ │ │ ├── PreLoadedApk.aidl │ │ │ └── Module.aidl │ ├── proguard-rules.pro │ └── build.gradle.kts └── manager-service │ ├── .gitignore │ ├── proguard-rules.pro │ ├── src │ └── main │ │ ├── aidl │ │ └── org │ │ │ └── lsposed │ │ │ └── lspd │ │ │ └── models │ │ │ ├── UserInfo.aidl │ │ │ └── Application.aidl │ │ └── AndroidManifest.xml │ └── build.gradle.kts ├── magisk-loader ├── .gitignore ├── magisk_module │ ├── META-INF │ │ └── com │ │ │ └── google │ │ │ └── android │ │ │ ├── updater-script │ │ │ └── update-binary │ ├── action.sh │ ├── module.prop │ ├── sepolicy.rule │ ├── post-fs-data.sh │ ├── service.sh │ ├── uninstall.sh │ └── daemon ├── src │ └── main │ │ ├── jni │ │ ├── template │ │ │ └── loader.cpp │ │ ├── include │ │ │ └── loader.h │ │ ├── CMakeLists.txt │ │ └── src │ │ │ └── config_impl.h │ │ └── AndroidManifest.xml └── proguard-rules.pro ├── core ├── .gitignore └── src │ └── main │ ├── jni │ ├── template │ │ └── config.cpp │ ├── include │ │ ├── macros.h │ │ └── symbol_cache.h │ ├── src │ │ └── jni │ │ │ ├── dex_parser.h │ │ │ ├── hook_bridge.h │ │ │ ├── native_api.h │ │ │ └── resources_hook.h │ └── CMakeLists.txt │ └── java │ ├── io │ └── github │ │ └── libxposed │ │ └── api │ │ └── annotations │ │ ├── AfterInvocation.java │ │ ├── BeforeInvocation.java │ │ └── XposedHooker.java │ ├── org │ └── lsposed │ │ └── lspd │ │ ├── hooker │ │ ├── AttachHooker.java │ │ ├── CrashDumpHooker.java │ │ └── OpenDexFileHooker.java │ │ ├── nativebridge │ │ ├── DexParserBridge.java │ │ ├── NativeAPI.java │ │ └── HookBridge.java │ │ └── util │ │ └── Hookers.java │ └── de │ └── robv │ └── android │ └── xposed │ └── IXposedMod.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ └── feature_request.yml ├── dependabot.yml └── workflows │ └── crowdin.yml ├── .gitattributes ├── crowdin.yml ├── gradle.properties ├── .gitmodules ├── settings.gradle.kts ├── external └── CMakeLists.txt └── apache ├── build.gradle.kts └── local └── MemberUtilsX.java /axml/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /daemon/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /.cxx 3 | -------------------------------------------------------------------------------- /hiddenapi/bridge/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /hiddenapi/stubs/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /dex2oat/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /.cxx 3 | -------------------------------------------------------------------------------- /services/daemon-service/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /services/manager-service/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /services/manager-service/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /magisk-loader/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /release 3 | /.cxx 4 | -------------------------------------------------------------------------------- /core/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /.cxx 3 | /src/main/jni/src/config.cpp 4 | -------------------------------------------------------------------------------- /magisk-loader/magisk_module/META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /daemon/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/Parcel.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public class Parcel { 4 | } 5 | -------------------------------------------------------------------------------- /services/daemon-service/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/Handler.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public class Handler { 4 | } 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThePedroo/ReLSPosed/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/graphics/Movie.java: -------------------------------------------------------------------------------- 1 | package android.graphics; 2 | 3 | public class Movie { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/app/Application.java: -------------------------------------------------------------------------------- 1 | package android.app; 2 | 3 | public class Application { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/app/Notification.java: -------------------------------------------------------------------------------- 1 | package android.app; 2 | 3 | public class Notification { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/util/TypedValue.java: -------------------------------------------------------------------------------- 1 | package android.util; 2 | 3 | public class TypedValue { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/ResultReceiver.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public class ResultReceiver { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/util/DisplayMetrics.java: -------------------------------------------------------------------------------- 1 | package android.util; 2 | 3 | public class DisplayMetrics { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/app/ResourcesManager.java: -------------------------------------------------------------------------------- 1 | package android.app; 2 | 3 | public class ResourcesManager { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/IntentSender.java: -------------------------------------------------------------------------------- 1 | package android.content; 2 | 3 | public class IntentSender { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/PersistableBundle.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public class PersistableBundle { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/webkit/WebViewFactory.java: -------------------------------------------------------------------------------- 1 | package android.webkit; 2 | 3 | public class WebViewFactory { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/app/NotificationChannel.java: -------------------------------------------------------------------------------- 1 | package android.app; 2 | 3 | public class NotificationChannel { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/ComponentName.java: -------------------------------------------------------------------------------- 1 | package android.content; 2 | 3 | public final class ComponentName { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/IntentFilter.java: -------------------------------------------------------------------------------- 1 | package android.content; 2 | 3 | public class IntentFilter { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/pm/ResolveInfo.java: -------------------------------------------------------------------------------- 1 | package android.content.pm; 2 | 3 | public class ResolveInfo { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/res/ResourcesKey.java: -------------------------------------------------------------------------------- 1 | package android.content.res; 2 | 3 | public class ResourcesKey { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/webkit/WebViewDelegate.java: -------------------------------------------------------------------------------- 1 | package android.webkit; 2 | 3 | public class WebViewDelegate { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/AttributionSource.java: -------------------------------------------------------------------------------- 1 | package android.content; 2 | 3 | public class AttributionSource { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/res/Configuration.java: -------------------------------------------------------------------------------- 1 | package android.content.res; 2 | 3 | public class Configuration { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/res/ResourcesImpl.java: -------------------------------------------------------------------------------- 1 | package android.content.res; 2 | 3 | public class ResourcesImpl { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/graphics/drawable/Drawable.java: -------------------------------------------------------------------------------- 1 | package android.graphics.drawable; 2 | 3 | public class Drawable { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/com/android/internal/os/ZygoteInit.java: -------------------------------------------------------------------------------- 1 | package com.android.internal.os; 2 | 3 | public class ZygoteInit { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/pm/VersionedPackage.java: -------------------------------------------------------------------------------- 1 | package android.content.pm; 2 | 3 | public class VersionedPackage { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/res/CompatibilityInfo.java: -------------------------------------------------------------------------------- 1 | package android.content.res; 2 | 3 | public class CompatibilityInfo { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/webkit/WebViewFactoryProvider.java: -------------------------------------------------------------------------------- 1 | package android.webkit; 2 | 3 | public class WebViewFactoryProvider { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/com/android/server/SystemService.java: -------------------------------------------------------------------------------- 1 | package com.android.server; 2 | 3 | public abstract class SystemService { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/IInterface.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public interface IInterface { 4 | 5 | IBinder asBinder(); 6 | } 7 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/system/ErrnoException.java: -------------------------------------------------------------------------------- 1 | package android.system; 2 | 3 | public final class ErrnoException extends Exception { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/org/xmlpull/v1/XmlPullParserException.java: -------------------------------------------------------------------------------- 1 | package org.xmlpull.v1; 2 | 3 | public class XmlPullParserException extends Throwable { 4 | } 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/app/ContextImpl.java: -------------------------------------------------------------------------------- 1 | package android.app; 2 | 3 | import android.content.Context; 4 | 5 | public class ContextImpl extends Context { 6 | } 7 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/pm/PackageInfo.java: -------------------------------------------------------------------------------- 1 | package android.content.pm; 2 | 3 | public class PackageInfo { 4 | 5 | public String overlayTarget; 6 | } 7 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/pm/UserInfo.java: -------------------------------------------------------------------------------- 1 | package android.content.pm; 2 | 3 | public class UserInfo { 4 | public int id; 5 | public String name; 6 | } 7 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/com/android/server/am/ProcessRecord.java: -------------------------------------------------------------------------------- 1 | package com.android.server.am; 2 | 3 | public class ProcessRecord { 4 | String processName = null; 5 | } 6 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/sun/net/www/protocol/jar/Handler.java: -------------------------------------------------------------------------------- 1 | package sun.net.www.protocol.jar; 2 | 3 | public abstract class Handler extends java.net.URLStreamHandler { 4 | } 5 | -------------------------------------------------------------------------------- /services/manager-service/src/main/aidl/org/lsposed/lspd/models/UserInfo.aidl: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.models; 2 | 3 | parcelable UserInfo { 4 | int id; 5 | String name; 6 | } 7 | -------------------------------------------------------------------------------- /core/src/main/jni/template/config.cpp: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | namespace lspd { 4 | const int versionCode = ${VERSION_CODE}; 5 | const char* const versionName = "${VERSION_NAME}"; 6 | } 7 | -------------------------------------------------------------------------------- /magisk-loader/src/main/jni/template/loader.cpp: -------------------------------------------------------------------------------- 1 | #include "loader.h" 2 | 3 | namespace lspd { 4 | const int apiVersion = ${API_VERSION}; 5 | const char* const moduleName = "${MODULE_NAME}"; 6 | } 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | apache/build 2 | apache/local/generated 3 | .project 4 | .settings 5 | .cache 6 | *.iml 7 | .gradle 8 | /local.properties 9 | /.idea 10 | .DS_Store 11 | /build 12 | /captures 13 | -------------------------------------------------------------------------------- /services/manager-service/src/main/aidl/org/lsposed/lspd/models/Application.aidl: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.models; 2 | 3 | parcelable Application { 4 | String packageName; 5 | int userId; 6 | } 7 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/BroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | package android.content; 2 | 3 | public abstract class BroadcastReceiver { 4 | public abstract void onReceive(Context context, Intent intent); 5 | } 6 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/permission/IPermissionManager.java: -------------------------------------------------------------------------------- 1 | package android.permission; 2 | 3 | import java.util.List; 4 | 5 | public interface IPermissionManager { 6 | 7 | List getSplitPermissions(); 8 | } 9 | -------------------------------------------------------------------------------- /services/daemon-service/src/main/aidl/org/lsposed/lspd/service/IRemotePreferenceCallback.aidl: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.service; 2 | 3 | interface IRemotePreferenceCallback { 4 | oneway void onUpdate(in Bundle map); 5 | } 6 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/app/ContentProviderHolder.java: -------------------------------------------------------------------------------- 1 | package android.app; 2 | 3 | import android.content.IContentProvider; 4 | 5 | public class ContentProviderHolder { 6 | public IContentProvider provider; 7 | } 8 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/pm/PackageInstaller.java: -------------------------------------------------------------------------------- 1 | package android.content.pm; 2 | 3 | public class PackageInstaller { 4 | public static class SessionParams { 5 | public int installFlags = 0; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/res/TypedArray.java: -------------------------------------------------------------------------------- 1 | package android.content.res; 2 | 3 | public class TypedArray { 4 | protected TypedArray(Resources resources) { 5 | throw new UnsupportedOperationException("STUB"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/util/MutableInt.java: -------------------------------------------------------------------------------- 1 | package android.util; 2 | 3 | public final class MutableInt { 4 | public int value; 5 | 6 | public MutableInt(int value) { 7 | this.value = value; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/sun/net/www/ParseUtil.java: -------------------------------------------------------------------------------- 1 | package sun.net.www; 2 | 3 | public class ParseUtil { 4 | public static String encodePath(String path, boolean flag) { 5 | throw new RuntimeException("Stub!"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/ddm/DdmHandleAppName.java: -------------------------------------------------------------------------------- 1 | package android.ddm; 2 | 3 | public class DdmHandleAppName { 4 | public static void setAppName(String name, int userId) { 5 | throw new RuntimeException("STUB"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/com/android/internal/os/BinderInternal.java: -------------------------------------------------------------------------------- 1 | package com.android.internal.os; 2 | 3 | import android.os.IBinder; 4 | 5 | public class BinderInternal { 6 | public static final native IBinder getContextObject(); 7 | } 8 | -------------------------------------------------------------------------------- /magisk-loader/magisk_module/action.sh: -------------------------------------------------------------------------------- 1 | DEFAULT_MANAGER_PACKAGE_NAME=org.lsposed.manager 2 | INJECTED_PACKAGE_NAME=com.android.shell 3 | 4 | am start -c "${DEFAULT_MANAGER_PACKAGE_NAME}.LAUNCH_MANAGER" "${INJECTED_PACKAGE_NAME}/.BugreportWarningActivity" 5 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/RemoteException.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public class RemoteException extends Exception { 4 | 5 | public RemoteException(String message) { 6 | throw new RuntimeException("STUB"); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Ask a question/提问 4 | url: https://github.com/ThePedroo/ReLSPosed/discussions/new?category=Q-A 5 | about: Please ask and answer questions here./如果有任何疑问请在这里提问 6 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/com/android/server/SystemServiceManager.java: -------------------------------------------------------------------------------- 1 | package com.android.server; 2 | 3 | import java.util.ArrayList; 4 | 5 | public class SystemServiceManager { 6 | private final ArrayList mServices = new ArrayList<>(); 7 | } 8 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/com/android/server/LocalServices.java: -------------------------------------------------------------------------------- 1 | package com.android.server; 2 | 3 | public class LocalServices { 4 | 5 | public static T getService(Class type) { 6 | throw new UnsupportedOperationException("STUB"); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /daemon/src/main/java/org/lsposed/lspd/Main.java: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd; 2 | 3 | import org.lsposed.lspd.service.ServiceManager; 4 | 5 | public class Main { 6 | 7 | public static void main(String[] args) { 8 | ServiceManager.start(args); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/pm/BaseParceledListSlice.java: -------------------------------------------------------------------------------- 1 | package android.content.pm; 2 | 3 | import java.util.List; 4 | 5 | abstract class BaseParceledListSlice { 6 | 7 | public List getList() { 8 | throw new RuntimeException("STUB"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /services/daemon-service/src/main/aidl/org/lsposed/lspd/models/PreLoadedApk.aidl: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.models; 2 | 3 | parcelable PreLoadedApk { 4 | List preLoadedDexes; 5 | List moduleClassNames; 6 | List moduleLibraryNames; 7 | boolean legacy; 8 | } 9 | -------------------------------------------------------------------------------- /daemon/src/main/jni/packagename.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | size_t get_pkg_from_classpath_arg(const char* classpath_dir, char* package_name, size_t package_name_buffer_size); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/Environment.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | import java.io.File; 4 | 5 | public class Environment { 6 | public static File getDataProfilesDePackageDirectory(int userId, String packageName) { 7 | throw new IllegalArgumentException("STUB"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/UserManager.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | import android.content.pm.UserInfo; 4 | 5 | import java.util.List; 6 | 7 | public class UserManager { 8 | public List getUsers() { 9 | throw new UnsupportedOperationException("STUB"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/pm/PackageManager.java: -------------------------------------------------------------------------------- 1 | package android.content.pm; 2 | 3 | import java.util.List; 4 | 5 | public class PackageManager { 6 | public List getInstalledPackagesAsUser(int flags, int userId) { 7 | throw new UnsupportedOperationException("STUB"); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/pm/ParceledListSlice.java: -------------------------------------------------------------------------------- 1 | package android.content.pm; 2 | 3 | import java.util.List; 4 | 5 | public class ParceledListSlice extends BaseParceledListSlice { 6 | public ParceledListSlice(List list) { 7 | throw new IllegalArgumentException("STUB"); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/Parcelable.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public interface Parcelable { 4 | interface Creator{ 5 | public T createFromParcel(Parcel source); 6 | public T[] newArray(int size); 7 | } 8 | void writeToParcel(Parcel dest, int flags); 9 | int describeContents(); 10 | } 11 | -------------------------------------------------------------------------------- /services/daemon-service/src/main/aidl/org/lsposed/lspd/service/ILSPSystemServerService.aidl: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.service; 2 | 3 | import org.lsposed.lspd.service.ILSPApplicationService; 4 | 5 | interface ILSPSystemServerService { 6 | ILSPApplicationService requestApplicationService(int uid, int pid, String processName, IBinder heartBeat); 7 | } 8 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/pm/ApplicationInfo.java: -------------------------------------------------------------------------------- 1 | package android.content.pm; 2 | 3 | import androidx.annotation.RequiresApi; 4 | 5 | public class ApplicationInfo { 6 | public String credentialProtectedDataDir; 7 | 8 | public String[] resourceDirs; 9 | 10 | @RequiresApi(31) 11 | public String[] overlayPaths; 12 | } 13 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/app/ActivityManager.java: -------------------------------------------------------------------------------- 1 | package android.app; 2 | 3 | public class ActivityManager { 4 | public static int UID_OBSERVER_GONE; 5 | public static int UID_OBSERVER_ACTIVE; 6 | public static int UID_OBSERVER_IDLE; 7 | public static int UID_OBSERVER_CACHED; 8 | public static int PROCESS_STATE_UNKNOWN; 9 | } 10 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/system/Int32Ref.java: -------------------------------------------------------------------------------- 1 | package android.system; 2 | 3 | import java.util.Objects; 4 | 5 | public class Int32Ref { 6 | public int value; 7 | 8 | public Int32Ref(int value) { 9 | this.value = value; 10 | } 11 | 12 | @Override public String toString() { 13 | return Objects.toString(this); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /magisk-loader/magisk_module/module.prop: -------------------------------------------------------------------------------- 1 | id=${moduleId} 2 | name=ReLSPosed 3 | version=${versionName} (${versionCode}) 4 | versionCode=${versionCode} 5 | author=${authorList} 6 | description=Another, but detection enhanced, implementation of Xposed Framework. Supports Android 8.1 ~ 16. 7 | updateJson=https://raw.githubusercontent.com/ThePedroo/RemoteFiles/refs/heads/main/ReLSPosed/update.json -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto eol=lf 3 | 4 | # Declare files that will always have CRLF line endings on checkout. 5 | *.cmd text eol=crlf 6 | *.bat text eol=crlf 7 | 8 | # Denote all files that are truly binary and should not be modified. 9 | *.so binary 10 | *.dex binary 11 | *.jar binary 12 | *.png binary 13 | -------------------------------------------------------------------------------- /daemon/src/main/res/drawable/ic_baseline_check_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /core/src/main/java/io/github/libxposed/api/annotations/AfterInvocation.java: -------------------------------------------------------------------------------- 1 | package io.github.libxposed.api.annotations; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.METHOD) 10 | public @interface AfterInvocation { 11 | } 12 | -------------------------------------------------------------------------------- /core/src/main/java/io/github/libxposed/api/annotations/BeforeInvocation.java: -------------------------------------------------------------------------------- 1 | package io.github.libxposed.api.annotations; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.METHOD) 10 | public @interface BeforeInvocation { 11 | } 12 | -------------------------------------------------------------------------------- /daemon/src/main/java/org/lsposed/lspd/service/ObfuscationManager.java: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.service; 2 | 3 | import android.os.SharedMemory; 4 | 5 | import java.util.HashMap; 6 | 7 | public class ObfuscationManager { 8 | // For module dexes 9 | static native SharedMemory obfuscateDex(SharedMemory memory); 10 | 11 | // generates signature 12 | static native HashMap getSignatures(); 13 | } 14 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/dalvik/system/VMRuntime.java: -------------------------------------------------------------------------------- 1 | package dalvik.system; 2 | 3 | public class VMRuntime { 4 | 5 | public static VMRuntime getRuntime() { 6 | throw new RuntimeException("Stub!"); 7 | } 8 | 9 | // Use `Process.is64Bit()` instead 10 | public native boolean is64Bit(); 11 | 12 | public native String vmInstructionSet(); 13 | 14 | public native boolean isJavaDebuggable(); 15 | } 16 | -------------------------------------------------------------------------------- /services/daemon-service/src/main/aidl/org/lsposed/lspd/models/Module.aidl: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.models; 2 | import org.lsposed.lspd.models.PreLoadedApk; 3 | import org.lsposed.lspd.service.ILSPInjectedModuleService; 4 | 5 | parcelable Module { 6 | String packageName; 7 | int appId; 8 | String apkPath; 9 | PreLoadedApk file; 10 | ApplicationInfo applicationInfo; 11 | ILSPInjectedModuleService service; 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/io/github/libxposed/api/annotations/XposedHooker.java: -------------------------------------------------------------------------------- 1 | package io.github.libxposed.api.annotations; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target({ElementType.TYPE, ElementType.TYPE_USE}) 10 | public @interface XposedHooker { 11 | } 12 | -------------------------------------------------------------------------------- /daemon/src/main/res/drawable/ic_baseline_close_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/UserHandle.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | import android.annotation.NonNull; 4 | 5 | public class UserHandle { 6 | 7 | public UserHandle(int h) { 8 | throw new RuntimeException("STUB"); 9 | } 10 | 11 | public int getIdentifier() { 12 | throw new RuntimeException("STUB"); 13 | } 14 | 15 | public static final @NonNull 16 | UserHandle ALL = null; 17 | } 18 | -------------------------------------------------------------------------------- /magisk-loader/magisk_module/sepolicy.rule: -------------------------------------------------------------------------------- 1 | allow dex2oat dex2oat_exec file execute_no_trans 2 | 3 | allow shell shell dir write 4 | 5 | type xposed_file file_type 6 | typeattribute xposed_file mlstrustedobject 7 | allow domain xposed_file {file dir} * 8 | 9 | allow dex2oat unlabeled file * 10 | 11 | type xposed_data file_type 12 | typeattribute xposed_data mlstrustedobject 13 | allow * xposed_data {file dir} * 14 | allow system_server apk_data_file file execute -------------------------------------------------------------------------------- /daemon/src/main/jni/abx_utils/xml_attribute.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* 4 | * This decoder is made by frknkrc44. 5 | * 6 | * Thanks DanGLES3 and fatalcoder524 to find memory leaks. 7 | */ 8 | 9 | class XMLAttribute { 10 | public: 11 | std::vector mValue; 12 | int mDataType; 13 | XMLAttribute(int dataType, std::vector value) { 14 | mDataType = dataType; 15 | mValue.insert(mValue.begin(), value.begin(), value.end()); 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/app/IUidObserver.java: -------------------------------------------------------------------------------- 1 | package android.app; 2 | 3 | import android.os.Binder; 4 | 5 | public interface IUidObserver { 6 | 7 | void onUidGone(int uid, boolean disabled); 8 | 9 | void onUidActive(int uid); 10 | 11 | void onUidIdle(int uid, boolean disabled); 12 | 13 | void onUidCachedChanged(int uid, boolean cached); 14 | 15 | abstract class Stub extends Binder implements IUidObserver { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/IPowerManager.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public interface IPowerManager extends IInterface { 4 | void reboot(boolean confirm, String reason, boolean wait) throws RemoteException; 5 | 6 | abstract class Stub extends Binder implements IPowerManager { 7 | 8 | public static IPowerManager asInterface(IBinder obj) { 9 | throw new UnsupportedOperationException(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /services/daemon-service/src/main/aidl/org/lsposed/lspd/service/ILSPInjectedModuleService.aidl: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.service; 2 | 3 | import org.lsposed.lspd.service.IRemotePreferenceCallback; 4 | 5 | interface ILSPInjectedModuleService { 6 | int getFrameworkPrivilege(); 7 | 8 | Bundle requestRemotePreferences(String group, IRemotePreferenceCallback callback); 9 | 10 | ParcelFileDescriptor openRemoteFile(String path); 11 | 12 | String[] getRemoteFileList(); 13 | } 14 | -------------------------------------------------------------------------------- /services/daemon-service/src/main/aidl/org/lsposed/lspd/service/ILSPApplicationService.aidl: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.service; 2 | 3 | import org.lsposed.lspd.models.Module; 4 | 5 | interface ILSPApplicationService { 6 | boolean isLogMuted(); 7 | 8 | List getLegacyModulesList(); 9 | 10 | List getModulesList(); 11 | 12 | String getPrefsPath(String packageName); 13 | 14 | ParcelFileDescriptor requestInjectedManagerBinder(out List binder); 15 | } 16 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/com/android/internal/util/XmlUtils.java: -------------------------------------------------------------------------------- 1 | package com.android.internal.util; 2 | 3 | import org.xmlpull.v1.XmlPullParserException; 4 | 5 | import java.io.IOException; 6 | import java.io.InputStream; 7 | import java.util.HashMap; 8 | 9 | public class XmlUtils { 10 | @SuppressWarnings("rawtypes") 11 | public static final HashMap readMapXml(InputStream in) throws XmlPullParserException, IOException { 12 | throw new UnsupportedOperationException("STUB"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /axml/build.gradle.kts: -------------------------------------------------------------------------------- 1 | val androidSourceCompatibility: JavaVersion by rootProject.extra 2 | val androidTargetCompatibility: JavaVersion by rootProject.extra 3 | 4 | plugins { 5 | id("java-library") 6 | } 7 | 8 | java { 9 | sourceCompatibility = androidSourceCompatibility 10 | targetCompatibility = androidTargetCompatibility 11 | sourceSets { 12 | main { 13 | java.srcDirs("libs/manifest-editor/lib/src/main/java") 14 | resources.srcDirs("libs/manifest-editor/lib/src/main") 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/Build.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public class Build { 4 | public static class VERSION { 5 | public final static int SDK_INT = SystemProperties.getInt( 6 | "ro.build.version.sdk", 0); 7 | } 8 | public static class VERSION_CODES { 9 | public static final int O_MR1 = 27; 10 | public static final int P = 28; 11 | public static final int Q = 29; 12 | public static final int R = 30; 13 | public static final int S = 31; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /services/daemon-service/src/main/aidl/org/lsposed/lspd/service/ILSPosedService.aidl: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.service; 2 | 3 | import org.lsposed.lspd.service.ILSPApplicationService; 4 | 5 | interface ILSPosedService { 6 | ILSPApplicationService requestApplicationService(int uid, int pid, String processName, IBinder heartBeat); 7 | 8 | oneway void dispatchSystemServerContext(in IBinder activityThread, in IBinder activityToken, String api); 9 | 10 | boolean preStartManager(); 11 | 12 | boolean setManagerEnabled(boolean enabled); 13 | } 14 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/res/AssetManager.java: -------------------------------------------------------------------------------- 1 | package android.content.res; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | public final class AssetManager { 7 | public final int addAssetPath(String path) { 8 | throw new UnsupportedOperationException("STUB"); 9 | } 10 | 11 | public void close() { 12 | throw new UnsupportedOperationException("STUB"); 13 | } 14 | 15 | public final InputStream open(String fileName) throws IOException { 16 | throw new UnsupportedOperationException("STUB"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /core/src/main/jni/include/macros.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include // for size_t 4 | #include // for TEMP_FAILURE_RETRY 5 | #include 6 | // The arraysize(arr) macro returns the # of elements in an array arr. 7 | // The expression is a compile-time constant, and therefore can be 8 | // used in defining new arrays, for example. If you use arraysize on 9 | // a pointer by mistake, you will get a compile-time error. 10 | template 11 | [[gnu::always_inline]] constexpr inline size_t arraysize(T(&)[N]) { 12 | return N; 13 | } 14 | -------------------------------------------------------------------------------- /daemon/src/main/res/drawable/ic_baseline_block_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/SELinux.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public class SELinux { 4 | public static boolean checkSELinuxAccess(String scon, String tcon, String tclass, String perm) { 5 | throw new UnsupportedOperationException("Stub"); 6 | } 7 | 8 | public static boolean setFileContext(String path, String context) { 9 | throw new UnsupportedOperationException("Stub"); 10 | } 11 | 12 | public static boolean setFSCreateContext(String context){ 13 | throw new UnsupportedOperationException("Stub"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/view/IWindowManager.java: -------------------------------------------------------------------------------- 1 | package android.view; 2 | 3 | import android.app.IActivityManager; 4 | import android.os.Binder; 5 | import android.os.Bundle; 6 | import android.os.IBinder; 7 | import android.os.IInterface; 8 | 9 | public interface IWindowManager extends IInterface { 10 | void lockNow(Bundle options); 11 | 12 | abstract class Stub extends Binder implements IWindowManager { 13 | public static IWindowManager asInterface(IBinder obj) { 14 | throw new UnsupportedOperationException(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/IServiceCallback.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | public interface IServiceCallback extends IInterface 3 | { 4 | public static abstract class Stub extends android.os.Binder implements android.os.IServiceCallback { 5 | } 6 | /** 7 | * Called when a service is registered. 8 | * 9 | * @param name the service name that has been registered with 10 | * @param binder the binder that is registered 11 | */ 12 | public void onRegistration(java.lang.String name, android.os.IBinder binder) throws android.os.RemoteException; 13 | } 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | schedule: 6 | interval: monthly 7 | groups: 8 | actions: 9 | patterns: 10 | - "*" 11 | - package-ecosystem: gitsubmodule 12 | directory: / 13 | schedule: 14 | interval: monthly 15 | groups: 16 | submodule: 17 | patterns: 18 | - "*" 19 | - package-ecosystem: gradle 20 | directory: / 21 | schedule: 22 | interval: daily 23 | groups: 24 | maven: 25 | patterns: 26 | - "*" 27 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/IServiceManager.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public interface IServiceManager extends IInterface { 4 | 5 | void tryUnregisterService(java.lang.String name, android.os.IBinder service); 6 | 7 | IBinder getService(String name); 8 | 9 | public void registerForNotifications(String name, IServiceCallback cb); 10 | 11 | abstract class Stub extends Binder implements IServiceManager { 12 | public static IServiceManager asInterface(IBinder obj) { 13 | throw new UnsupportedOperationException(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/com/android/server/am/ActivityManagerService.java: -------------------------------------------------------------------------------- 1 | package com.android.server.am; 2 | 3 | import com.android.server.SystemService; 4 | 5 | public class ActivityManagerService { 6 | public static final class Lifecycle extends SystemService { 7 | public ActivityManagerService getService() { 8 | throw new UnsupportedOperationException("STUB"); 9 | } 10 | private ProcessRecord findProcessLocked(String process, int userId, String callName) { 11 | throw new UnsupportedOperationException("STUB"); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/org/lsposed/manager/util/AccessibilityUtils.java: -------------------------------------------------------------------------------- 1 | package org.lsposed.manager.util; 2 | 3 | import android.content.ContentResolver; 4 | import android.provider.Settings; 5 | 6 | public class AccessibilityUtils { 7 | public static boolean isAnimationEnabled(ContentResolver cr) { 8 | return !(Settings.Global.getFloat(cr, Settings.Global.ANIMATOR_DURATION_SCALE, 1.0f) == 0.0f 9 | && Settings.Global.getFloat(cr, Settings.Global.TRANSITION_ANIMATION_SCALE, 1.0f) == 0.0f 10 | && Settings.Global.getFloat(cr, Settings.Global.WINDOW_ANIMATION_SCALE, 1.0f) == 0.0f); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/Context.java: -------------------------------------------------------------------------------- 1 | package android.content; 2 | 3 | import android.os.Handler; 4 | import android.os.IBinder; 5 | import android.os.UserHandle; 6 | 7 | public class Context { 8 | public IBinder getActivityToken() { 9 | throw new UnsupportedOperationException("STUB"); 10 | } 11 | public Intent registerReceiverAsUser(BroadcastReceiver receiver, UserHandle user, 12 | IntentFilter filter, String broadcastPermission, Handler scheduler) { 13 | throw new UnsupportedOperationException("STUB"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/dalvik/system/BaseDexClassLoader.java: -------------------------------------------------------------------------------- 1 | package dalvik.system; 2 | 3 | import java.nio.ByteBuffer; 4 | 5 | public class BaseDexClassLoader extends ClassLoader { 6 | public BaseDexClassLoader(ByteBuffer[] dexFiles, ClassLoader parent) { 7 | throw new RuntimeException("Stub!"); 8 | } 9 | 10 | public BaseDexClassLoader(ByteBuffer[] dexFiles, String librarySearchPath, ClassLoader parent) { 11 | throw new RuntimeException("Stub!"); 12 | } 13 | 14 | public String getLdLibraryPath() { 15 | throw new RuntimeException("Stub!"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /core/src/main/java/org/lsposed/lspd/hooker/AttachHooker.java: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.hooker; 2 | 3 | import android.app.ActivityThread; 4 | 5 | import androidx.annotation.NonNull; 6 | 7 | import de.robv.android.xposed.XposedInit; 8 | import io.github.libxposed.api.XposedInterface; 9 | import io.github.libxposed.api.annotations.XposedHooker; 10 | 11 | @XposedHooker 12 | public class AttachHooker implements XposedInterface.Hooker { 13 | 14 | public static void after(@NonNull XposedInterface.AfterHookCallback callback) { 15 | XposedInit.loadModules((ActivityThread) callback.getThisObject()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /crowdin.yml: -------------------------------------------------------------------------------- 1 | project_id_env: CROWDIN_PROJECT_ID 2 | api_token_env: CROWDIN_API_TOKEN 3 | base_path: . 4 | base_url: 'https://api.crowdin.com' 5 | pull_request_title: '[translation] Update translation from Crowdin' 6 | preserve_hierarchy: 1 7 | files: 8 | - source: /app/src/main/res/values/strings.xml 9 | translation: /app/src/main/res/values-%two_letters_code%/%original_file_name% 10 | type: android 11 | dest: /app/strings.xml 12 | - source: /daemon/src/main/res/values/strings.xml 13 | translation: /daemon/src/main/res/values-%two_letters_code%/%original_file_name% 14 | type: android 15 | dest: /daemon/strings.xml 16 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/app/LoadedApk.java: -------------------------------------------------------------------------------- 1 | package android.app; 2 | 3 | import android.content.pm.ApplicationInfo; 4 | 5 | public final class LoadedApk { 6 | private ClassLoader mDefaultClassLoader; 7 | 8 | public ApplicationInfo getApplicationInfo() { 9 | throw new UnsupportedOperationException("STUB"); 10 | } 11 | 12 | public ClassLoader getClassLoader() { 13 | throw new UnsupportedOperationException("STUB"); 14 | } 15 | 16 | public String getPackageName() { 17 | throw new UnsupportedOperationException("STUB"); 18 | } 19 | 20 | public String getResDir() { 21 | throw new UnsupportedOperationException("STUB"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /hiddenapi/bridge/src/main/java/hidden/ByteBufferDexClassLoader.java: -------------------------------------------------------------------------------- 1 | package hidden; 2 | 3 | import java.nio.ByteBuffer; 4 | 5 | import dalvik.system.BaseDexClassLoader; 6 | 7 | public class ByteBufferDexClassLoader extends BaseDexClassLoader { 8 | 9 | public ByteBufferDexClassLoader(ByteBuffer[] dexFiles, ClassLoader parent) { 10 | super(dexFiles, parent); 11 | } 12 | 13 | public ByteBufferDexClassLoader(ByteBuffer[] dexFiles, String librarySearchPath, ClassLoader parent) { 14 | super(dexFiles, librarySearchPath, parent); 15 | } 16 | 17 | public String getLdLibraryPath() { 18 | return super.getLdLibraryPath(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/res/Resources.java: -------------------------------------------------------------------------------- 1 | package android.content.res; 2 | 3 | import android.util.DisplayMetrics; 4 | 5 | public class Resources { 6 | public Resources(AssetManager assets, DisplayMetrics metrics, Configuration config) { 7 | throw new UnsupportedOperationException("STUB"); 8 | } 9 | 10 | public Resources(ClassLoader classLoader) { 11 | throw new UnsupportedOperationException("STUB"); 12 | } 13 | 14 | public void setImpl(ResourcesImpl impl) { 15 | throw new UnsupportedOperationException("STUB"); 16 | } 17 | 18 | public CompatibilityInfo getCompatibilityInfo() { 19 | throw new UnsupportedOperationException("STUB"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/assets/webview/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
@body@
13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/assets/webview/template_dark.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
@body@
13 | 14 | 15 | -------------------------------------------------------------------------------- /magisk-loader/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | -keepclasseswithmembers class org.lsposed.lspd.core.Main { 2 | public static void forkCommon(boolean, java.lang.String, java.lang.String, android.os.IBinder); 3 | } 4 | -keepclasseswithmembers,includedescriptorclasses class * { 5 | native ; 6 | } 7 | -keepclasseswithmembers class org.lsposed.lspd.service.BridgeService { 8 | public static boolean *(android.os.IBinder, int, long, long, int); 9 | } 10 | 11 | -assumenosideeffects class android.util.Log { 12 | public static *** v(...); 13 | public static *** d(...); 14 | } 15 | -repackageclasses 16 | -allowaccessmodification 17 | -dontwarn org.lsposed.lspd.core.* 18 | -dontwarn org.lsposed.lspd.util.Hookers 19 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/pm/IPackageInstaller.java: -------------------------------------------------------------------------------- 1 | package android.content.pm; 2 | 3 | import android.os.Binder; 4 | import android.os.IBinder; 5 | import android.os.IInterface; 6 | 7 | public interface IPackageInstaller extends IInterface { 8 | 9 | void uninstall(android.content.pm.VersionedPackage versionedPackage, java.lang.String callerPackageName, int flags, android.content.IntentSender statusReceiver, int userId) throws android.os.RemoteException; 10 | 11 | abstract class Stub extends Binder implements IPackageInstaller { 12 | public static IPackageInstaller asInterface(IBinder obj) { 13 | throw new UnsupportedOperationException(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/system/Os.java: -------------------------------------------------------------------------------- 1 | package android.system; 2 | 3 | import android.util.MutableInt; 4 | 5 | import androidx.annotation.RequiresApi; 6 | 7 | import java.io.FileDescriptor; 8 | 9 | public class Os { 10 | public static int ioctlInt(FileDescriptor fd, int cmd, MutableInt arg) throws ErrnoException { 11 | throw new ErrnoException(); 12 | } 13 | 14 | @RequiresApi(27) 15 | public static int ioctlInt(FileDescriptor fd, int cmd, Int32Ref arg) throws ErrnoException { 16 | throw new ErrnoException(); 17 | } 18 | 19 | @RequiresApi(31) 20 | public static int ioctlInt(FileDescriptor fd, int cmd) throws ErrnoException { 21 | throw new ErrnoException(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/app/IServiceConnection.java: -------------------------------------------------------------------------------- 1 | package android.app; 2 | 3 | import android.content.ComponentName; 4 | import android.os.Binder; 5 | import android.os.IBinder; 6 | import android.os.IInterface; 7 | 8 | public interface IServiceConnection extends IInterface { 9 | void connected(ComponentName name, IBinder service, boolean dead); 10 | 11 | abstract class Stub extends Binder implements IServiceConnection { 12 | 13 | public static IServiceConnection asInterface(IBinder obj) { 14 | throw new UnsupportedOperationException(); 15 | } 16 | 17 | @Override 18 | public IBinder asBinder() { 19 | throw new UnsupportedOperationException(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /magisk-loader/magisk_module/META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | ################# 2 | # Initialization 3 | ################# 4 | 5 | umask 022 6 | 7 | # echo before loading util_functions 8 | ui_print() { echo "$1"; } 9 | 10 | require_new_magisk() { 11 | ui_print "*******************************" 12 | ui_print " Please install Magisk v20.4+! " 13 | ui_print "*******************************" 14 | exit 1 15 | } 16 | 17 | ######################### 18 | # Load util_functions.sh 19 | ######################### 20 | 21 | OUTFD=$2 22 | ZIPFILE=$3 23 | 24 | [ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk 25 | . /data/adb/magisk/util_functions.sh 26 | [ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk 27 | 28 | install_module 29 | exit 0 30 | -------------------------------------------------------------------------------- /core/src/main/java/org/lsposed/lspd/hooker/CrashDumpHooker.java: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.hooker; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import org.lsposed.lspd.impl.LSPosedBridge; 6 | import org.lsposed.lspd.util.Utils.Log; 7 | 8 | import io.github.libxposed.api.XposedInterface; 9 | import io.github.libxposed.api.annotations.XposedHooker; 10 | 11 | @XposedHooker 12 | public class CrashDumpHooker implements XposedInterface.Hooker { 13 | 14 | public static void before(@NonNull XposedInterface.BeforeHookCallback callback) { 15 | try { 16 | var e = (Throwable) callback.getArgs()[0]; 17 | LSPosedBridge.log("Crash unexpectedly: " + Log.getStackTraceString(e)); 18 | } catch (Throwable ignored) { 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | ## For more details on how to configure your build environment visit 2 | # http://www.gradle.org/docs/current/userguide/build_environment.html 3 | # 4 | # Specifies the JVM arguments used for the daemon process. 5 | # The setting is particularly useful for tweaking memory settings. 6 | # Default value: -Xmx1024m -XX:MaxPermSize=256m 7 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 8 | # 9 | # When configured, Gradle will run in incubating parallel mode. 10 | # This option should only be used with decoupled projects. More details, visit 11 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 12 | # org.gradle.parallel=true 13 | 14 | android.useAndroidX=true 15 | android.nonFinalResIds=false 16 | -------------------------------------------------------------------------------- /.github/workflows/crowdin.yml: -------------------------------------------------------------------------------- 1 | name: Crowdin Action 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: [ master ] 7 | paths: 8 | - app/src/main/res/values/strings.xml 9 | - daemon/src/main/res/values/strings.xml 10 | 11 | jobs: 12 | synchronize-with-crowdin: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@main 17 | 18 | - name: crowdin action 19 | uses: crowdin/github-action@master 20 | with: 21 | upload_translations: true 22 | download_translations: false 23 | upload_sources: true 24 | config: 'crowdin.yml' 25 | crowdin_branch_name: master 26 | env: 27 | CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} 28 | CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} 29 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "external/lsplant"] 2 | path = external/lsplant 3 | url = https://github.com/JingMatrix/LSPlant.git 4 | [submodule "external/dobby"] 5 | path = external/dobby 6 | url = https://github.com/JingMatrix/Dobby.git 7 | [submodule "external/fmt"] 8 | path = external/fmt 9 | url = https://github.com/fmtlib/fmt.git 10 | [submodule "patch/libs/manifest-editor"] 11 | path = axml/libs/manifest-editor 12 | url = https://github.com/JingMatrix/ManifestEditor.git 13 | [submodule "external/xz-embedded"] 14 | path = external/xz-embedded 15 | url = https://github.com/tukaani-project/xz-embedded 16 | [submodule "apache/commons-lang"] 17 | path = apache/commons-lang 18 | url = https://github.com/apache/commons-lang 19 | [submodule "external/lsplt"] 20 | path = external/lsplt 21 | url = https://github.com/JingMatrix/LSPlt 22 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/ShellCallback.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | public class ShellCallback implements Parcelable { 4 | public static final Parcelable.Creator CREATOR = new Creator() { 5 | @Override 6 | public ShellCallback createFromParcel(Parcel source) { 7 | throw new IllegalArgumentException("STUB"); 8 | } 9 | 10 | @Override 11 | public ShellCallback[] newArray(int size) { 12 | throw new IllegalArgumentException("STUB"); 13 | } 14 | }; 15 | 16 | @Override 17 | public void writeToParcel(Parcel dest, int flags) { 18 | throw new IllegalArgumentException("STUB"); 19 | } 20 | 21 | @Override 22 | public int describeContents() { 23 | throw new IllegalArgumentException("STUB"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /services/daemon-service/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /magisk-loader/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/xposed/dummy/XTypedArraySuperClass.java: -------------------------------------------------------------------------------- 1 | package xposed.dummy; 2 | 3 | import android.content.res.Resources; 4 | import android.content.res.TypedArray; 5 | 6 | /** 7 | * This class is used as super class of XResources.XTypedArray. 8 | * 9 | * This implementation isn't included in the .dex file. Instead, it's created on the device. 10 | * Usually, it will extend TypedArray, but some ROMs use their own TypedArray subclass. 11 | * In that case, XTypedArraySuperClass will extend the ROM's subclass in an attempt to increase 12 | * compatibility. 13 | */ 14 | public class XTypedArraySuperClass extends TypedArray { 15 | /** Dummy, will never be called (objects are transferred to this class only). */ 16 | protected XTypedArraySuperClass(Resources resources) { 17 | super(resources); 18 | throw new UnsupportedOperationException(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /core/src/main/java/org/lsposed/lspd/nativebridge/DexParserBridge.java: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.nativebridge; 2 | 3 | import java.io.IOException; 4 | import java.lang.reflect.Method; 5 | import java.nio.ByteBuffer; 6 | 7 | import dalvik.annotation.optimization.FastNative; 8 | import io.github.libxposed.api.utils.DexParser; 9 | 10 | public class DexParserBridge { 11 | @FastNative 12 | public static native Object openDex(ByteBuffer data, long[] args) throws IOException; 13 | 14 | @FastNative 15 | public static native void closeDex(long cookie); 16 | 17 | @FastNative 18 | public static native void visitClass(long cookie, Object visitor, Class fieldVisitorClass, Class methodVisitorClass, Method classVisitMethod, Method fieldVisitMethod, Method methodVisitMethod, Method methodBodyVisitMethod, Method stopMethod); 19 | } 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request/新特性请求 3 | description: Suggest an idea./提出建议 4 | labels: [enhancement] 5 | body: 6 | - type: textarea 7 | attributes: 8 | label: Is your feature request related to a problem?/你的请求是否与某个问题相关? 9 | placeholder: A clear and concise description of what the problem is./请清晰准确表述该问题。 10 | validations: 11 | required: true 12 | - type: textarea 13 | attributes: 14 | label: Describe the solution you'd like/描述你想要的解决方案 15 | placeholder: A clear and concise description of what you want to happen./请清晰准确描述新特性的预期行为 16 | validations: 17 | required: true 18 | - type: textarea 19 | attributes: 20 | label: Additional context/其他信息 21 | placeholder: Add any other context or screenshots about the feature request here./其他关于新特性的信息或者截图 22 | validations: 23 | required: false 24 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/Bundle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2021 LSPosed Contributors 18 | */ 19 | 20 | package android.os; 21 | 22 | public class Bundle { 23 | } 24 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/ServiceManager.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | import android.annotation.Nullable; 4 | 5 | public class ServiceManager { 6 | 7 | /** 8 | * Returns a reference to a service with the given name. 9 | * 10 | * @param name the name of the service to get 11 | * @return a reference to the service, or null if the service doesn't exist 12 | */ 13 | @Nullable 14 | public static IBinder getService(String name) { 15 | throw new RuntimeException("STUB"); 16 | } 17 | 18 | /** 19 | * Place a new @a service called @a name into the service 20 | * manager. 21 | * 22 | * @param name the name of the new service 23 | * @param service the service object 24 | */ 25 | public static void addService(String name, IBinder service) { 26 | throw new RuntimeException("STUB"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/Intent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2021 LSPosed Contributors 18 | */ 19 | 20 | package android.content; 21 | 22 | public class Intent { 23 | } 24 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/app/ProfilerInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2021 LSPosed Contributors 18 | */ 19 | 20 | package android.app; 21 | 22 | public class ProfilerInfo { 23 | } 24 | -------------------------------------------------------------------------------- /services/manager-service/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /magisk-loader/magisk_module/post-fs-data.sh: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of LSPosed. 3 | # 4 | # LSPosed is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # LSPosed is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with LSPosed. If not, see . 16 | # 17 | # Copyright (C) 2021 LSPosed Contributors 18 | # 19 | 20 | MODDIR=${0%/*} 21 | 22 | rm -f "/data/local/tmp/daemon.apk" 23 | rm -f "/data/local/tmp/manager.apk" 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/values-v28/dimens.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 12dp 22 | 23 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/SystemProperties.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | import android.annotation.NonNull; 4 | import android.annotation.Nullable; 5 | 6 | public class SystemProperties { 7 | public static String get(@NonNull String key) { 8 | throw new UnsupportedOperationException("Stub"); 9 | } 10 | 11 | public static String get(@NonNull String key, @Nullable String def) { 12 | throw new UnsupportedOperationException("Stub"); 13 | } 14 | 15 | public static void set(@NonNull String key, @Nullable String val) { 16 | throw new UnsupportedOperationException("Stub"); 17 | } 18 | 19 | public static boolean getBoolean(@NonNull String key, boolean def) { 20 | throw new UnsupportedOperationException("Stub"); 21 | } 22 | 23 | public static int getInt(@NonNull String key, int def) { 24 | throw new UnsupportedOperationException("Stub"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /hiddenapi/bridge/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2021 LSPosed Contributors 18 | */ 19 | 20 | plugins { 21 | `java-library` 22 | } 23 | 24 | dependencies { 25 | compileOnly(projects.hiddenapi.stubs) 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/jni/src/jni/dex_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2023 LSPosed Contributors 18 | */ 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace lspd { 24 | void RegisterDexParserBridge(JNIEnv *env); 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/jni/src/jni/hook_bridge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2022 LSPosed Contributors 18 | */ 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace lspd { 24 | void RegisterHookBridge(JNIEnv *env); 25 | } 26 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") 2 | 3 | pluginManagement { 4 | repositories { 5 | gradlePluginPortal() 6 | google() 7 | mavenCentral() 8 | } 9 | } 10 | 11 | dependencyResolutionManagement { 12 | repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS 13 | repositories { 14 | google() 15 | mavenCentral() 16 | mavenLocal { 17 | content { 18 | includeGroup("io.github.libxposed") 19 | } 20 | } 21 | } 22 | versionCatalogs { 23 | create("libs") 24 | } 25 | } 26 | 27 | rootProject.name = "ReLSPosed" 28 | include( 29 | ":apache", 30 | ":app", 31 | ":axml", 32 | ":core", 33 | ":daemon", 34 | ":dex2oat", 35 | ":hiddenapi:stubs", 36 | ":hiddenapi:bridge", 37 | ":magisk-loader", 38 | ":services:manager-service", 39 | ":services:daemon-service", 40 | ) 41 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/xposed/dummy/XResourcesSuperClass.java: -------------------------------------------------------------------------------- 1 | package xposed.dummy; 2 | 3 | import android.content.res.Resources; 4 | 5 | /** 6 | * This class is used as super class of XResources. 7 | * 8 | * This implementation isn't included in the .dex file. Instead, it's created on the device. 9 | * Usually, it will extend Resources, but some ROMs use their own Resources subclass. 10 | * In that case, XResourcesSuperClass will extend the ROM's subclass in an attempt to increase 11 | * compatibility. 12 | */ 13 | public class XResourcesSuperClass extends Resources { 14 | /** Dummy, will never be called (objects are transferred to this class only). */ 15 | protected XResourcesSuperClass() { 16 | super(null, null, null); 17 | throw new UnsupportedOperationException(); 18 | } 19 | 20 | protected XResourcesSuperClass(ClassLoader classLoader) { 21 | super(classLoader); 22 | throw new UnsupportedOperationException(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/IBinder.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | import android.annotation.NonNull; 4 | import android.annotation.Nullable; 5 | 6 | import java.io.FileDescriptor; 7 | 8 | public interface IBinder { 9 | 10 | boolean transact(int code, @NonNull Parcel data, @Nullable Parcel reply, int flags); 11 | 12 | @Nullable 13 | String getInterfaceDescriptor(); 14 | 15 | boolean pingBinder(); 16 | 17 | boolean isBinderAlive(); 18 | 19 | @Nullable 20 | IInterface queryLocalInterface(@NonNull String descriptor); 21 | 22 | void dump(@NonNull FileDescriptor fd, @Nullable String[] args); 23 | 24 | void dumpAsync(@NonNull FileDescriptor fd, @Nullable String[] args); 25 | 26 | void linkToDeath(@NonNull DeathRecipient recipient, int flags); 27 | 28 | boolean unlinkToDeath(@NonNull DeathRecipient recipient, int flags); 29 | 30 | interface DeathRecipient { 31 | void binderDied(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/res/values-v29/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | true 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/values/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | false 23 | 24 | -------------------------------------------------------------------------------- /core/src/main/jni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(core) 3 | 4 | set(CMAKE_CXX_STANDARD 23) 5 | 6 | add_subdirectory(${EXTERNAL_ROOT} external) 7 | 8 | aux_source_directory(src SRC_LIST) 9 | aux_source_directory(src/jni SRC_LIST) 10 | aux_source_directory(src/xz SRC_LIST) 11 | 12 | add_library(${PROJECT_NAME} STATIC ${SRC_LIST}) 13 | 14 | set(IGNORED_WARNINGS 15 | -Wno-c99-extensions 16 | -Wno-gnu-zero-variadic-macro-arguments 17 | -Wno-gnu-flexible-array-initializer 18 | -Wno-variadic-macros 19 | -Wno-zero-length-array) 20 | 21 | target_include_directories(${PROJECT_NAME} PUBLIC include) 22 | target_include_directories(${PROJECT_NAME} PRIVATE src ${EXTERNAL_ROOT}/xz-embedded/linux/include) 23 | target_compile_options(${PROJECT_NAME} PRIVATE -Wpedantic ${IGNORED_WARNINGS}) 24 | 25 | target_link_libraries(${PROJECT_NAME} PUBLIC dobby_static lsplant_static xz_static log fmt-header-only) 26 | target_link_libraries(${PROJECT_NAME} PRIVATE dex_builder_static) 27 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/sun/misc/CompoundEnumeration.java: -------------------------------------------------------------------------------- 1 | package sun.misc; 2 | 3 | import java.util.Enumeration; 4 | import java.util.NoSuchElementException; 5 | 6 | public class CompoundEnumeration implements Enumeration { 7 | private final Enumeration[] enums; 8 | private int index = 0; 9 | 10 | public CompoundEnumeration(Enumeration[] enums) { 11 | this.enums = enums; 12 | } 13 | 14 | private boolean next() { 15 | while (index < enums.length) { 16 | if (enums[index] != null && enums[index].hasMoreElements()) { 17 | return true; 18 | } 19 | index++; 20 | } 21 | return false; 22 | } 23 | 24 | public boolean hasMoreElements() { 25 | return next(); 26 | } 27 | 28 | public E nextElement() { 29 | if (!next()) { 30 | throw new NoSuchElementException(); 31 | } 32 | return enums[index].nextElement(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/jni/src/jni/native_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2020 EdXposed Contributors 18 | * Copyright (C) 2021 LSPosed Contributors 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | 25 | namespace lspd { 26 | void RegisterNativeAPI(JNIEnv *); 27 | } 28 | -------------------------------------------------------------------------------- /daemon/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | -keepclasseswithmembers,includedescriptorclasses class * { 2 | native ; 3 | } 4 | -keepclasseswithmembers class org.lsposed.lspd.Main { 5 | public static void main(java.lang.String[]); 6 | } 7 | -keepclasseswithmembers class org.lsposed.lspd.service.Dex2OatService { 8 | private java.lang.String devTmpDir; 9 | private java.lang.String magiskPath; 10 | private java.lang.String fakeBin32; 11 | private java.lang.String fakeBin64; 12 | private java.lang.String[] dex2oatBinaries; 13 | } 14 | -keepclasseswithmembers class org.lsposed.lspd.service.LogcatService { 15 | private int refreshFd(boolean); 16 | } 17 | -keepclassmembers class ** implements android.content.ContextWrapper { 18 | public int getUserId(); 19 | public android.os.UserHandle getUser(); 20 | } 21 | -assumenosideeffects class android.util.Log { 22 | public static *** v(...); 23 | public static *** d(...); 24 | } 25 | -repackageclasses 26 | -allowaccessmodification 27 | -------------------------------------------------------------------------------- /hiddenapi/stubs/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2021 LSPosed Contributors 18 | */ 19 | 20 | plugins { 21 | `java-library` 22 | } 23 | 24 | java { 25 | sourceCompatibility = JavaVersion.VERSION_1_8 26 | targetCompatibility = JavaVersion.VERSION_1_8 27 | } 28 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/IContentProvider.java: -------------------------------------------------------------------------------- 1 | package android.content; 2 | 3 | import android.os.Bundle; 4 | import android.os.IInterface; 5 | import android.os.RemoteException; 6 | 7 | import androidx.annotation.RequiresApi; 8 | 9 | public interface IContentProvider extends IInterface { 10 | Bundle call(String callingPkg, String method, 11 | String arg, Bundle extras) throws RemoteException; 12 | 13 | @RequiresApi(29) 14 | Bundle call(String callingPkg, String authority, String method, 15 | String arg, Bundle extras) throws RemoteException; 16 | 17 | @RequiresApi(30) 18 | Bundle call(String callingPkg, String attributionTag, String authority, 19 | String method, String arg, Bundle extras) throws RemoteException; 20 | 21 | @RequiresApi(31) 22 | Bundle call(AttributionSource attributionSource, String authority, 23 | String method, String arg, Bundle extras) throws RemoteException; 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/res/values-sw600dp/integer.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 0x50 23 | 24 | 25 | -------------------------------------------------------------------------------- /core/src/main/jni/src/jni/resources_hook.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2020 EdXposed Contributors 18 | * Copyright (C) 2021 - 2022 LSPosed Contributors 19 | */ 20 | 21 | #pragma once 22 | 23 | #include "jni.h" 24 | 25 | namespace lspd { 26 | void RegisterResourcesHook(JNIEnv *); 27 | 28 | } // namespace lspd 29 | -------------------------------------------------------------------------------- /external/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(external) 2 | 3 | macro(SET_OPTION option value) 4 | set(${option} ${value} CACHE INTERNAL "" FORCE) 5 | endmacro() 6 | 7 | SET_OPTION(Plugin.SymbolResolver OFF) 8 | SET_OPTION(FMT_INSTALL OFF) 9 | 10 | set(XZ_SOURCES 11 | xz_crc32.c 12 | xz_crc64.c 13 | # xz_dec_bcj.c 14 | xz_dec_lzma2.c 15 | xz_dec_stream.c) 16 | set(XZ_INCLUDES xz-embedded/linux/include/linux xz-embedded/userspace) 17 | list(TRANSFORM XZ_SOURCES PREPEND xz-embedded/linux/lib/xz/) 18 | add_library(xz_static STATIC ${XZ_SOURCES}) 19 | target_compile_options(xz_static PRIVATE -DXZ_USE_CRC64) 20 | target_include_directories(xz_static PRIVATE ${XZ_INCLUDES}) 21 | 22 | OPTION(LSPLANT_BUILD_SHARED OFF) 23 | add_subdirectory(dobby) 24 | add_subdirectory(fmt) 25 | add_subdirectory(lsplant/lsplant/src/main/jni) 26 | target_compile_options(lsplant_static PUBLIC -Wno-gnu-anonymous-struct) 27 | target_compile_definitions(fmt-header-only INTERFACE FMT_USE_LOCALE=0 FMT_USE_FLOAT=0 FMT_USE_DOUBLE=0 FMT_USE_LONG_DOUBLE=0 FMT_USE_BITINT=0) 28 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/pm/PackageParser.java: -------------------------------------------------------------------------------- 1 | package android.content.pm; 2 | 3 | import java.io.File; 4 | 5 | public class PackageParser { 6 | public static class PackageLite { 7 | public final String packageName = null; 8 | } 9 | 10 | public final static class Package { 11 | public ApplicationInfo applicationInfo; 12 | } 13 | 14 | /** Before SDK21 */ 15 | public static PackageLite parsePackageLite(String packageFile, int flags) { 16 | throw new UnsupportedOperationException("STUB"); 17 | } 18 | 19 | /** Since SDK21 */ 20 | public static PackageLite parsePackageLite(File packageFile, int flags) throws PackageParserException { 21 | throw new UnsupportedOperationException("STUB"); 22 | } 23 | 24 | public Package parsePackage(File packageFile, int flags, boolean useCaches) 25 | throws PackageParserException { 26 | throw new UnsupportedOperationException("STUB"); 27 | } 28 | 29 | /** Since SDK21 */ 30 | public static class PackageParserException extends Exception { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /magisk-loader/src/main/jni/include/loader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2022 LSPosed Contributors 18 | */ 19 | 20 | // 21 | // Created by Nullptr on 2022/3/16. 22 | // 23 | 24 | #pragma once 25 | 26 | #include "config.h" 27 | 28 | namespace lspd { 29 | extern const int apiVersion; 30 | extern const char* const moduleName; 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/org/lsposed/lspd/nativebridge/NativeAPI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2020 EdXposed Contributors 18 | * Copyright (C) 2021 LSPosed Contributors 19 | */ 20 | 21 | package org.lsposed.lspd.nativebridge; 22 | 23 | public class NativeAPI { 24 | public static native void recordNativeEntrypoint(String library_name); 25 | } 26 | -------------------------------------------------------------------------------- /magisk-loader/magisk_module/service.sh: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of LSPosed. 3 | # 4 | # LSPosed is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # LSPosed is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with LSPosed. If not, see . 16 | # 17 | # Copyright (C) 2021 LSPosed Contributors 18 | # 19 | 20 | MODDIR=${0%/*} 21 | 22 | cd "$MODDIR" 23 | 24 | # To avoid breaking Play Integrity in certain cases, we start LSPosed service daemon in late_start service mode instead of post-fs-data mode 25 | unshare --propagation slave -m sh -c "$MODDIR/daemon $@&" 26 | -------------------------------------------------------------------------------- /core/src/main/java/de/robv/android/xposed/IXposedMod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2020 EdXposed Contributors 18 | * Copyright (C) 2021 LSPosed Contributors 19 | */ 20 | 21 | package de.robv.android.xposed; 22 | 23 | /** 24 | * Marker interface for Xposed modules. Cannot be implemented directly. 25 | */ 26 | /* package */ interface IXposedMod { 27 | } 28 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/IUserManager.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | import android.content.pm.UserInfo; 4 | 5 | import androidx.annotation.RequiresApi; 6 | 7 | import java.util.List; 8 | 9 | public interface IUserManager extends IInterface { 10 | @RequiresApi(26) 11 | boolean isUserUnlocked(int userId) 12 | throws RemoteException; 13 | 14 | List getUsers(boolean excludeDying) 15 | throws RemoteException; 16 | 17 | List getUsers(boolean excludePartial, boolean excludeDying, boolean excludePreCreated) 18 | throws RemoteException; 19 | 20 | UserInfo getUserInfo(int userHandle) throws RemoteException; 21 | 22 | UserInfo getProfileParent(int userId) throws RemoteException; 23 | 24 | boolean isUserUnlockingOrUnlocked(int userId) throws RemoteException; 25 | 26 | abstract class Stub extends Binder implements IUserManager { 27 | 28 | public static IUserManager asInterface(IBinder obj) { 29 | throw new RuntimeException("STUB"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 48dp 23 | 48dp 24 | 25 | 6dp 26 | 27 | -------------------------------------------------------------------------------- /dex2oat/src/main/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(dex2oat) 3 | 4 | add_executable(dex2oat dex2oat.c) 5 | add_library(oat_hook SHARED oat_hook.cpp) 6 | 7 | OPTION(LSPLT_BUILD_SHARED OFF) 8 | add_subdirectory(${EXTERNAL_ROOT}/lsplt/lsplt/src/main/jni external) 9 | 10 | target_link_libraries(dex2oat log) 11 | target_link_libraries(oat_hook log lsplt_static) 12 | 13 | if (DEFINED DEBUG_SYMBOLS_PATH) 14 | message(STATUS "Debug symbols will be placed at ${DEBUG_SYMBOLS_PATH}") 15 | add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD 16 | COMMAND ${CMAKE_COMMAND} -E make_directory ${DEBUG_SYMBOLS_PATH}/${ANDROID_ABI} 17 | COMMAND ${CMAKE_OBJCOPY} --only-keep-debug $ 18 | ${DEBUG_SYMBOLS_PATH}/${ANDROID_ABI}/${PROJECT_NAME}.debug 19 | COMMAND ${CMAKE_STRIP} --strip-all $ 20 | COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink ${DEBUG_SYMBOLS_PATH}/${ANDROID_ABI}/${PROJECT_NAME}.debug 21 | $) 22 | endif() 23 | -------------------------------------------------------------------------------- /app/src/main/res/values-v31/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | @android:color/system_accent1_0 23 | @android:color/system_accent1_600 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/values-night-v31/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | @android:color/system_accent1_800 23 | @android:color/system_accent1_200 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes_overlay.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_home_checkable.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_get_app_checkable.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings_checkable.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_assignment_checkable.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_extension_checkable.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/values/integer.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 0x00800007 23 | 0x30 24 | 0 25 | 26 | -------------------------------------------------------------------------------- /magisk-loader/magisk_module/uninstall.sh: -------------------------------------------------------------------------------- 1 | # 2 | # This file is part of LSPosed. 3 | # 4 | # LSPosed is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # LSPosed is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with LSPosed. If not, see . 16 | # 17 | # Copyright (C) 2021 LSPosed Contributors 18 | # 19 | 20 | MODDIR=${0%/*} 21 | MODSDIR=$(dirname "$MODDIR") 22 | if [ -d "$MODSDIR/riru_lsposed" ] && [ -d "$MODSDIR/zygisk_lsposed" ]; then 23 | if [ -f "$MODSDIR/riru_lsposed/remove" ] && [ -f "$MODSDIR/zygisk_lsposed/remove" ]; then 24 | rm -rf /data/adb/lspd 25 | fi 26 | else 27 | rm -rf /data/adb/lspd 28 | fi 29 | 30 | rm -rf /data/adb/riru/modules/lspd 31 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/os/ShellCommand.java: -------------------------------------------------------------------------------- 1 | package android.os; 2 | 3 | import java.io.FileDescriptor; 4 | import java.io.InputStream; 5 | import java.io.PrintWriter; 6 | 7 | public abstract class ShellCommand { 8 | public int exec(Binder target, FileDescriptor in, FileDescriptor out, FileDescriptor err, 9 | String[] args, ShellCallback callback, ResultReceiver resultReceiver) { 10 | throw new IllegalArgumentException("STUB!"); 11 | } 12 | 13 | public abstract int onCommand(String cmd); 14 | public abstract void onHelp(); 15 | 16 | public String getNextOption(){ 17 | throw new IllegalArgumentException("STUB!"); 18 | } 19 | 20 | public String getNextArgRequired() { 21 | throw new IllegalArgumentException("STUB!"); 22 | } 23 | 24 | public PrintWriter getErrPrintWriter() { 25 | throw new IllegalArgumentException("STUB!"); 26 | } 27 | public PrintWriter getOutPrintWriter() { 28 | throw new IllegalArgumentException("STUB!"); 29 | } 30 | public InputStream getRawInputStream() { 31 | throw new IllegalArgumentException("STUB!"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_master_switch.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 26 | -------------------------------------------------------------------------------- /apache/build.gradle.kts: -------------------------------------------------------------------------------- 1 | val androidSourceCompatibility: JavaVersion by rootProject.extra 2 | val androidTargetCompatibility: JavaVersion by rootProject.extra 3 | 4 | plugins { 5 | id("java-library") 6 | } 7 | 8 | java { 9 | sourceCompatibility = androidSourceCompatibility 10 | targetCompatibility = androidTargetCompatibility 11 | sourceSets { 12 | main { 13 | java.srcDirs("commons-lang/src/main/java", "local") 14 | } 15 | } 16 | } 17 | 18 | val lang3Src = "commons-lang/src/main/java/org/apache/commons/lang3" 19 | val localDir = "local/generated" 20 | 21 | task("ClassUtilsX") { 22 | from("$lang3Src/ClassUtils.java") 23 | into(localDir) 24 | filter { line: String -> line.replace("ClassUtils", "ClassUtilsX") } 25 | rename("(.+).java", "$1X.java") 26 | } 27 | 28 | task("SerializationUtilsX") { 29 | from("$lang3Src/SerializationUtils.java") 30 | into(localDir) 31 | filter { line: String -> line.replace("SerializationUtils", "SerializationUtilsX") } 32 | rename("(.+).java", "$1X.java") 33 | } 34 | 35 | tasks.compileJava { 36 | dependsOn("ClassUtilsX") 37 | dependsOn("SerializationUtilsX") 38 | } 39 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/content/IIntentSender.java: -------------------------------------------------------------------------------- 1 | package android.content; 2 | 3 | import android.os.Binder; 4 | import android.os.Bundle; 5 | import android.os.IBinder; 6 | import android.os.IInterface; 7 | 8 | import androidx.annotation.RequiresApi; 9 | 10 | public interface IIntentSender extends IInterface { 11 | 12 | int send(int code, Intent intent, String resolvedType, 13 | IIntentReceiver finishedReceiver, String requiredPermission, Bundle options); 14 | 15 | @RequiresApi(26) 16 | void send(int code, Intent intent, String resolvedType, IBinder whitelistToken, 17 | IIntentReceiver finishedReceiver, String requiredPermission, Bundle options); 18 | 19 | abstract class Stub extends Binder implements IIntentSender { 20 | 21 | public Stub() { 22 | throw new UnsupportedOperationException(); 23 | } 24 | 25 | @Override 26 | public android.os.IBinder asBinder() { 27 | throw new UnsupportedOperationException(); 28 | } 29 | 30 | public static IIntentSender asInterface(IBinder binder) { 31 | throw new UnsupportedOperationException(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/colors.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | @color/abc_primary_text_material_light 22 | @color/abc_primary_text_material_dark 23 | 24 | #F06292 25 | #E1F5FE 26 | 27 | -------------------------------------------------------------------------------- /daemon/src/main/java/org/lsposed/lspd/util/InstallerVerifier.java: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.util; 2 | 3 | import static org.lsposed.lspd.util.SignInfo.CERTIFICATE; 4 | 5 | import com.android.apksig.ApkVerifier; 6 | 7 | import java.io.File; 8 | import java.io.IOException; 9 | import java.util.Arrays; 10 | 11 | public class InstallerVerifier { 12 | 13 | public static void verifyInstallerSignature(String path) throws IOException { 14 | ApkVerifier verifier = new ApkVerifier.Builder(new File(path)) 15 | .setMinCheckedPlatformVersion(27) 16 | .build(); 17 | try { 18 | ApkVerifier.Result result = verifier.verify(); 19 | if (!result.isVerified()) { 20 | throw new IOException("apk signature not verified"); 21 | } 22 | var mainCert = result.getSignerCertificates().get(0); 23 | if (!Arrays.equals(mainCert.getEncoded(), CERTIFICATE)) { 24 | var dname = mainCert.getSubjectX500Principal().getName(); 25 | throw new IOException("apk signature mismatch: " + dname); 26 | } 27 | } catch (Exception t) { 28 | throw new IOException(t); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_repo_item.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/values-v30/themes.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 24 | 25 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/values-v28/themes.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 24 | 25 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_home_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_add_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/org/lsposed/manager/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2020 EdXposed Contributors 18 | * Copyright (C) 2021 LSPosed Contributors 19 | */ 20 | 21 | package org.lsposed.manager; 22 | 23 | import android.os.IBinder; 24 | 25 | import org.lsposed.manager.receivers.LSPManagerServiceHolder; 26 | 27 | public class Constants { 28 | public static boolean setBinder(IBinder binder) { 29 | LSPManagerServiceHolder.init(binder); 30 | return LSPManagerServiceHolder.getService().asBinder().isBinderAlive(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_get_app_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /daemon/src/main/jni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(daemon) 3 | 4 | add_subdirectory(${EXTERNAL_ROOT} external) 5 | 6 | set(SOURCES 7 | dex2oat.cpp 8 | denylist.cpp 9 | logcat.cpp 10 | obfuscation.cpp 11 | packagename.cpp 12 | ) 13 | 14 | add_library(${PROJECT_NAME} SHARED ${SOURCES}) 15 | 16 | target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${EXTERNAL_ROOT}/rapidxml) 17 | 18 | target_link_libraries(${PROJECT_NAME} PRIVATE lsplant_static dex_builder_static android log) 19 | 20 | if (DEFINED DEBUG_SYMBOLS_PATH) 21 | message(STATUS "Debug symbols will be placed at ${DEBUG_SYMBOLS_PATH}") 22 | add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD 23 | COMMAND ${CMAKE_COMMAND} -E make_directory ${DEBUG_SYMBOLS_PATH}/${ANDROID_ABI} 24 | COMMAND ${CMAKE_OBJCOPY} --only-keep-debug $ 25 | ${DEBUG_SYMBOLS_PATH}/${ANDROID_ABI}/${PROJECT_NAME}.debug 26 | COMMAND ${CMAKE_STRIP} --strip-all $ 27 | COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink ${DEBUG_SYMBOLS_PATH}/${ANDROID_ABI}/${PROJECT_NAME}.debug 28 | $) 29 | endif() 30 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | @color/abc_primary_text_material_dark 23 | 24 | @color/abc_primary_text_material_light 25 | 26 | #FFFFFF 27 | #F48FB1 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings_untranslatable.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | ReLSPosed 22 | https://github.com/ThePedroo/ReLSPosed#install 23 | https://github.com/ThePedroo/ReLSPosed/releases/latest 24 | @string/module_repo 25 | 26 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/app/IApplicationThread.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2021 LSPosed Contributors 18 | */ 19 | 20 | package android.app; 21 | 22 | import android.os.Binder; 23 | import android.os.IBinder; 24 | import android.os.IInterface; 25 | 26 | public interface IApplicationThread extends IInterface { 27 | abstract class Stub extends Binder implements IApplicationThread { 28 | public static IApplicationThread asInterface(IBinder obj) { 29 | throw new UnsupportedOperationException(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_outline_home_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_outline_get_app_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /services/manager-service/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2021 LSPosed Contributors 18 | */ 19 | 20 | plugins { 21 | alias(libs.plugins.agp.lib) 22 | } 23 | 24 | android { 25 | buildFeatures { 26 | aidl = true 27 | } 28 | 29 | defaultConfig { 30 | consumerProguardFiles("proguard-rules.pro") 31 | } 32 | 33 | buildTypes { 34 | release { 35 | isMinifyEnabled = false 36 | } 37 | } 38 | namespace = "org.lsposed.lspd.managerservice" 39 | } 40 | 41 | dependencies { 42 | api(libs.rikkax.parcelablelist) 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_title.xml: -------------------------------------------------------------------------------- 1 | 19 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_info_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_outline_merge_type_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shortcut_ic_repo.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_arrow_back_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shortcut_ic_settings.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /core/src/main/java/org/lsposed/lspd/hooker/OpenDexFileHooker.java: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.hooker; 2 | 3 | import android.os.Build; 4 | 5 | import androidx.annotation.NonNull; 6 | 7 | import org.lsposed.lspd.impl.LSPosedBridge; 8 | import org.lsposed.lspd.nativebridge.HookBridge; 9 | 10 | import io.github.libxposed.api.XposedInterface; 11 | import io.github.libxposed.api.annotations.XposedHooker; 12 | 13 | @XposedHooker 14 | public class OpenDexFileHooker implements XposedInterface.Hooker { 15 | 16 | public static void after(@NonNull XposedInterface.AfterHookCallback callback) { 17 | ClassLoader classLoader = null; 18 | for (var arg : callback.getArgs()) { 19 | if (arg instanceof ClassLoader) { 20 | classLoader = (ClassLoader) arg; 21 | } 22 | } 23 | if (Build.VERSION.SDK_INT == Build.VERSION_CODES.P && classLoader == null) { 24 | classLoader = LSPosedBridge.class.getClassLoader(); 25 | } 26 | while (classLoader != null) { 27 | if (classLoader == LSPosedBridge.class.getClassLoader()) { 28 | HookBridge.setTrusted(callback.getResult()); 29 | return; 30 | } else { 31 | classLoader = classLoader.getParent(); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_keyboard_arrow_down.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_modules.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_chat_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_outline_shield_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shortcut_ic_logs.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shortcut_ic_modules.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /dex2oat/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2022 LSPosed Contributors 18 | */ 19 | 20 | plugins { 21 | alias(libs.plugins.agp.lib) 22 | } 23 | 24 | android { 25 | namespace = "org.lsposed.dex2oat" 26 | 27 | buildFeatures { 28 | androidResources = false 29 | buildConfig = false 30 | prefab = true 31 | prefabPublishing = true 32 | } 33 | 34 | defaultConfig { 35 | minSdk = 29 36 | } 37 | 38 | externalNativeBuild { 39 | cmake { 40 | path("src/main/cpp/CMakeLists.txt") 41 | } 42 | } 43 | 44 | prefab { 45 | register("dex2oat") 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /magisk-loader/src/main/jni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(lspd) 3 | 4 | add_subdirectory(${CORE_ROOT} core) 5 | 6 | configure_file(template/loader.cpp src/loader.cpp) 7 | 8 | aux_source_directory(src SRC_LIST) 9 | if (${API} STREQUAL "zygisk") 10 | set(SRC_LIST ${SRC_LIST} api/zygisk_main.cpp) 11 | endif() 12 | 13 | add_library(${PROJECT_NAME} SHARED ${SRC_LIST} ${CMAKE_CURRENT_BINARY_DIR}/src/loader.cpp) 14 | 15 | target_include_directories(${PROJECT_NAME} PUBLIC include) 16 | target_include_directories(${PROJECT_NAME} PRIVATE src) 17 | 18 | target_link_libraries(${PROJECT_NAME} core log) 19 | 20 | if (DEFINED DEBUG_SYMBOLS_PATH) 21 | set(DEBUG_SYMBOLS_PATH ${DEBUG_SYMBOLS_PATH}/${API}) 22 | message(STATUS "Debug symbols will be placed at ${DEBUG_SYMBOLS_PATH}") 23 | add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD 24 | COMMAND ${CMAKE_COMMAND} -E make_directory ${DEBUG_SYMBOLS_PATH}/${ANDROID_ABI} 25 | COMMAND ${CMAKE_OBJCOPY} --only-keep-debug $ 26 | ${DEBUG_SYMBOLS_PATH}/${ANDROID_ABI}/${PROJECT_NAME}.debug 27 | COMMAND ${CMAKE_STRIP} --strip-all $ 28 | COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink ${DEBUG_SYMBOLS_PATH}/${ANDROID_ABI}/${PROJECT_NAME}.debug 29 | $) 30 | endif() 31 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/simple_menu_background.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /core/src/main/jni/include/symbol_cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2020 EdXposed Contributors 18 | * Copyright (C) 2021 LSPosed Contributors 19 | */ 20 | 21 | // 22 | // Created by kotori on 2/7/21. 23 | // 24 | 25 | #ifndef LSPOSED_SYMBOL_CACHE_H 26 | #define LSPOSED_SYMBOL_CACHE_H 27 | 28 | #include 29 | 30 | namespace SandHook { 31 | class ElfImg; 32 | } 33 | 34 | namespace lspd { 35 | std::unique_ptr &GetArt(bool release=false); 36 | std::unique_ptr &GetLibBinder(bool release=false); 37 | std::unique_ptr &GetLinker(bool release=false); 38 | } 39 | 40 | #endif //LSPOSED_SYMBOL_CACHE_H 41 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fragment_enter.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 25 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fragment_exit.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 25 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fragment_enter_pop.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 25 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fragment_exit_pop.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 25 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_open_in_browser.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_item.xml: -------------------------------------------------------------------------------- 1 | 19 | 29 | -------------------------------------------------------------------------------- /daemon/src/main/jni/abx_utils/const.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | * This decoder is made by frknkrc44. 5 | * 6 | * Thanks DanGLES3 and fatalcoder524 to find memory leaks. 7 | */ 8 | 9 | const char startMagic[4] = { 'A', 'B', 'X', '\0' }; 10 | 11 | static const short TOKEN_START_DOCUMENT = 0; 12 | static const short TOKEN_END_DOCUMENT = 1; 13 | static const short TOKEN_START_TAG = 2; 14 | static const short TOKEN_END_TAG = 3; 15 | static const short TOKEN_TEXT = 4; 16 | static const short TOKEN_CDSECT = 5; 17 | // static const short TOKEN_ENTITY_REF = 6; 18 | static const short TOKEN_IGNORABLE_WHITESPACE = 7; 19 | static const short TOKEN_PROCESSING_INSTRUCTION = 8; 20 | static const short TOKEN_COMMENT = 9; 21 | static const short TOKEN_DOCDECL = 10; 22 | static const short TOKEN_ATTRIBUTE = 15; 23 | 24 | static const short DATA_NULL = 1 << 4; 25 | static const short DATA_STRING = 2 << 4; 26 | static const short DATA_STRING_INTERNED = 3 << 4; 27 | static const short DATA_BYTES_HEX = 4 << 4; 28 | static const short DATA_BYTES_BASE64 = 5 << 4; 29 | static const short DATA_INT = 6 << 4; 30 | static const short DATA_INT_HEX = 7 << 4; 31 | static const short DATA_LONG = 8 << 4; 32 | static const short DATA_LONG_HEX = 9 << 4; 33 | static const short DATA_FLOAT = 10 << 4; 34 | static const short DATA_DOUBLE = 11 << 4; 35 | static const short DATA_BOOLEAN_TRUE = 12 << 4; 36 | static const short DATA_BOOLEAN_FALSE = 13 << 4; 37 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_round_warning_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /daemon/src/main/jni/abx_utils/xml_element.hpp: -------------------------------------------------------------------------------- 1 | #include "xml_attribute.hpp" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | /* 9 | * This decoder is made by frknkrc44. 10 | * 11 | * Thanks DanGLES3 and fatalcoder524 to find memory leaks. 12 | */ 13 | 14 | class XMLElement { 15 | public: 16 | std::vector mTagName; 17 | std::map, std::shared_ptr> attributes; 18 | std::vector> textSections; 19 | std::vector> subElements; 20 | 21 | XMLElement* subElementAt(size_t index) { 22 | if (index < 0 || index >= subElements.size()) return nullptr; 23 | 24 | auto element = subElements.begin(); 25 | std::advance(element, index); 26 | return (*element).get(); 27 | } 28 | 29 | void pushAttribute(std::vector name, std::shared_ptr attr) { 30 | attributes.emplace(name, attr); 31 | } 32 | 33 | XMLAttribute* findAttribute(const char* attr) { 34 | for (const auto& it : attributes) { 35 | const char* ch1 = reinterpret_cast(it.first.data()); 36 | if (memcmp(ch1, attr, strlen(ch1)) == 0) { 37 | return it.second.get(); 38 | } 39 | } 40 | 41 | return nullptr; 42 | } 43 | 44 | XMLElement(std::vector tagName) { 45 | mTagName.clear(); 46 | mTagName.insert(mTagName.begin(), tagName.begin(), tagName.end()); 47 | } 48 | }; 49 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_save.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /services/daemon-service/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2021 LSPosed Contributors 18 | */ 19 | 20 | plugins { 21 | alias(libs.plugins.agp.lib) 22 | } 23 | 24 | android { 25 | buildFeatures { 26 | aidl = true 27 | } 28 | 29 | defaultConfig { 30 | consumerProguardFiles("proguard-rules.pro") 31 | } 32 | 33 | buildTypes { 34 | release { 35 | isMinifyEnabled = false 36 | } 37 | } 38 | 39 | aidlPackagedList += "org/lsposed/lspd/models/Module.aidl" 40 | aidlPackagedList += "org/lsposed/lspd/models/PreloadedApk.aidl" 41 | namespace = "org.lsposed.lspd.daemonservice" 42 | } 43 | 44 | dependencies { 45 | compileOnly(projects.hiddenapi.stubs) 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_outline_invert_colors_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_outline_restore_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_search_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /core/src/main/java/org/lsposed/lspd/nativebridge/HookBridge.java: -------------------------------------------------------------------------------- 1 | package org.lsposed.lspd.nativebridge; 2 | 3 | import java.lang.reflect.Executable; 4 | import java.lang.reflect.InvocationTargetException; 5 | 6 | import dalvik.annotation.optimization.FastNative; 7 | 8 | public class HookBridge { 9 | public static native boolean hookMethod(boolean useModernApi, Executable hookMethod, Class hooker, int priority, Object callback); 10 | 11 | public static native boolean unhookMethod(boolean useModernApi, Executable hookMethod, Object callback); 12 | 13 | public static native boolean deoptimizeMethod(Executable method); 14 | 15 | public static native T allocateObject(Class clazz) throws InstantiationException; 16 | 17 | public static native Object invokeOriginalMethod(Executable method, Object thisObject, Object... args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException; 18 | 19 | public static native Object invokeSpecialMethod(Executable method, char[] shorty, Class clazz, Object thisObject, Object... args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException; 20 | 21 | @FastNative 22 | public static native boolean instanceOf(Object obj, Class clazz); 23 | 24 | @FastNative 25 | public static native boolean setTrusted(Object cookie); 26 | 27 | public static native Object[][] callbackSnapshot(Class hooker_callback, Executable method); 28 | } 29 | -------------------------------------------------------------------------------- /daemon/src/main/res/values-zh-rCN/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Xposed 模块尚未激活 5 | %1$s 已安装,但尚未激活 6 | %1$s 已安装到用户 %2$s,但尚未激活 7 | Xposed 模块已更新 8 | %s 已更新,请强行停止并重新打开其作用域内的应用 9 | Xposed 模块已更新,需要重新启动 10 | %s 已更新,由于作用域包含系统框架,需重启以应用更改 11 | 模块更新完成 12 | LSPosed 状态 13 | LSPosed 已加载 14 | 点按通知以打开管理器 15 | 作用域请求 16 | 用户 %2$s 上的 %1$s 请求将 %3$s 添加至其作用域。 17 | 作用域请求 18 | 允许 19 | 拒绝 20 | 不再询问 21 | 22 | -------------------------------------------------------------------------------- /magisk-loader/src/main/jni/src/config_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2022 LSPosed Contributors 18 | */ 19 | 20 | #pragma once 21 | 22 | #include "config_bridge.h" 23 | #include "service.h" 24 | 25 | namespace lspd { 26 | class ConfigImpl : public ConfigBridge { 27 | public: 28 | inline static void Init() { 29 | instance_ = std::make_unique(); 30 | } 31 | 32 | virtual obfuscation_map_t &obfuscation_map() override { return obfuscation_map_; } 33 | 34 | virtual void 35 | obfuscation_map(obfuscation_map_t m) override { obfuscation_map_ = std::move(m); } 36 | 37 | private: 38 | inline static std::map obfuscation_map_; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /apache/local/MemberUtilsX.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.commons.lang3.reflect; 19 | 20 | import java.lang.reflect.Constructor; 21 | import java.lang.reflect.Method; 22 | 23 | public class MemberUtilsX { 24 | public static int compareConstructorFit(final Constructor left, final Constructor right, final Class[] actual) { 25 | return MemberUtils.compareConstructorFit(left, right, actual); 26 | } 27 | 28 | public static int compareMethodFit(final Method left, final Method right, final Class[] actual) { 29 | return MemberUtils.compareMethodFit(left, right, actual); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_log_textview.xml: -------------------------------------------------------------------------------- 1 | 19 | 30 | -------------------------------------------------------------------------------- /daemon/src/main/res/values-zh-rHK/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Xposed 模組尚未啟用 5 | %1$s 已安裝,但尚未啟用 6 | %1$s 已安裝到用戶 %2$s,但尚未啟用 7 | Xposed 模組已更新 8 | %s 已更新,請強制停止並重新開啟其作用範圍內的應用程式 9 | Xposed 模組已更新,需要重新啟動。 10 | %s 已更新,由於作用範圍包含系統架構,需要重新啟動以套用修改。 11 | 模块更新完成 12 | LSPosed 狀態 13 | LSPosed 已載入 14 | 輕觸通知以開啟管理員 15 | 作用範圍要求 16 | 用戶 %2$s 上的 %1$s 要求將 %3$s 新增至其作用範圍。 17 | 作用範圍要求 18 | 核准 19 | 拒絕 20 | 永不詢問 21 | 22 | -------------------------------------------------------------------------------- /daemon/src/main/res/values-zh-rTW/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Xposed 模組尚未啟用 5 | %1$s 已安裝,但尚未啟用 6 | %1$s 已安裝到使用者 %2$s,但尚未啟用 7 | Xposed 模組已更新 8 | %s 已更新,請強制停止並重新打開其作用域內的程式 9 | Xposed 模組已更新,需要重新啟動。 10 | %s 已更新,由於作用域包含系統框架,需要重新啟動以套用修改。 11 | 模組更新完成 12 | LSPosed 狀態 13 | LSPosed 已載入 14 | 輕觸通知以開啟管理員 15 | 作用範圍要求 16 | 使用者 %2$s 上的 %1$s 要求將 %3$s 新增至其作用範圍。 17 | 作用範圍要求 18 | 核准 19 | 拒絕 20 | 永不詢問 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_round_error_outline_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | -keep class org.lsposed.manager.Constants { 2 | public static boolean setBinder(android.os.IBinder); 3 | } 4 | -assumenosideeffects class kotlin.jvm.internal.Intrinsics { 5 | public static void check*(...); 6 | public static void throw*(...); 7 | } 8 | -assumenosideeffects class android.util.Log { 9 | public static *** v(...); 10 | public static *** d(...); 11 | } 12 | 13 | -keepclasseswithmembers,allowobfuscation class * { 14 | @com.google.gson.annotations.SerializedName ; 15 | } 16 | 17 | -repackageclasses 18 | -allowaccessmodification 19 | -overloadaggressively 20 | 21 | # Gson uses generic type information stored in a class file when working with fields. Proguard 22 | # removes such information by default, so configure it to keep all of it. 23 | -keepattributes Signature,InnerClasses,EnclosingMethod 24 | 25 | -dontwarn org.jetbrains.annotations.NotNull 26 | -dontwarn org.jetbrains.annotations.Nullable 27 | -dontwarn org.bouncycastle.jsse.BCSSLParameters 28 | -dontwarn org.bouncycastle.jsse.BCSSLSocket 29 | -dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider 30 | -dontwarn org.conscrypt.Conscrypt* 31 | -dontwarn org.conscrypt.ConscryptHostnameVerifier 32 | -dontwarn org.openjsse.javax.net.ssl.SSLParameters 33 | -dontwarn org.openjsse.javax.net.ssl.SSLSocket 34 | -dontwarn org.openjsse.net.ssl.OpenJSSE 35 | 36 | -keepclassmembers class * implements android.os.Parcelable { 37 | public static final ** CREATOR; 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_settings_backup_restore_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | 27 | 28 | 29 | 32 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_outline_speaker_notes_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_round_check_circle_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /core/src/main/java/org/lsposed/lspd/util/Hookers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2020 EdXposed Contributors 18 | * Copyright (C) 2021 LSPosed Contributors 19 | */ 20 | 21 | package org.lsposed.lspd.util; 22 | 23 | import android.app.ActivityThread; 24 | 25 | public class Hookers { 26 | 27 | public static void logD(String prefix) { 28 | Utils.logD(String.format("%s: pkg=%s, prc=%s", prefix, ActivityThread.currentPackageName(), 29 | ActivityThread.currentProcessName())); 30 | } 31 | 32 | public static void logE(String prefix, Throwable throwable) { 33 | Utils.logE(String.format("%s: pkg=%s, prc=%s", prefix, ActivityThread.currentPackageName(), 34 | ActivityThread.currentProcessName()), throwable); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/scrollable_dialog.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 23 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /magisk-loader/magisk_module/daemon: -------------------------------------------------------------------------------- 1 | #!/system/bin/sh 2 | 3 | dir=${0%/*} 4 | tmpLspdApk="/data/local/tmp/daemon.apk" 5 | debug=@DEBUG@ 6 | flavor=@FLAVOR@ 7 | 8 | if [ -r $tmpLspdApk ]; then 9 | java_options="-Djava.class.path=$tmpLspdApk" 10 | debug="true" 11 | else 12 | java_options="-Djava.class.path=$dir/daemon.apk" 13 | fi 14 | 15 | if [ $debug = "true" ]; then 16 | os_version=$(getprop ro.build.version.sdk) 17 | if [ "$os_version" -eq "27" ]; then 18 | java_options="$java_options -Xrunjdwp:transport=dt_android_adb,suspend=n,server=y -Xcompiler-option --debuggable" 19 | elif [ "$os_version" -eq "28" ]; then 20 | java_options="$java_options -XjdwpProvider:adbconnection -XjdwpOptions:suspend=n,server=y -Xcompiler-option --debuggable" 21 | else 22 | java_options="$java_options -XjdwpProvider:adbconnection -XjdwpOptions:suspend=n,server=y" 23 | fi 24 | fi 25 | 26 | mount tmpfs -t tmpfs /data/resource-cache 27 | 28 | if [ ! -S "/dev/socket/zygote" ]; then 29 | timeout 0.5 inotifyd - /dev/socket:near | while read -r line; do 30 | $debug && log -p v -t "ReLSPosed" "inotify: $line" 31 | if [ -S "/dev/socket/zygote" ]; then 32 | $debug && log -p v -t "ReLSPosed" "zygote started" 33 | touch /dev/socket& 34 | exit 35 | fi 36 | done 37 | fi 38 | $debug && log -p d -t "ReLSPosed" "start $flavor daemon $*" 39 | 40 | # shellcheck disable=SC2086 41 | exec /system/bin/app_process $java_options /system/bin --nice-name=lspd org.lsposed.lspd.Main "$@" >/dev/null 2>&1 42 | -------------------------------------------------------------------------------- /hiddenapi/stubs/src/main/java/android/annotation/NonNull.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package android.annotation; 17 | 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.Target; 20 | 21 | import static java.lang.annotation.ElementType.FIELD; 22 | import static java.lang.annotation.ElementType.METHOD; 23 | import static java.lang.annotation.ElementType.PARAMETER; 24 | import static java.lang.annotation.RetentionPolicy.SOURCE; 25 | 26 | /** 27 | * Denotes that a parameter, field or method return value can never be null. 28 | *

29 | * This is a marker annotation and it has no specific attributes. 30 | * 31 | * @paramDoc This value must never be {@code null}. 32 | * @returnDoc This value will never be {@code null}. 33 | * @hide 34 | */ 35 | @Retention(SOURCE) 36 | @Target({METHOD, PARAMETER, FIELD}) 37 | public @interface NonNull { 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/org/lsposed/manager/util/chrome/CustomTabsURLSpan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of LSPosed. 3 | * 4 | * LSPosed is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * LSPosed is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with LSPosed. If not, see . 16 | * 17 | * Copyright (C) 2020 EdXposed Contributors 18 | * Copyright (C) 2021 LSPosed Contributors 19 | */ 20 | 21 | package org.lsposed.manager.util.chrome; 22 | 23 | import android.app.Activity; 24 | import android.text.style.URLSpan; 25 | import android.view.View; 26 | 27 | import org.lsposed.manager.util.NavUtil; 28 | 29 | public class CustomTabsURLSpan extends URLSpan { 30 | 31 | private final Activity activity; 32 | 33 | public CustomTabsURLSpan(Activity activity, String url) { 34 | super(url); 35 | this.activity = activity; 36 | } 37 | 38 | @Override 39 | public void onClick(View widget) { 40 | String url = getURL(); 41 | NavUtil.startURL(activity, url); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_outline_format_color_fill_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_home.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 |

21 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_assignment_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_extension_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_attach_file.xml: -------------------------------------------------------------------------------- 1 | 20 | 21 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_outline_translate_24.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 26 | 29 | 30 | --------------------------------------------------------------------------------