Android's decompiled .class file don't show all methods of the corresponding .java file
up vote
0
down vote
favorite
So, I'm building an app to copy all my messages (AND mms, WITH attachments) from iOS (iTunes backup) to Android Pie (OxygenOS).
I went through Android's SmsManager.java file, and I noticed two methods:
importTextMessage(...)
importMultimediaMessage(...)
They appear to be the ones I'm looking for, but:
- They don't appear in the decompiled
SmsManager.class
file - When I still try to use it, compiler complains
- And last, they are not documented.
So, questions. Why do they appear in SmsManager.java
but not in SmsManager.class
(jetbrains decompiler)? Why aren't they documented? How can I use these methods?
EDIT: I successfully restored my backup on my OnePlus 6T. If you want a working project, see here https://github.com/let-aurn/iosmessagetoandroid.
java android android-studio smsmanager
add a comment |
up vote
0
down vote
favorite
So, I'm building an app to copy all my messages (AND mms, WITH attachments) from iOS (iTunes backup) to Android Pie (OxygenOS).
I went through Android's SmsManager.java file, and I noticed two methods:
importTextMessage(...)
importMultimediaMessage(...)
They appear to be the ones I'm looking for, but:
- They don't appear in the decompiled
SmsManager.class
file - When I still try to use it, compiler complains
- And last, they are not documented.
So, questions. Why do they appear in SmsManager.java
but not in SmsManager.class
(jetbrains decompiler)? Why aren't they documented? How can I use these methods?
EDIT: I successfully restored my backup on my OnePlus 6T. If you want a working project, see here https://github.com/let-aurn/iosmessagetoandroid.
java android android-studio smsmanager
Ok. I just noticed these methods have the@hide
attribute in the java-doc. Can I still use them somehow?
– David
Nov 18 at 1:22
"When I still try to use it, compiler complains" - What does it say?
– Stephen C
Nov 18 at 2:49
@StephenC, compiler says methods don't exist
– David
Nov 18 at 10:36
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
So, I'm building an app to copy all my messages (AND mms, WITH attachments) from iOS (iTunes backup) to Android Pie (OxygenOS).
I went through Android's SmsManager.java file, and I noticed two methods:
importTextMessage(...)
importMultimediaMessage(...)
They appear to be the ones I'm looking for, but:
- They don't appear in the decompiled
SmsManager.class
file - When I still try to use it, compiler complains
- And last, they are not documented.
So, questions. Why do they appear in SmsManager.java
but not in SmsManager.class
(jetbrains decompiler)? Why aren't they documented? How can I use these methods?
EDIT: I successfully restored my backup on my OnePlus 6T. If you want a working project, see here https://github.com/let-aurn/iosmessagetoandroid.
java android android-studio smsmanager
So, I'm building an app to copy all my messages (AND mms, WITH attachments) from iOS (iTunes backup) to Android Pie (OxygenOS).
I went through Android's SmsManager.java file, and I noticed two methods:
importTextMessage(...)
importMultimediaMessage(...)
They appear to be the ones I'm looking for, but:
- They don't appear in the decompiled
SmsManager.class
file - When I still try to use it, compiler complains
- And last, they are not documented.
So, questions. Why do they appear in SmsManager.java
but not in SmsManager.class
(jetbrains decompiler)? Why aren't they documented? How can I use these methods?
EDIT: I successfully restored my backup on my OnePlus 6T. If you want a working project, see here https://github.com/let-aurn/iosmessagetoandroid.
java android android-studio smsmanager
java android android-studio smsmanager
edited 13 hours ago
asked Nov 18 at 1:18
David
2,20032041
2,20032041
Ok. I just noticed these methods have the@hide
attribute in the java-doc. Can I still use them somehow?
– David
Nov 18 at 1:22
"When I still try to use it, compiler complains" - What does it say?
– Stephen C
Nov 18 at 2:49
@StephenC, compiler says methods don't exist
– David
Nov 18 at 10:36
add a comment |
Ok. I just noticed these methods have the@hide
attribute in the java-doc. Can I still use them somehow?
– David
Nov 18 at 1:22
"When I still try to use it, compiler complains" - What does it say?
– Stephen C
Nov 18 at 2:49
@StephenC, compiler says methods don't exist
– David
Nov 18 at 10:36
Ok. I just noticed these methods have the
@hide
attribute in the java-doc. Can I still use them somehow?– David
Nov 18 at 1:22
Ok. I just noticed these methods have the
@hide
attribute in the java-doc. Can I still use them somehow?– David
Nov 18 at 1:22
"When I still try to use it, compiler complains" - What does it say?
– Stephen C
Nov 18 at 2:49
"When I still try to use it, compiler complains" - What does it say?
– Stephen C
Nov 18 at 2:49
@StephenC, compiler says methods don't exist
– David
Nov 18 at 10:36
@StephenC, compiler says methods don't exist
– David
Nov 18 at 10:36
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Methods annotated with @hide are not part of the public Android API and are not designed to be used by developers. They are often internal to the class only and are subject to change across Android versions.
You can call these methods via reflection, but do so with caution as they may change or be removed. You should always check when the method appeared in the .java file, when the signature changed and if/when it got removed. Then wrap your code in Android version checks where needed.
add a comment |
up vote
1
down vote
The
@hide
javadoc annotation should only hide the method from the javadocs. However, the Android documentation states this:
In general, apps should only use the officially documented parts of the classes in the SDK. In particular, this means that you should not plan to access methods or fields that are not listed in the SDK when you interact with a class via semantics such as reflection.
Then it goes on to explain that reflective and other access to internal APIs may be blocked by various means.
Source: Restrictions on non-SDK interfaces
It is possible that the methods have been removed by either modifying the source code that the ".class" files were built from, or by some bytecode manipulation after the compilation. This would have been done to prevent you writing code that depended on the internal API methods by accident.
If the methods aren't there (for whatever reason) in the interfaces you compiled against, you shouldn't be trying other ways to access. Even if you succeed this is liable to cause portability issues in the future.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Methods annotated with @hide are not part of the public Android API and are not designed to be used by developers. They are often internal to the class only and are subject to change across Android versions.
You can call these methods via reflection, but do so with caution as they may change or be removed. You should always check when the method appeared in the .java file, when the signature changed and if/when it got removed. Then wrap your code in Android version checks where needed.
add a comment |
up vote
1
down vote
accepted
Methods annotated with @hide are not part of the public Android API and are not designed to be used by developers. They are often internal to the class only and are subject to change across Android versions.
You can call these methods via reflection, but do so with caution as they may change or be removed. You should always check when the method appeared in the .java file, when the signature changed and if/when it got removed. Then wrap your code in Android version checks where needed.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Methods annotated with @hide are not part of the public Android API and are not designed to be used by developers. They are often internal to the class only and are subject to change across Android versions.
You can call these methods via reflection, but do so with caution as they may change or be removed. You should always check when the method appeared in the .java file, when the signature changed and if/when it got removed. Then wrap your code in Android version checks where needed.
Methods annotated with @hide are not part of the public Android API and are not designed to be used by developers. They are often internal to the class only and are subject to change across Android versions.
You can call these methods via reflection, but do so with caution as they may change or be removed. You should always check when the method appeared in the .java file, when the signature changed and if/when it got removed. Then wrap your code in Android version checks where needed.
answered Nov 18 at 3:51
Greg Moens
1095
1095
add a comment |
add a comment |
up vote
1
down vote
The
@hide
javadoc annotation should only hide the method from the javadocs. However, the Android documentation states this:
In general, apps should only use the officially documented parts of the classes in the SDK. In particular, this means that you should not plan to access methods or fields that are not listed in the SDK when you interact with a class via semantics such as reflection.
Then it goes on to explain that reflective and other access to internal APIs may be blocked by various means.
Source: Restrictions on non-SDK interfaces
It is possible that the methods have been removed by either modifying the source code that the ".class" files were built from, or by some bytecode manipulation after the compilation. This would have been done to prevent you writing code that depended on the internal API methods by accident.
If the methods aren't there (for whatever reason) in the interfaces you compiled against, you shouldn't be trying other ways to access. Even if you succeed this is liable to cause portability issues in the future.
add a comment |
up vote
1
down vote
The
@hide
javadoc annotation should only hide the method from the javadocs. However, the Android documentation states this:
In general, apps should only use the officially documented parts of the classes in the SDK. In particular, this means that you should not plan to access methods or fields that are not listed in the SDK when you interact with a class via semantics such as reflection.
Then it goes on to explain that reflective and other access to internal APIs may be blocked by various means.
Source: Restrictions on non-SDK interfaces
It is possible that the methods have been removed by either modifying the source code that the ".class" files were built from, or by some bytecode manipulation after the compilation. This would have been done to prevent you writing code that depended on the internal API methods by accident.
If the methods aren't there (for whatever reason) in the interfaces you compiled against, you shouldn't be trying other ways to access. Even if you succeed this is liable to cause portability issues in the future.
add a comment |
up vote
1
down vote
up vote
1
down vote
The
@hide
javadoc annotation should only hide the method from the javadocs. However, the Android documentation states this:
In general, apps should only use the officially documented parts of the classes in the SDK. In particular, this means that you should not plan to access methods or fields that are not listed in the SDK when you interact with a class via semantics such as reflection.
Then it goes on to explain that reflective and other access to internal APIs may be blocked by various means.
Source: Restrictions on non-SDK interfaces
It is possible that the methods have been removed by either modifying the source code that the ".class" files were built from, or by some bytecode manipulation after the compilation. This would have been done to prevent you writing code that depended on the internal API methods by accident.
If the methods aren't there (for whatever reason) in the interfaces you compiled against, you shouldn't be trying other ways to access. Even if you succeed this is liable to cause portability issues in the future.
The
@hide
javadoc annotation should only hide the method from the javadocs. However, the Android documentation states this:
In general, apps should only use the officially documented parts of the classes in the SDK. In particular, this means that you should not plan to access methods or fields that are not listed in the SDK when you interact with a class via semantics such as reflection.
Then it goes on to explain that reflective and other access to internal APIs may be blocked by various means.
Source: Restrictions on non-SDK interfaces
It is possible that the methods have been removed by either modifying the source code that the ".class" files were built from, or by some bytecode manipulation after the compilation. This would have been done to prevent you writing code that depended on the internal API methods by accident.
If the methods aren't there (for whatever reason) in the interfaces you compiled against, you shouldn't be trying other ways to access. Even if you succeed this is liable to cause portability issues in the future.
edited Nov 18 at 4:35
answered Nov 18 at 2:56
Stephen C
508k69554905
508k69554905
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53357089%2fandroids-decompiled-class-file-dont-show-all-methods-of-the-corresponding-ja%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Ok. I just noticed these methods have the
@hide
attribute in the java-doc. Can I still use them somehow?– David
Nov 18 at 1:22
"When I still try to use it, compiler complains" - What does it say?
– Stephen C
Nov 18 at 2:49
@StephenC, compiler says methods don't exist
– David
Nov 18 at 10:36