[General Questions and Answers] slyths:
As the titles implies, i'd be glad to know if there is a way to fake or change the screen size of the optimus one...

I'm not talking about DPI but the aspect ratio... I want to basically let an application think that my screen is an 800x480 or more.

I have tried by decompiling the apk and tweaking with some codes, but i'm no java expert so i've decided to change my approach to this issue.

By searching around i found out that this apk directly reads the screen size from the "DeviceInfoAndroid,smali" which i assume takes the code directly from the dalvik.

Thanks in advance

This is the DeviceInfoAndroid.smali

.class public Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;
.super Ljava/lang/Object;

# static fields
.field static a:Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;

# instance fields
.field b:J

.field c:Landroid/net/wifi/WifiManager;

.field d:Landroid/telephony/TelephonyManager;

.field e:Landroid/net/ConnectivityManager;

.field f:Landroid/content/pm/PackageManager;

.field g:Landroid/view/WindowManager;

.field h:Landroid/app/ActivityManager;

# direct methods
.method public constructor <init>()V
.locals 2

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

sput-object p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->a:Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;

invoke-direct {p0}, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->createCPPFacade()J

move-result-wide v0

iput-wide v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->b:J

invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;

move-result-object v0

const-string v1, "wifi"

invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Landroid/net/wifi/WifiManager;

iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->c:Landroid/net/wifi/WifiManager;

invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;

move-result-object v0

const-string v1, "phone"

invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Landroid/telephony/TelephonyManager;

iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;

invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;

move-result-object v0

const-string v1, "connectivity"

invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Landroid/net/ConnectivityManager;

iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->e:Landroid/net/ConnectivityManager;

invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;

move-result-object v0

invoke-virtual {v0}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getPackageManager()Landroid/content/pm/PackageManager;

move-result-object v0

iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->f:Landroid/content/pm/PackageManager;

invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;

move-result-object v0

const-string v1, "window"

invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Landroid/view/WindowManager;

iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->g:Landroid/view/WindowManager;

invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;

move-result-object v0

const-string v1, "activity"

invoke-virtual {v0, v1}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Landroid/app/ActivityManager;

iput-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->h:Landroid/app/ActivityManager;

return-void
.end method

.method private _areVoiceCallsSupported()Z
.locals 3

const/4 v0, 0x0

:try_start_0
invoke-virtual {p0}, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->_isLargeScreen()Z

move-result v1

if-nez v1, :cond_0

iget-object v1, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;

invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getPhoneType()I

move-result v1

if-eqz v1, :cond_0

iget-object v1, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;

invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getPhoneType()I
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

move-result v1

const/4 v2, 0x3

if-eq v1, v2, :cond_0

const/4 v0, 0x1

:cond_0
:goto_0
return v0

:catch_0
move-exception v1

goto :goto_0
.end method

.method private _getCPUInfo()Ljava/lang/String;
.locals 1

const-string v0, "ARM"

return-object v0
.end method

.method private _getCurrentNetworkConnectionType()Ljava/lang/String;
.locals 2

iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->e:Landroid/net/ConnectivityManager;

const/4 v1, 0x1

invoke-virtual {v0, v1}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;

move-result-object v0

invoke-virtual {v0}, Landroid/net/NetworkInfo;->isConnected()Z

move-result v0

if-eqz v0, :cond_0

const-string v0, "WiFi"

:goto_0
return-object v0

:cond_0
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->e:Landroid/net/ConnectivityManager;

const/4 v1, 0x0

invoke-virtual {v0, v1}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;

move-result-object v0

invoke-virtual {v0}, Landroid/net/NetworkInfo;->isConnected()Z

move-result v0

if-eqz v0, :cond_1

const-string v0, "Cellular"

goto :goto_0

:cond_1
const-string v0, "UNKNOWN"

goto :goto_0
.end method

.method private _getMACAddress()Ljava/lang/String;
.locals 1

iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->c:Landroid/net/wifi/WifiManager;

if-eqz v0, :cond_1

iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->c:Landroid/net/wifi/WifiManager;

invoke-virtual {v0}, Landroid/net/wifi/WifiManager;->getConnectionInfo()Landroid/net/wifi/WifiInfo;

move-result-object v0

invoke-virtual {v0}, Landroid/net/wifi/WifiInfo;->getMacAddress()Ljava/lang/String;

move-result-object v0

if-eqz v0, :cond_0

:goto_0
return-object v0

:cond_0
const-string v0, ""

