2 added 5 characters in body
source | link

It is impossible for Krakatau to generate java files like that, and I imagine the same is true for other decompilers. However, I can think of some things that might lead to your confusion.

First off, nested and inner classes in Java are considered independent classes and are compiled into seperate classfiles. This is true even for anonymous classes, such as every time you use the double brace initialization pattern. Depending on the decompiler and settings, the classes might be decompiled independently or merged back into one file. This is the only thing I can think of which could be described as "aa class spanning"split up into multiple files".

As for a class extending multiple superclasses, this is obviously also impossible (though an interface can extend multiple superinterfaces). Most likely what happened is that you are confusing a class and its nested classes.

For example, you could have the main class A which subclasses Activity. Then A has an anonymous nested class, say A$1, which subclasses BroadcastReceiver. As a nested class, A$1 will of course have access to A's private members. (Note that this is technically not true at the bytecode level. The private members are accessed indirectly by compiler generated wrappers, which may or may not be shown, depending on the decompiler you use).

Alternatively, you may be mixing up unrelated classes with the similar names, such as A and a.

P.S. Krakatau is one of the decompilers that explicitly shows compiler generated accessors, so you definitely shouldn't be seeing direct access to private members of other classes. If you provide the app you are analyzing and the classes in question, I can try to figure out what's going on.

It is impossible for Krakatau to generate java files like that, and I imagine the same is true for other decompilers. However, I can think of some things that might lead to your confusion.

First off, nested and inner classes in Java are considered independent classes and are compiled into seperate classfiles. This is true even for anonymous classes, such as every time you use the double brace initialization pattern. Depending on the decompiler and settings, the classes might be decompiled independently or merged back into one file. This is the only thing I can think of which could be described as "a class spanning multiple files".

As for a class extending multiple superclasses, this is obviously also impossible (though an interface can extend multiple superinterfaces). Most likely what happened is that you are confusing a class and its nested classes.

For example, you could have the main class A which subclasses Activity. Then A has an anonymous nested class, say A$1, which subclasses BroadcastReceiver. As a nested class, A$1 will of course have access to A's private members. (Note that this is technically not true at the bytecode level. The private members are accessed indirectly by compiler generated wrappers, which may or may not be shown, depending on the decompiler you use).

Alternatively, you may be mixing up unrelated classes with the similar names, such as A and a.

It is impossible for Krakatau to generate java files like that, and I imagine the same is true for other decompilers. However, I can think of some things that might lead to your confusion.

First off, nested and inner classes in Java are considered independent classes and are compiled into seperate classfiles. This is true even for anonymous classes, such as every time you use the double brace initialization pattern. Depending on the decompiler and settings, the classes might be decompiled independently or merged back into one file. This is the only thing I can think of which could be described as a class "split up into multiple files".

As for a class extending multiple superclasses, this is obviously also impossible (though an interface can extend multiple superinterfaces). Most likely what happened is that you are confusing a class and its nested classes.

For example, you could have the main class A which subclasses Activity. Then A has an nested class, say A$1, which subclasses BroadcastReceiver. As a nested class, A$1 will of course have access to A's private members. (Note that this is technically not true at the bytecode level. The private members are accessed indirectly by compiler generated wrappers, which may or may not be shown, depending on the decompiler you use).

Alternatively, you may be mixing up unrelated classes with the similar names, such as A and a.

P.S. Krakatau is one of the decompilers that explicitly shows compiler generated accessors, so you definitely shouldn't be seeing direct access to private members of other classes. If you provide the app you are analyzing and the classes in question, I can try to figure out what's going on.

1
source | link

It is impossible for Krakatau to generate java files like that, and I imagine the same is true for other decompilers. However, I can think of some things that might lead to your confusion.

First off, nested and inner classes in Java are considered independent classes and are compiled into seperate classfiles. This is true even for anonymous classes, such as every time you use the double brace initialization pattern. Depending on the decompiler and settings, the classes might be decompiled independently or merged back into one file. This is the only thing I can think of which could be described as "a class spanning multiple files".

As for a class extending multiple superclasses, this is obviously also impossible (though an interface can extend multiple superinterfaces). Most likely what happened is that you are confusing a class and its nested classes.

For example, you could have the main class A which subclasses Activity. Then A has an anonymous nested class, say A$1, which subclasses BroadcastReceiver. As a nested class, A$1 will of course have access to A's private members. (Note that this is technically not true at the bytecode level. The private members are accessed indirectly by compiler generated wrappers, which may or may not be shown, depending on the decompiler you use).

Alternatively, you may be mixing up unrelated classes with the similar names, such as A and a.