[Android] JavierAlonso:
Multiple Line Change

Here I'm going to explain you another kind of reject, that could be confusing sometimes. I like to call it: Multiple Line Change. :D :D :)

For example, we can find this reject:

*** 40,52 ****

# virtual methods
.method public run()V
.locals 5

.prologue
:try_start_0
iget-object v1, p0, Lcom/android/server/MasterClearReceiver$1;->val$context:Landroid/content/Context;

! invoke-static {v1}, Landroid/os/RecoverySystem;->rebootWipeUserData(Landroid/content/Context;)V

const-string v1, "MasterClear"

--- 44,66 ----

# virtual methods
.method public run()V
.locals 5

.prologue
:try_start_0
iget-object v1, p0, Lcom/android/server/MasterClearReceiver$1;->val$context:Landroid/content/Context;

! iget-object v2, p0, Lcom/android/server/MasterClearReceiver$1;->val$intent:Landroid/content/Intent;
!
! const-string v3, "format_sdcard"
!
! const/4 v4, 0x0
!
! invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
!
! move-result v2
!
! invoke-static {v1, v2}, Landroid/os/RecoverySystem;->rebootFactoryReset(Landroid/content/Context;Z)V

const-string v1, "MasterClear"

As you can see, there's not addition (+) or delete (-) symbols, only edit (!). This type of reject is special due to in "source input" there's a single line with !, and in "after patch" appear 11 changes.

How? What's the reason? Very simple.

For example, I have this line in source input:

! invoke-static {v1}, Landroid/os/RecoverySystem;->rebootWipeUserData(Landroid/content/Context;)V

And in "after patch" appears this:

! iget-object v2, p0, Lcom/android/server/MasterClearReceiver$1;->val$intent:Landroid/content/Intent;
!
! const-string v3, "format_sdcard"
!
! const/4 v4, 0x0
!
! invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
!
! move-result v2
!
! invoke-static {v1, v2}, Landroid/os/RecoverySystem;->rebootFactoryReset(Landroid/content/Context;Z)V

So what to do? You have to know that:

If "!" lines appear close together, it means this "Block of code" is one object. So replace the single "!" before line with that entire block.

Applying this knowledge, with this the reject I'll do this:

I have to change this:

invoke-static {v1}, Landroid/os/RecoverySystem;->rebootWipeUserData(Landroid/content/Context;)V

To this:

iget-object v2, p0, Lcom/android/server/MasterClearReceiver$1;->val$intent:Landroid/content/Intent;

const-string v3, "format_sdcard"

const/4 v4, 0x0

invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

move-result v2

invoke-static {v1, v2}, Landroid/os/RecoverySystem;->rebootFactoryReset(Landroid/content/Context;Z)V

So after patching it manually, the base file looks in this way:

# virtual methods
.method public run()V
.locals 5

.prologue
:try_start_0
iget-object v1, p0, Lcom/android/server/MasterClearReceiver$1;->val$context:Landroid/content/Context;

iget-object v2, p0, Lcom/android/server/MasterClearReceiver$1;->val$intent:Landroid/content/Intent;

const-string v3, "format_sdcard"

const/4 v4, 0x0

invoke-virtual {v2, v3, v4}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

move-result v2

invoke-static {v1, v2}, Landroid/os/RecoverySystem;->rebootFactoryReset(Landroid/content/Context;Z)V

const-string v1, "MasterClear"

And that's it. I think it's very easy to understand. This kind of reject is nearly and addition, with the difference that we change one line with an entire block. So DON'T leave the ! line of source input; you must delete it and replace it with that block.