No getResources

This commit is contained in:
Nullptr 2023-08-15 20:51:42 +08:00
parent 844d2984a0
commit 19c2201eec
No known key found for this signature in database
3 changed files with 13 additions and 32 deletions

View File

@ -1,9 +1,7 @@
package io.github.libxposed.api; package io.github.libxposed.api;
import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.res.Resources;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@ -445,20 +443,10 @@ public interface XposedInterface {
/** /**
* Gets the application info of the module. * Gets the application info of the module.
*
* @see Context#getApplicationInfo()
*/ */
@NonNull @NonNull
ApplicationInfo getApplicationInfo(); ApplicationInfo getApplicationInfo();
/**
* Gets resources of the module.
*
* @see Context#getResources()
*/
@NonNull
Resources getResources();
/** /**
* Gets remote preferences stored in Xposed framework. Note that those are read-only in hooked apps. * Gets remote preferences stored in Xposed framework. Note that those are read-only in hooked apps.
* *
@ -469,6 +457,15 @@ public interface XposedInterface {
@Nullable @Nullable
SharedPreferences getRemotePreferences(@NonNull String group); SharedPreferences getRemotePreferences(@NonNull String group);
/**
* List all files in the module's shared data directory.
*
* @return The file list
* @throws UnsupportedOperationException If the framework is embedded
*/
@NonNull
String[] listRemoteFiles();
/** /**
* Open an InputStream to read a file from the module's shared data directory. * Open an InputStream to read a file from the module's shared data directory.
* *
@ -479,13 +476,4 @@ public interface XposedInterface {
*/ */
@NonNull @NonNull
FileInputStream openRemoteFileInput(@NonNull String name) throws FileNotFoundException; FileInputStream openRemoteFileInput(@NonNull String name) throws FileNotFoundException;
/**
* List all files in the module's shared data directory.
*
* @return The file list
* @throws UnsupportedOperationException If the framework is embedded
*/
@NonNull
String[] listRemoteFiles();
} }

View File

@ -2,7 +2,6 @@ package io.github.libxposed.api;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.res.Resources;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@ -137,8 +136,8 @@ public class XposedInterfaceWrapper implements XposedInterface {
@NonNull @NonNull
@Override @Override
public Resources getResources() { public String[] listRemoteFiles() {
return mBase.getResources(); return mBase.listRemoteFiles();
} }
@NonNull @NonNull
@ -146,10 +145,4 @@ public class XposedInterfaceWrapper implements XposedInterface {
public FileInputStream openRemoteFileInput(@NonNull String name) throws FileNotFoundException { public FileInputStream openRemoteFileInput(@NonNull String name) throws FileNotFoundException {
return mBase.openRemoteFileInput(name); return mBase.openRemoteFileInput(name);
} }
@NonNull
@Override
public String[] listRemoteFiles() {
return mBase.listRemoteFiles();
}
} }

View File

@ -57,12 +57,12 @@ public interface XposedModuleInterface {
String getPackageName(); String getPackageName();
/** /**
* Gets the ApplicationInfo of the package being loaded. * Gets the {@link ApplicationInfo} of the package being loaded.
* *
* @return The ApplicationInfo. * @return The ApplicationInfo.
*/ */
@NonNull @NonNull
ApplicationInfo getAppInfo(); ApplicationInfo getApplicationInfo();
/** /**
* Gets default class loader. * Gets default class loader.