goto :goto_0

:cond_1
const-string v0, ""

goto :goto_0
.end method

.method private _getMaxAppMemory()J
.locals 2

invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;

move-result-object v0

invoke-virtual {v0}, Ljava/lang/Runtime;->maxMemory()J

move-result-wide v0

return-wide v0
.end method

.method private _getMemoryInfo()J
.locals 2

new-instance v0, Landroid/app/ActivityManager$MemoryInfo;

invoke-direct {v0}, Landroid/app/ActivityManager$MemoryInfo;-><init>()V

iget-object v1, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->h:Landroid/app/ActivityManager;

invoke-virtual {v1, v0}, Landroid/app/ActivityManager;->getMemoryInfo(Landroid/app/ActivityManager$MemoryInfo;)V

iget-wide v0, v0, Landroid/app/ActivityManager$MemoryInfo;->availMem:J

return-wide v0
.end method

.method private _getNetworkCarrierName()Ljava/lang/String;
.locals 2

:try_start_0
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;

invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getSimState()I

move-result v0

const/4 v1, 0x5

if-ne v0, v1, :cond_0

iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;

invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getSimOperatorName()Ljava/lang/String;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

move-result-object v0

:goto_0
return-object v0

:catch_0
move-exception v0

:cond_0
const-string v0, "UNKNOWN"

goto :goto_0
.end method

.method private _getScreenSize()D
.locals 5

