[Sprint Samsung Galaxy S III] oneleft.ak:
Cant get systemui.apk to compile with the flashlight smali provided by OP

I had no problems decompiling systemui.apk using apktool 2.0.0rc1. However, I noticed there was already a FlashLightQuickSettingButton.smali file in systemui. When I replaced the FlashLightQuickSettingButton.smali with the file provided by the OP I got the following error when trying to re-compile systemui:

I: Smaling...
systemui\smali\com\android\systemui\statusbar\policy\quicksetting\FlashLightQuic
kSettingButton.smali[22,4] Error for input '.parameter': Invalid directive
systemui\smali\com\android\systemui\statusbar\policy\quicksetting\FlashLightQuic
kSettingButton.smali[22,15] mismatched input '"context"' expecting END_METHOD_DI
RECTIVE
systemui\smali\com\android\systemui\statusbar\policy\quicksetting\FlashLightQuic
kSettingButton.smali[121,4] Error for input '.parameter': Invalid directive
systemui\smali\com\android\systemui\statusbar\policy\quicksetting\FlashLightQuic
kSettingButton.smali[121,15] mismatched input '"paramBoolean"' expecting END_MET
HOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: com/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButto
n.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:72)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:56)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:342)
at brut.androlib.Androlib.buildSources(Androlib.java:303)
at brut.androlib.Androlib.build(Androlib.java:289)
at brut.androlib.Androlib.build(Androlib.java:262)
at brut.apktool.Main.cmdBuild(Main.java:236)
at brut.apktool.Main.main(Main.java:88)

Here is the content of the original FlashLightQuickSettingButton.smali:

.class public Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;
.super Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;
.source "FlashLightQuickSettingButton.java"

# interfaces
.implements Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton$Listener;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton$FlashLightObserver;
}
.end annotation

# static fields
.field private static final TW_TAG:Ljava/lang/String; = "STATUSBAR-FlashLightController"

# instance fields
.field private mContentResolver:Landroid/content/ContentResolver;

.field private mFlashLightObserver:Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton$FlashLightObserver;

.field private mState:Z

# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.param p1, "context" # Landroid/content/Context;

.prologue
const v1, 0x7f0b020f

const/4 v8, 0x1

const/4 v5, 0x0

.line 49
const/4 v0, 0x0

sget-boolean v2, Lcom/android/systemui/statusbar/Feature;->mIsTablet:Z

invoke-direct {p0, p1, v0, v2}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V

.line 50
const v3, 0x7f02020f

const v4, 0x7f020211

move-object v0, p0

move v2, v1

move v6, v5

move v7, v5

invoke-virtual/range {v0 .. v7}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIIII)V

