forked from flankerhqd/vendor-android-cves
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added hidden-api-stub module (copied from Shizuku-API demo-hidden-api…
…-stub)
- Loading branch information
Showing
27 changed files
with
484 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apply plugin: 'java-library' | ||
|
||
sourceCompatibility = "1.7" | ||
targetCompatibility = "1.7" |
38 changes: 38 additions & 0 deletions
38
smtshell/hidden-api-stub/src/main/java/android/annotation/NonNull.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (C) 2013 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package android.annotation; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import static java.lang.annotation.RetentionPolicy.SOURCE; | ||
|
||
/** | ||
* Denotes that a parameter, field or method return value can never be null. | ||
* <p> | ||
* This is a marker annotation and it has no specific attributes. | ||
* | ||
* @paramDoc This value must never be {@code null}. | ||
* @returnDoc This value will never be {@code null}. | ||
* @hide | ||
*/ | ||
@Retention(SOURCE) | ||
@Target({METHOD, PARAMETER, FIELD}) | ||
public @interface NonNull { | ||
} |
44 changes: 44 additions & 0 deletions
44
smtshell/hidden-api-stub/src/main/java/android/annotation/Nullable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (C) 2013 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package android.annotation; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.PARAMETER; | ||
import static java.lang.annotation.RetentionPolicy.SOURCE; | ||
|
||
/** | ||
* Denotes that a parameter, field or method return value can be null. | ||
* <p> | ||
* When decorating a method call parameter, this denotes that the parameter can | ||
* legitimately be null and the method will gracefully deal with it. Typically | ||
* used on optional parameters. | ||
* <p> | ||
* When decorating a method, this denotes the method might legitimately return | ||
* null. | ||
* <p> | ||
* This is a marker annotation and it has no specific attributes. | ||
* | ||
* @paramDoc This value may be {@code null}. | ||
* @returnDoc This value may be {@code null}. | ||
*/ | ||
@Retention(SOURCE) | ||
@Target({METHOD, PARAMETER, FIELD}) | ||
public @interface Nullable { | ||
} |
15 changes: 15 additions & 0 deletions
15
smtshell/hidden-api-stub/src/main/java/android/content/IIntentReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package android.content; | ||
|
||
import android.os.Binder; | ||
import android.os.Bundle; | ||
|
||
public interface IIntentReceiver { | ||
|
||
void performReceive(Intent intent, int resultCode, String data, Bundle extras, | ||
boolean ordered, boolean sticky, int sendingUser) | ||
throws android.os.RemoteException; | ||
|
||
abstract class Stub extends Binder implements IIntentReceiver { | ||
|
||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
smtshell/hidden-api-stub/src/main/java/android/content/IIntentSender.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package android.content; | ||
|
||
import android.os.Binder; | ||
import android.os.Bundle; | ||
import android.os.IBinder; | ||
import android.os.IInterface; | ||
|
||
import androidx.annotation.RequiresApi; | ||
|
||
public interface IIntentSender extends IInterface { | ||
|
||
int send(int code, Intent intent, String resolvedType, | ||
IIntentReceiver finishedReceiver, String requiredPermission, Bundle options); | ||
|
||
@RequiresApi(26) | ||
void send(int code, Intent intent, String resolvedType, IBinder whitelistToken, | ||
IIntentReceiver finishedReceiver, String requiredPermission, Bundle options); | ||
|
||
abstract class Stub extends Binder implements IIntentSender { | ||
|
||
public Stub() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public android.os.IBinder asBinder() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
public static IIntentSender asInterface(IBinder binder) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
smtshell/hidden-api-stub/src/main/java/android/content/Intent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package android.content; | ||
|
||
public class Intent { | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
smtshell/hidden-api-stub/src/main/java/android/content/IntentSender.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package android.content; | ||
|
||
public class IntentSender { | ||
} |
10 changes: 10 additions & 0 deletions
10
smtshell/hidden-api-stub/src/main/java/android/content/pm/BaseParceledListSlice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package android.content.pm; | ||
|
||
import java.util.List; | ||
|
||
abstract class BaseParceledListSlice<T> { | ||
|
||
public List<T> getList() { | ||
throw new RuntimeException("STUB"); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
smtshell/hidden-api-stub/src/main/java/android/content/pm/IPackageInstaller.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package android.content.pm; | ||
|
||
import android.os.Binder; | ||
import android.os.IBinder; | ||
import android.os.IInterface; | ||
import android.os.RemoteException; | ||
|
||
public interface IPackageInstaller extends IInterface { | ||
|
||
void abandonSession(int sessionId) | ||
throws RemoteException; | ||
|
||
IPackageInstallerSession openSession(int sessionId) | ||
throws RemoteException; | ||
|
||
ParceledListSlice<PackageInstaller.SessionInfo> getMySessions(String installerPackageName, int userId) | ||
throws RemoteException; | ||
|
||
abstract class Stub extends Binder implements IPackageInstaller { | ||
|
||
public static IPackageInstaller asInterface(IBinder binder) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
smtshell/hidden-api-stub/src/main/java/android/content/pm/IPackageInstallerSession.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package android.content.pm; | ||
|
||
import android.os.Binder; | ||
import android.os.IBinder; | ||
import android.os.IInterface; | ||
|
||
public interface IPackageInstallerSession extends IInterface { | ||
|
||
abstract class Stub extends Binder implements IPackageInstallerSession { | ||
|
||
public static IPackageInstallerSession asInterface(IBinder binder) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
smtshell/hidden-api-stub/src/main/java/android/content/pm/IPackageManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package android.content.pm; | ||
|
||
import android.os.Binder; | ||
import android.os.IBinder; | ||
import android.os.IInterface; | ||
import android.os.RemoteException; | ||
|
||
import androidx.annotation.RequiresApi; | ||
|
||
public interface IPackageManager extends IInterface { | ||
|
||
IPackageInstaller getPackageInstaller() | ||
throws RemoteException; | ||
|
||
abstract class Stub extends Binder implements IPackageManager { | ||
|
||
public static IPackageManager asInterface(IBinder obj) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
smtshell/hidden-api-stub/src/main/java/android/content/pm/PackageInstaller.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package android.content.pm; | ||
|
||
public class PackageInstaller { | ||
|
||
public static class SessionParams { | ||
|
||
} | ||
|
||
public static class SessionInfo { | ||
|
||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
smtshell/hidden-api-stub/src/main/java/android/content/pm/ParceledListSlice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package android.content.pm; | ||
|
||
public class ParceledListSlice<T> extends BaseParceledListSlice<T> { | ||
} |
6 changes: 6 additions & 0 deletions
6
smtshell/hidden-api-stub/src/main/java/android/content/pm/UserInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package android.content.pm; | ||
|
||
public class UserInfo { | ||
|
||
public int id; | ||
} |
58 changes: 58 additions & 0 deletions
58
smtshell/hidden-api-stub/src/main/java/android/os/Binder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package android.os; | ||
|
||
import android.annotation.NonNull; | ||
import android.annotation.Nullable; | ||
|
||
import java.io.FileDescriptor; | ||
|
||
public class Binder implements IBinder { | ||
|
||
@Override | ||
public boolean transact(int code, @NonNull Parcel data, Parcel reply, int flags) { | ||
throw new RuntimeException("STUB"); | ||
} | ||
|
||
@Override | ||
public String getInterfaceDescriptor() { | ||
throw new RuntimeException("STUB"); | ||
} | ||
|
||
public boolean pingBinder() { | ||
throw new RuntimeException("STUB"); | ||
} | ||
|
||
@Override | ||
public boolean isBinderAlive() { | ||
throw new RuntimeException("STUB"); | ||
} | ||
|
||
@Override | ||
public IInterface queryLocalInterface(@NonNull String descriptor) { | ||
throw new RuntimeException("STUB"); | ||
} | ||
|
||
@Override | ||
public void dump(@NonNull FileDescriptor fd, String[] args) { | ||
throw new RuntimeException("STUB"); | ||
} | ||
|
||
@Override | ||
public void dumpAsync(@NonNull FileDescriptor fd, String[] args) { | ||
throw new RuntimeException("STUB"); | ||
} | ||
|
||
@Override | ||
public void linkToDeath(@NonNull DeathRecipient recipient, int flags) { | ||
throw new RuntimeException("STUB"); | ||
} | ||
|
||
@Override | ||
public boolean unlinkToDeath(@NonNull DeathRecipient recipient, int flags) { | ||
throw new RuntimeException("STUB"); | ||
} | ||
|
||
protected boolean onTransact(int code, @NonNull Parcel data, @Nullable Parcel reply, | ||
int flags) throws RemoteException { | ||
throw new RuntimeException("STUB"); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
smtshell/hidden-api-stub/src/main/java/android/os/Bundle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package android.os; | ||
|
||
public class Bundle { | ||
} |
33 changes: 33 additions & 0 deletions
33
smtshell/hidden-api-stub/src/main/java/android/os/IBinder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package android.os; | ||
|
||
import android.annotation.NonNull; | ||
import android.annotation.Nullable; | ||
|
||
import java.io.FileDescriptor; | ||
|
||
public interface IBinder { | ||
|
||
boolean transact(int code, @NonNull Parcel data, @Nullable Parcel reply, int flags); | ||
|
||
@Nullable | ||
String getInterfaceDescriptor(); | ||
|
||
boolean pingBinder(); | ||
|
||
boolean isBinderAlive(); | ||
|
||
@Nullable | ||
IInterface queryLocalInterface(@NonNull String descriptor); | ||
|
||
void dump(@NonNull FileDescriptor fd, @Nullable String[] args); | ||
|
||
void dumpAsync(@NonNull FileDescriptor fd, @Nullable String[] args); | ||
|
||
void linkToDeath(@NonNull DeathRecipient recipient, int flags); | ||
|
||
boolean unlinkToDeath(@NonNull DeathRecipient recipient, int flags); | ||
|
||
interface DeathRecipient { | ||
void binderDied(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
smtshell/hidden-api-stub/src/main/java/android/os/IInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package android.os; | ||
|
||
public interface IInterface { | ||
|
||
IBinder asBinder(); | ||
} |
Oops, something went wrong.