invoke-virtual {p0}, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->_getScreenResolution()[I

move-result-object v0

new-instance v1, Landroid/util/DisplayMetrics;

invoke-direct {v1}, Landroid/util/DisplayMetrics;-><init>()V

iget-object v2, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->g:Landroid/view/WindowManager;

invoke-interface {v2}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

move-result-object v2

invoke-virtual {v2, v1}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V

const/4 v2, 0x0

aget v2, v0, v2

int-to-float v2, v2

iget v3, v1, Landroid/util/DisplayMetrics;->xdpi:F

div-float/2addr v2, v3

float-to-double v2, v2

const/4 v4, 0x1

aget v0, v0, v4

int-to-float v0, v0

iget v1, v1, Landroid/util/DisplayMetrics;->ydpi:F

div-float/2addr v0, v1

float-to-double v0, v0

mul-double/2addr v2, v2

mul-double/2addr v0, v0

add-double/2addr v0, v2

invoke-static {v0, v1}, Ljava/lang/Math;->sqrt(D)D

move-result-wide v0

const-wide/high16 v2, 0x4024

mul-double/2addr v0, v2

double-to-int v0, v0

int-to-float v0, v0

const/high16 v1, 0x4120

div-float/2addr v0, v1

float-to-double v0, v0

return-wide v0
.end method

.method private _getTotalStorage()J
.locals 2

const-wide/16 v0, 0x0

return-wide v0
.end method

.method private _isInstalledInInternalMemory()Z
.locals 4

const/4 v0, 0x0

:try_start_0
iget-object v1, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->f:Landroid/content/pm/PackageManager;

invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;

move-result-object v2

invoke-virtual {v2}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getPackageName()Ljava/lang/String;

move-result-object v2

const/4 v3, 0x0

invoke-virtual {v1, v2, v3}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;

move-result-object v1

iget-object v1, v1, Landroid/content/pm/PackageInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

iget v1, v1, Landroid/content/pm/ApplicationInfo;->flags:I
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

const/high16 v2, 0x4

and-int/2addr v1, v2

if-lez v1, :cond_0

const/4 v0, 0x1

:cond_0
:goto_0
return v0

:catch_0
move-exception v1

goto :goto_0
.end method

.method private _isRoaming()Z
.locals 1

:try_start_0
iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->d:Landroid/telephony/TelephonyManager;

invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->isNetworkRoaming()Z
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

move-result v0

:goto_0
return v0

:catch_0
move-exception v0

const/4 v0, 0x0

goto :goto_0
.end method

.method public static a()Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;
.locals 1

sget-object v0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->a:Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;

return-object v0
.end method

.method private native createCPPFacade()J
.end method

# virtual methods
.method public _getAndroidID()Ljava/lang/String;
.locals 2

invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;

move-result-object v0

invoke-virtual {v0}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v0

const-string v1, "android_id"

invoke-static {v0, v1}, Landroid/provider/Settings$Secure;->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;

move-result-object v0

if-eqz v0, :cond_0

:goto_0
return-object v0

:cond_0
const-string v0, ""

goto :goto_0
.end method

.method public _getMake()Ljava/lang/String;
.locals 1

sget-object v0, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;

return-object v0
.end method

.method public _getModel()Ljava/lang/String;
.locals 2

new-instance v0, Ljava/lang/StringBuilder;

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

sget-object v1, Landroid/os/Build;->MODEL:Ljava/lang/String;

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

move-result-object v0

const-string v1, " ("

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

move-result-object v0

sget-object v1, Landroid/os/Build;->PRODUCT:Ljava/lang/String;

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

move-result-object v0

const-string v1, ")"

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

move-result-object v0

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

move-result-object v0

return-object v0
.end method

.method public _getOSVersion()Ljava/lang/String;
.locals 1

sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

invoke-static {v0}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

move-result-object v0

return-object v0
.end method

.method public _getScreenResolution()[I
.locals 7

const/4 v2, 0x0

sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

const/16 v1, 0xd

if-lt v0, v1, :cond_2

iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->g:Landroid/view/WindowManager;

invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

move-result-object v3

:try_start_0
const-class v0, Landroid/view/Display;

const-string v1, "getRawWidth"

const/4 v4, 0x0

new-array v4, v4, [Ljava/lang/Class;

invoke-virtual {v0, v1, v4}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

move-result-object v4

const-class v0, Landroid/view/Display;

const-string v1, "getRawHeight"

const/4 v5, 0x0

new-array v5, v5, [Ljava/lang/Class;

invoke-virtual {v0, v1, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

move-result-object v0

const/4 v1, 0x0

new-array v1, v1, [Ljava/lang/Object;

invoke-virtual {v0, v3, v1}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Ljava/lang/Integer;

invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

move-result v1

const/4 v0, 0x0

new-array v0, v0, [Ljava/lang/Object;

invoke-virtual {v4, v3, v0}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Ljava/lang/Integer;

invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

move-result v0

if-le v1, v0, :cond_0

move v3, v1

:goto_0
if-le v1, v0, :cond_1

:goto_1
move v1, v3

:goto_2
const/4 v3, 0x2

new-array v3, v3, [I

aput v1, v3, v2

const/4 v1, 0x1

aput v0, v3, v1

return-object v3

:cond_0
move v3, v0

goto :goto_0

:cond_1
move v0, v1

goto :goto_1

:catch_0
move-exception v0

move v0, v2

move v1, v2

goto :goto_2

:cond_2
new-instance v1, Landroid/util/DisplayMetrics;

invoke-direct {v1}, Landroid/util/DisplayMetrics;-><init>()V

iget-object v0, p0, Lcom/pyrsoftware/pokerstars/DeviceInfoAndroid;->g:Landroid/view/WindowManager;

invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

move-result-object v0

invoke-virtual {v0, v1}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V

iget v0, v1, Landroid/util/DisplayMetrics;->widthPixels:I

iget v3, v1, Landroid/util/DisplayMetrics;->heightPixels:I

if-le v0, v3, :cond_3

iget v0, v1, Landroid/util/DisplayMetrics;->widthPixels:I

:goto_3
iget v3, v1, Landroid/util/DisplayMetrics;->widthPixels:I

iget v4, v1, Landroid/util/DisplayMetrics;->heightPixels:I

if-le v3, v4, :cond_4

iget v1, v1, Landroid/util/DisplayMetrics;->heightPixels:I

:goto_4
move v6, v1

move v1, v0

move v0, v6

goto :goto_2

:cond_3
iget v0, v1, Landroid/util/DisplayMetrics;->heightPixels:I

goto :goto_3

:cond_4
iget v1, v1, Landroid/util/DisplayMetrics;->widthPixels:I

goto :goto_4
.end method

.method public _isLargeScreen()Z
.locals 2

invoke-static {}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->a()Lcom/pyrsoftware/pokerstars/PokerStarsApp;

move-result-object v0

invoke-virtual {v0}, Lcom/pyrsoftware/pokerstars/PokerStarsApp;->getResources()Landroid/content/res/Resources;

move-result-object v0

invoke-virtual {v0}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;

move-result-object v0

iget v0, v0, Landroid/content/res/Configuration;->screenLayout:I

and-int/lit8 v0, v0, 0xf

const/4 v1, 0x4

if-lt v0, v1, :cond_0

const/4 v0, 0x1

:goto_0
return v0

:cond_0
const/4 v0, 0x0

goto :goto_0
.end method