.line 57
invoke-virtual {p0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->setListener(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton$Listener;)V

.line 58
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v0

const-string v1, "flash_light_start"

invoke-static {v0, v1, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v0

if-eqz v0, :cond_0

move v5, v8

:cond_0
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;->mState:Z

.line 59
iget-boolean v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;->mState:Z

if-eqz v0, :cond_1

:goto_0
invoke-virtual {p0, v8}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->setActivateStatus(I)V

.line 60
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v0

iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;->mContentResolver:Landroid/content/ContentResolver;

.line 61
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton$FlashLightObserver;

invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton$FlashLightObserver;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;)V

iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;->mFlashLightObserver:Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton$FlashLightObserver;

.line 62
return-void

.line 59
:cond_1
const/4 v8, 0x2

goto :goto_0
.end method

.method static synthetic access$000(Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;)Z
.locals 1
.param p0, "x0" # Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;

.prologue
.line 40
iget-boolean v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;->mState:Z

return v0
.end method

.method static synthetic access$002(Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;Z)Z
.locals 0
.param p0, "x0" # Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;
.param p1, "x1" # Z

.prologue
.line 40
iput-boolean p1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;->mState:Z

return p1
.end method

.method static synthetic access$100(Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;)Landroid/content/ContentResolver;
.locals 1
.param p0, "x0" # Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;

.prologue
.line 40
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;->mContentResolver:Landroid/content/ContentResolver;

return-object v0
.end method

# virtual methods
.method public deinit()V
.locals 2

.prologue
.line 70
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;->mContentResolver:Landroid/content/ContentResolver;

iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;->mFlashLightObserver:Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton$FlashLightObserver;

invoke-virtual {v0, v1}, Landroid/content/ContentResolver;->unregisterContentObserver(Landroid/database/ContentObserver;)V

.line 71
return-void
.end method

.method public init()V
.locals 5

.prologue
.line 65
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;->mContentResolver:Landroid/content/ContentResolver;

const-string v1, "flash_light_start"

invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

move-result-object v1

const/4 v2, 0x0

iget-object v3, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;->mFlashLightObserver:Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton$FlashLightObserver;

const/4 v4, -0x2

invoke-virtual {v0, v1, v2, v3, v4}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V

.line 67
return-void
.end method

.method public onClick(Z)V
.locals 3
.param p1, "state" # Z

.prologue
.line 74
const-string v0, "STATUSBAR-FlashLightController"

new-instance v1, Ljava/lang/StringBuilder;

invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

const-string v2, "onClick state="

invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v1

invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

move-result-object v1

invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v1

invoke-static {v0, v1}, Landroid/util/secutil/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

.line 75
const/4 v0, 0x1

if-ne p1, v0, :cond_0

.line 77
const-string v0, "com.android.settings"

const-string v1, "com.android.settings.flashlight.FlashLightDisplay"

invoke-virtual {p0, v0, v1}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->callActivity(Ljava/lang/String;Ljava/lang/String;)V

.line 83
:goto_0
return-void

.line 81
:cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashLightQuickSettingButton;->mContentResolver:Landroid/content/ContentResolver;

const-string v1, "flash_light_start"

const/4 v2, 0x0

invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

goto :goto_0
.end method

.method public onLongClick()V
.locals 0

.prologue
.line 88
return-void
.end method

Here is the content of the FlashLightQuickSettingButton.smali from the zip in OP that is throwing the error on compile:

.class public Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;
.super Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;
.source "FlashlightQuickSettingButton.java"

# interfaces
.implements Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton$Listener;

# static fields
.field private static final TW_TAG:Ljava/lang/String; = "STATUSBAR-FlashlightQuickSettingButton"

# instance fields
.field private mContext:Landroid/content/Context;

.field private mFlashlight:I

# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 7
.parameter "context"

.prologue
const/4 v4, 0x0

.line 16
const/4 v0, 0x0

invoke-direct {p0, p1, v0, v4}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V

.line 17
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

move-result-object v0

const-string v1, "quickpanel_flashlight_text"

const-string v2, "string"

const-string v3, "com.android.systemui"

invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

move-result v1

.line 18
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

move-result-object v0

const-string v2, "tw_quick_panel_icon_flashlight_on"

const-string v3, "drawable"

const-string v5, "com.android.systemui"

invoke-virtual {v0, v2, v3, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

move-result v2

.line 19
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

move-result-object v0

const-string v3, "tw_quick_panel_icon_flashlight_off"

const-string v5, "drawable"

const-string v6, "com.android.systemui"

invoke-virtual {v0, v3, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

move-result v3

move-object v0, p0

move v5, v4

move v6, v4

.line 17
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->initLayout(IIIIII)V

.line 23
iput-object p1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->mContext:Landroid/content/Context;

.line 24
invoke-virtual {p0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->setListener(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton$Listener;)V

.line 25
return-void
.end method

# virtual methods
.method public deinit()V
.locals 0

.prologue
.line 27
return-void
.end method

.method public init()V
.locals 1

.prologue
.line 30
const/4 v0, 0x2

invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->setActivateStatus(I)V

.line 31
return-void
.end method

.method public onClick(Z)V
.locals 5
.parameter "paramBoolean"

.prologue
.line 34
const/4 v2, 0x0

.line 35
.local v2, localIntent:Landroid/content/Intent;
const/4 v1, 0x0

.line 37
.local v1, bc:Ljava/lang/String;
const/4 v0, 0x2

.line 39
.local v0, activateStatus:I
iget v3, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->mFlashlight:I

add-int/lit8 v3, v3, 0x1

iput v3, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->mFlashlight:I

.line 41
iget v3, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->mFlashlight:I

rem-int/lit8 v3, v3, 0x2

iput v3, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->mFlashlight:I

.line 43
iget v3, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->mFlashlight:I

const/4 v4, 0x1

if-ne v3, v4, :cond_0

.line 44
const-string v1, "com.sec.samsung.torchwidget.torch_on_3"

.line 45
const/4 v0, 0x1

.line 50
:goto_0
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->setActivateStatus(I)V

.line 52
new-instance v2, Landroid/content/Intent;

.end local v2 #localIntent:Landroid/content/Intent;
invoke-direct {v2, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

.line 54
.restart local v2 #localIntent:Landroid/content/Intent;
iget-object v3, p0, Lcom/android/systemui/statusbar/policy/quicksetting/FlashlightQuickSettingButton;->mContext:Landroid/content/Context;

invoke-virtual {v3, v2}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V

.line 55
return-void

.line 47
:cond_0
const-string v1, "com.sec.samsung.torchwidget.torch_off"

goto :goto_0
.end method

.method public onLongClick()V
.locals 0

.prologue
.line 57
return-void
.end method

I am compiling for Stock Deodexed i747 4.4.2 NE4

Any help getting this to compile would be greatly appreciated-