Skip to content

Instantly share code, notes, and snippets.

@codewithpassion
Created December 29, 2016 12:13
Show Gist options
  • Save codewithpassion/a480fde6a77de057c495f0db97e18d21 to your computer and use it in GitHub Desktop.
Save codewithpassion/a480fde6a77de057c495f0db97e18d21 to your computer and use it in GitHub Desktop.
.method public static getAgent(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;
.locals 7
.param p0, "ctx" # Landroid/content/Context;
.param p1, "prefix" # Ljava/lang/String;
.prologue
.line 53
new-instance v1, Ljava/lang/StringBuffer;
invoke-direct {v1}, Ljava/lang/StringBuffer;-><init>()V
.line 54
.local v1, "stringBuffer":Ljava/lang/StringBuffer;
invoke-virtual {v1, p1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;
.line 56
const/4 v0, 0x0
#.line 57
#.local v0, "addPostfix":Ljava/lang/String;
#if-eqz p0, :cond_2
#.line 58
#const-string/jumbo v5, "phone"
#invoke-virtual {p0, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
#move-result-object v2
#check-cast v2, Landroid/telephony/TelephonyManager;
#.line 59
#.local v2, "telephonyManager":Landroid/telephony/TelephonyManager;
#invoke-virtual {v2}, Landroid/telephony/TelephonyManager;->getSimState()I
#move-result v5
#const/4 v6, 0x1
#if-eq v5, v6, :cond_0
#.line 60
#invoke-virtual {v2}, Landroid/telephony/TelephonyManager;->getLine1Number()Ljava/lang/String;
#move-result-object v0
#.line 63
#:cond_0
#if-eqz v0, :cond_1
#invoke-virtual {v0}, Ljava/lang/String;->length()I
#move-result v5
#if-nez v5, :cond_2
#.line 64
#:cond_1
#const-string/jumbo v5, "wifi"
#invoke-virtual {p0, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
#move-result-object v4
#check-cast v4, Landroid/net/wifi/WifiManager;
#.line 65
#.local v4, "wifiManager":Landroid/net/wifi/WifiManager;
#invoke-virtual {v4}, Landroid/net/wifi/WifiManager;->getConnectionInfo()Landroid/net/wifi/WifiInfo;
#move-result-object v3
#.line 66
#.local v3, "wifiInfo":Landroid/net/wifi/WifiInfo;
#if-eqz v3, :cond_2
#.line 67
#invoke-virtual {v3}, Landroid/net/wifi/WifiInfo;->getMacAddress()Ljava/lang/String;
#move-result-object v5
#invoke-virtual {v5}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;
#move-result-object v0
#.line 72
#.end local v2 # "telephonyManager":Landroid/telephony/TelephonyManager;
#.end local v3 # "wifiInfo":Landroid/net/wifi/WifiInfo;
#.end local v4 # "wifiManager":Landroid/net/wifi/WifiManager;
#:cond_2
#if-eqz v0, :cond_3
#invoke-virtual {v0}, Ljava/lang/String;->length()I
#move-result v5
#if-nez v5, :cond_4
#.line 73
#:cond_3
#const-string/jumbo v0, "UNKNOWN"
invoke-static {}, Lgetmac;->getMacAddr()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Liglogger;->d(Ljava/lang/String;)I
#.line 76
#:cond_4
invoke-virtual {v1, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;
.line 77
invoke-virtual {v1}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;
move-result-object v5
return-object v5
.end method
.method public static getBaseName(Ljava/lang/String;)Ljava/lang/String;
.locals 1
.param p0, "url" # Ljava/lang/String;
.prologue
.line 331
invoke-static {p0}, Lorg/apache/commons/io/FilenameUtils;->getBaseName(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
return-object v0
.end method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment