-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Incorrect variable name in Java code (when compared to Simple code) causes an unintended name collision with an existing variable #1592
Comments
For comparison, it works for a similar function: /* JADX INFO: Access modifiers changed from: protected */
public final void zzc(int i, Parcel parcel) throws RemoteException {
Parcel obtain = Parcel.obtain();
try {
this.zza.transact(i, parcel, obtain, 0);
obtain.readException();
} finally {
parcel.recycle();
obtain.recycle();
}
}
.method protected final zzc(ILandroid/os/Parcel;)V
.registers 6
.param p1, "":I
.param p2, "":Landroid/os/Parcel;
.line 1
002f1d84: 7100 5b07 0000 0000: invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel; # method@075b
002f1d8a: 0c00 0003: move-result-object v0
try_0004: # :try_end_000c
# :catch_all_0014
002f1d8c: 5431 e94c 0004: iget-object v1, p0, Lcom/google/android/gms/internal/measurement/zzbm;->zza:Landroid/os/IBinder; # field@4ce9
002f1d90: 1202 0006: const/4 v2, 0
.line 2
002f1d92: 7252 3007 4105 0007: invoke-interface {v1, p1, p2, v0, v2}, Landroid/os/IBinder;->transact(I, Landroid/os/Parcel;, Landroid/os/Parcel;, I)Z # method@0730
.line 3
002f1d98: 6e10 6307 0000 000a: invoke-virtual {v0}, Landroid/os/Parcel;->readException()V # method@0763
.line 4
002f1d9e: 6e10 7307 0500 000d: invoke-virtual {p2}, Landroid/os/Parcel;->recycle()V # method@0773
.line 5
002f1da4: 6e10 7307 0000 0010: invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V # method@0773
002f1daa: 0e00 0013: return-void
catch_all_0014: # :try_0004
002f1dac: 0d04 0014: move-exception p1
.line 4
002f1dae: 6e10 7307 0500 0015: invoke-virtual {p2}, Landroid/os/Parcel;->recycle()V # method@0773
.line 5
002f1db4: 6e10 7307 0000 0018: invoke-virtual {v0}, Landroid/os/Parcel;->recycle()V # method@0773
.line 6
002f1dba: 2704 001b: throw p1
.end method |
@d3ce1t thanks for report, this is very nice test case! I commit a fix, not sure if it will work for all cases, but at least this one is fixed. P.S. I am glad to see that someone is using simple mode, because lack of feedback make me thought that this mode was not very usable 🙂 |
That was fast!! Thanks A LOT for the quick fix @skylot. It works :) I'm developing a gradle plugin to intercept http requests in an android app. I'm using bytecode transformation with ASM and couldn't do that without jadx. It helps me to see what third-party libraries are used and where to apply my transformations. Although I spend most of the time searching and switching between code and smali views, the simple mode was helpful in spotting this bug :). |
As you can see in the [Example] below there are some errors in Code view in regard to Simple view:
parcel = Parcel.obtain();
should beParcel obtain = Parcel.obtain();
.this.binder.transact(code, parcel, parcel, 0);
should bethis.binder.transact(code, parcel, obtain, 0);
parcel.readException();
should beobtain.readException();
return parcel;
should bereturn obtain;
Because of this, the resulting Java code doesn't work as intended.
I'm using Jadx 1.4.3 as a Flatpak.
Steps to reproduce:
com.google.android.gms.internal.measurement.zzbm
.zzb
andzzc
methods with their simple counterparts.Example
Code view:
Simple view:
Smali view:
The text was updated successfully, but these errors were encountered: