[Nook Touch Android Development] tehriddler:
Can this be done on 1.1.2 firmware?

(I know basic MIPS (arithmetic, recursion) from a Computer Science course.)

Bytecode from your 1.1.0 framework.jar framework\classes\com\android\internal\app\ShutdownThread.smali

.method private static setShutdownImage(Landroid/widget/ImageView;I)V
.registers 3
.parameter "imageView"
.parameter "imageResource"

.prologue
.line 23
const-string v0, "screensavers/shutdown.png"

invoke-static {p0, p1, v0}, Lcom/android/internal/app/ShutdownThread;->setShutdownImageImpl(Landroid/widget/ImageView;ILjava/lang/String;)V

.line 24
return-void
.end method

.method private static setShutdownImageImpl(Landroid/widget/ImageView;ILjava/lang/String;)V
.registers 9
.parameter "imageView"
.parameter "imageResource"
.parameter "imageName"

.prologue
.line 32
:try_start_0
new-instance v2, Ljava/io/File;

new-instance v3, Ljava/lang/StringBuilder;

const-string v4, "/media/"

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

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

move-result-object v3

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

move-result-object v3

invoke-direct {v2, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V

.line 33
.local v2, imageFile:Ljava/io/File;
invoke-virtual {v2}, Ljava/io/File;->exists()Z

move-result v3

if-eqz v3, :cond_7a

.line 34
sget-object v3, Ljava/lang/System;->out:Ljava/io/PrintStream;

new-instance v4, Ljava/lang/StringBuilder;

const-string v5, "using user image ["

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

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

move-result-object v4

const-string v5, "] as shutdown image.."

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

move-result-object v4

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

move-result-object v4

invoke-virtual {v3, v4}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

.line 35
invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

move-result-object v3

invoke-static {v3}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;)Landroid/graphics/Bitmap;

move-result-object v1

.line 36
.local v1, imageBitmap:Landroid/graphics/Bitmap;
sget-object v3, Ljava/lang/System;->out:Ljava/io/PrintStream;

new-instance v4, Ljava/lang/StringBuilder;

const-string v5, "shutdown image size: "

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

invoke-virtual {v1}, Landroid/graphics/Bitmap;->getWidth()I

move-result v5

invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

move-result-object v4

const-string v5, "x"

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

move-result-object v4

invoke-virtual {v1}, Landroid/graphics/Bitmap;->getHeight()I

move-result v5

invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

move-result-object v4

const-string v5, " ["

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

move-result-object v4

invoke-virtual {v1}, Landroid/graphics/Bitmap;->getConfig()Landroid/graphics/Bitmap$Config;

move-result-object v5

invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

move-result-object v4

const-string v5, "]"

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

move-result-object v4

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

move-result-object v4

invoke-virtual {v3, v4}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

.line 37
invoke-virtual {p0, v1}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

.line 47
.end local v1 #imageBitmap:Landroid/graphics/Bitmap;
.end local v2 #imageFile:Ljava/io/File;
:goto_79
return-void

.line 39
.restart local v2 #imageFile:Ljava/io/File;
:cond_7a
sget-object v3, Ljava/lang/System;->out:Ljava/io/PrintStream;

new-instance v4, Ljava/lang/StringBuilder;

const-string v5, "no custom shutdown image ["

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

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

move-result-object v4

const-string v5, "] found, using standard image.."

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

move-result-object v4

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

move-result-object v4

invoke-virtual {v3, v4}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

.line 40
invoke-virtual {p0, p1}, Landroid/widget/ImageView;->setImageResource(I)V
:try_end_97
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_97} :catch_98

goto :goto_79

.line 42
.end local v2 #imageFile:Ljava/io/File;
:catch_98
move-exception v3

move-object v0, v3

.line 43
.local v0, e:Ljava/lang/Exception;
sget-object v3, Ljava/lang/System;->out:Ljava/io/PrintStream;

new-instance v4, Ljava/lang/StringBuilder;

const-string v5, "error setting custom shutdown image ["

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

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

move-result-object v4

const-string v5, "] .."

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

move-result-object v4

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

move-result-object v4

invoke-virtual {v3, v4}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

.line 44
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

.line 45
invoke-virtual {p0, p1}, Landroid/widget/ImageView;->setImageResource(I)V

goto :goto_79
.end method

.line 178
.local v0, lp:Landroid/view/WindowManager$LayoutParams;
new-instance p1, Landroid/widget/ImageView;

invoke-direct {p1, p0}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

.line 179
.local p1, iView:Landroid/widget/ImageView;
if-eqz p3, :cond_a6

.line 180
const p3, 0x10800ee

invoke-static {p1, p3}, Lcom/android/internal/app/ShutdownThread;->setShutdownLowBatteryImage(Landroid/widget/ImageView;I)V

means

public void setShutdownImageIimage(imageView) {

setShutdownImageImpl(imageView, imageResource, "screensavers/shutdown.png");

}

The rest is building the string for the file path, and reading the file from the path as a bitmap.

Correct?

Is this safe to be added to the 1.1.2 version? There's some other differences in the 1.1.2 ShutdownThread.smali. Will it brick the Nook?