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;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.res.Resources;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@ -445,20 +443,10 @@ public interface XposedInterface {
/**
* Gets the application info of the module.
*
* @see Context#getApplicationInfo()
*/
@NonNull
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.
*
@ -469,6 +457,15 @@ public interface XposedInterface {
@Nullable
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.
*
@ -479,13 +476,4 @@ public interface XposedInterface {
*/
@NonNull
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.pm.ApplicationInfo;
import android.content.res.Resources;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@ -137,8 +136,8 @@ public class XposedInterfaceWrapper implements XposedInterface {
@NonNull
@Override
public Resources getResources() {
return mBase.getResources();
public String[] listRemoteFiles() {
return mBase.listRemoteFiles();
}
@NonNull
@ -146,10 +145,4 @@ public class XposedInterfaceWrapper implements XposedInterface {
public FileInputStream openRemoteFileInput(@NonNull String name) throws FileNotFoundException {
return mBase.openRemoteFileInput(name);
}
@NonNull
@Override
public String[] listRemoteFiles() {
return mBase.listRemoteFiles();
}
}

View File

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