[GUIDE][Dev-Only] OMC/ODM manipulation tips and tricks - Samsung Galaxy S9 Guides, News, & Discussion

Please take some time to read patiently everything. As always i`m not responsable for any damage that you do to your device.
Hello guys, i want to share some info with you. As recognised devs say from time to time, we just need to think outside the box, everything is there for us to read/learn. I`m gonna debate in this post 3 issues that i had and the workaround for them:
1. OMC code changing wants to wipe data..
But who will agree to that without a fair fight? I investigated the frameworks and found out that samsung sets country code to use from the mcc/mnc of the sim card inserted. Inside efs/imei should be a country code file named mps_code.dat, which it contains some code. Usually at the first boot framework is creating a new file in there named omcnw_code.dat containing sim card code.. After booting, it compares both files mps_code.dat and omcnw_code.dat and if the string inside doesn`t match, it prompts for a reboot to apply the country or reboot to factory reset to use new sim. Now, if you don`t have stock recovery to securely perform the wipe, you`ll probably end in bootloop. First time i ended in bootloop because of twrp, second time i mounted efs from twrp and manually changed the mps_code.dat according to sim country. Booted up and all just was ok, without the wipe that samsung added.
Therefore i tried to make a method inside SystemServer.smali (services.jar/smali/com/android/servers) that loads at boot, looks for the omcnw and if it`s found, it will delete mps_code.dat and rename omcnw_code.dat to mps_code.dat, so you won`t feel the change but also no more wipe prompt.
Under the # direct methods, anywhere after .method public constructor <init>()V i added this method:
Code:
.method private static deleteOmcnw()V
.locals 5
const-string/jumbo v2, "/efs/imei/omcnw_code.dat"
const-string/jumbo v3, "/efs/imei/mps_code.dat"
new-instance v0, Ljava/io/File;
invoke-direct {v0, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V
if-eqz v0, :cond_0
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v1
if-eqz v1, :cond_0
new-instance v1, Ljava/io/File;
invoke-direct {v1, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V
if-eqz v1, :cond_0
invoke-virtual {v1}, Ljava/io/File;->exists()Z
move-result v4
if-eqz v4, :cond_0
invoke-virtual {v1}, Ljava/io/File;->delete()Z
invoke-virtual {v0, v1}, Ljava/io/File;->renameTo(Ljava/io/File;)Z
:goto_0
return-void
:cond_0
const-string/jumbo v0, [COLOR="Blue"]"omcnw"[/COLOR]
const-string/jumbo v1, [COLOR="Blue"]"Some log lines, blah blah blah"[/COLOR]
invoke-static {v0, v1}, Lcom/android/server/utils/sysfwutil/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_0
.end method
And ofc now we need an invoke for this method.
I added it in .method private run()V after loading libandroid_servers
Code:
invoke-static {v0}, Landroid/os/Process;->setCanSelfBackground(Z)V
invoke-static {}, Landroid/os/Looper;->prepareMainLooper()V
const-string/jumbo v0, "android_servers"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
[COLOR="Blue"]invoke-static {}, Lcom/android/server/SystemServer;->deleteOmcnw()V[/COLOR]
invoke-direct {p0}, Lcom/android/server/SystemServer;->performPendingShutdown()V
invoke-direct {p0}, Lcom/android/server/SystemServer;->createSystemContext()V
new-instance v0, Lcom/android/server/SystemServiceManager;
After this, no more prompt about wipe to use the sim.
2. OMC is a pain when it comes to add features..
I wanted to add csc features but either omc was encrypted (which has a solution now), or either way too many xmls to edit.. Investigated a bit SemCscFeature.smali (framework.jar/smali_classes3/samsung/android/feature) and gave me an idea that actually worked.
The point was to duplicate loadNetworkFeatureFile method, rename it, point it to certain location where we will add a single xml file containing all the features we want and add the invoke right after loadNetworkFeatureFile invoke. By doing this, doesn`t matter what csc is loaded, the system will load our custom xml too. Less time to add features, cleaner way to load, and it doesn`t even need to decrypt omc. And by using a duplicate of loadNetworkFeatureFile we can encrypt our xml too .
I`m gonna post my methods too, might be a bit sloppy code, i lost myself inside of it, but as long as it does what it`s supposed, doesn`t matter anymore :laugh:
Gonna hide the method as it is a long one
Code:
.method private loadHadesFeatureFile(ZLjava/lang/String;)V
.locals 24
const/16 v16, 0x0
const/4 v12, 0x0
const/4 v14, 0x0
const/4 v7, -0x1
const/4 v2, 0x0
const/4 v3, 0x0
const/4 v10, 0x0
[COLOR="Blue"]const-string/jumbo v10, "/system/etc" # custom xml path here[/COLOR]
:try_start_0
new-instance v11, Ljava/io/File;
new-instance v20, Ljava/lang/StringBuilder;
invoke-direct/range {v20 .. v20}, Ljava/lang/StringBuilder;-><init>()V
move-object/from16 v0, v20
invoke-virtual {v0, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
[COLOR="Blue"]const-string/jumbo v21, "/hades.xml" # custom xml name here[/COLOR]
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
invoke-virtual/range {v20 .. v20}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v20
move-object/from16 v0, v20
invoke-direct {v11, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
invoke-virtual {v11}, Ljava/io/File;->exists()Z
move-result v20
if-eqz v20, :cond_0
invoke-virtual {v11}, Ljava/io/File;->length()J
move-result-wide v20
const-wide/16 v22, 0x0
cmp-long v20, v20, v22
if-gtz v20, :cond_1
:cond_0
return-void
:cond_1
invoke-static {}, Lorg/xmlpull/v1/XmlPullParserFactory;->newInstance()Lorg/xmlpull/v1/XmlPullParserFactory;
move-result-object v9
const/16 v20, 0x1
move/from16 v0, v20
invoke-virtual {v9, v0}, Lorg/xmlpull/v1/XmlPullParserFactory;->setNamespaceAware(Z)V
invoke-virtual {v9}, Lorg/xmlpull/v1/XmlPullParserFactory;->newPullParser()Lorg/xmlpull/v1/XmlPullParser;
move-result-object v16
new-instance v13, Ljava/io/FileInputStream;
invoke-direct {v13, v11}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
:try_end_0
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_0 .. :try_end_0} :catch_b
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_d
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_f
.catchall {:try_start_0 .. :try_end_0} :catchall_1
:try_start_1
move-object/from16 v0, p0
invoke-direct {v0, v11}, Lcom/samsung/android/feature/SemCscFeature;->isXmlEncoded(Ljava/io/File;)Z
move-result v20
if-eqz v20, :cond_3
invoke-virtual {v13}, Ljava/io/FileInputStream;->available()I
move-result v18
move/from16 v0, v18
new-array v0, v0, [B
move-object/from16 v19, v0
move-object/from16 v0, v19
invoke-virtual {v13, v0}, Ljava/io/FileInputStream;->read([B)I
invoke-virtual {v13}, Ljava/io/FileInputStream;->close()V
move-object/from16 v0, p0
move-object/from16 v1, v19
invoke-direct {v0, v1}, Lcom/samsung/android/feature/SemCscFeature;->decode([B)[B
move-result-object v17
new-instance v15, Ljava/io/ByteArrayInputStream;
move-object/from16 v0, v17
invoke-direct {v15, v0}, Ljava/io/ByteArrayInputStream;-><init>([B)V
:try_end_1
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_1 .. :try_end_1} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_1 .. :try_end_1} :catch_2
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_5
.catchall {:try_start_1 .. :try_end_1} :catchall_0
const/16 v20, 0x0
:try_start_2
move-object/from16 v0, v16
move-object/from16 v1, v20
invoke-interface {v0, v15, v1}, Lorg/xmlpull/v1/XmlPullParser;->setInput(Ljava/io/InputStream;Ljava/lang/String;)V
:try_end_2
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_2 .. :try_end_2} :catch_c
.catch Ljava/io/FileNotFoundException; {:try_start_2 .. :try_end_2} :catch_e
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_10
.catchall {:try_start_2 .. :try_end_2} :catchall_2
move-object v14, v15
:goto_0
:try_start_3
invoke-interface/range {v16 .. v16}, Lorg/xmlpull/v1/XmlPullParser;->getEventType()I
move-result v7
:goto_1
const/16 v20, 0x1
move/from16 v0, v20
if-eq v7, v0, :cond_c
const/16 v20, 0x2
move/from16 v0, v20
if-ne v7, v0, :cond_6
invoke-interface/range {v16 .. v16}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;
:try_end_3
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_3 .. :try_end_3} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_3 .. :try_end_3} :catch_2
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_5
.catchall {:try_start_3 .. :try_end_3} :catchall_0
move-result-object v2
:cond_2
:goto_2
:try_start_4
invoke-interface/range {v16 .. v16}, Lorg/xmlpull/v1/XmlPullParser;->next()I
:try_end_4
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_7
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_4 .. :try_end_4} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_4 .. :try_end_4} :catch_2
.catchall {:try_start_4 .. :try_end_4} :catchall_0
move-result v7
goto :goto_1
:cond_3
const/16 v20, 0x0
:try_start_5
move-object/from16 v0, v16
move-object/from16 v1, v20
invoke-interface {v0, v13, v1}, Lorg/xmlpull/v1/XmlPullParser;->setInput(Ljava/io/InputStream;Ljava/lang/String;)V
:try_end_5
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_5 .. :try_end_5} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_5 .. :try_end_5} :catch_2
.catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_5
.catchall {:try_start_5 .. :try_end_5} :catchall_0
goto :goto_0
:catch_0
move-exception v6
move-object v12, v13
:goto_3
:try_start_6
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v6}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_1
if-eqz v12, :cond_4
:try_start_7
invoke-virtual {v12}, Ljava/io/FileInputStream;->close()V
const/4 v12, 0x0
:cond_4
if-eqz v14, :cond_5
invoke-virtual {v14}, Ljava/io/ByteArrayInputStream;->close()V
:try_end_7
.catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_9
:goto_4
const/4 v14, 0x0
:cond_5
:goto_5
return-void
:cond_6
const/16 v20, 0x4
move/from16 v0, v20
if-ne v7, v0, :cond_2
:try_start_8
invoke-interface/range {v16 .. v16}, Lorg/xmlpull/v1/XmlPullParser;->getText()Ljava/lang/String;
move-result-object v3
if-eqz v2, :cond_2
if-eqz v3, :cond_2
move-object/from16 v0, p0
iget-object v0, v0, Lcom/samsung/android/feature/SemCscFeature;->mFeatureList:Ljava/util/Hashtable;
move-object/from16 v20, v0
move-object/from16 v0, v20
invoke-virtual {v0, v2}, Ljava/util/Hashtable;->containsKey(Ljava/lang/Object;)Z
:try_end_8
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_8 .. :try_end_8} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_8 .. :try_end_8} :catch_2
.catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_5
.catchall {:try_start_8 .. :try_end_8} :catchall_0
move-result v20
if-eqz v20, :cond_8
:try_start_9
invoke-interface/range {v16 .. v16}, Lorg/xmlpull/v1/XmlPullParser;->next()I
:try_end_9
.catch Ljava/io/IOException; {:try_start_9 .. :try_end_9} :catch_1
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_9 .. :try_end_9} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_9 .. :try_end_9} :catch_2
.catchall {:try_start_9 .. :try_end_9} :catchall_0
move-result v7
goto :goto_1
:catch_1
move-exception v5
:try_start_a
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_a
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_a .. :try_end_a} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_a .. :try_end_a} :catch_2
.catch Ljava/io/IOException; {:try_start_a .. :try_end_a} :catch_5
.catchall {:try_start_a .. :try_end_a} :catchall_0
goto :goto_1
:catch_2
move-exception v4
move-object v12, v13
:goto_6
:try_start_b
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v4}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_b
.catchall {:try_start_b .. :try_end_b} :catchall_1
if-eqz v12, :cond_7
:try_start_c
invoke-virtual {v12}, Ljava/io/FileInputStream;->close()V
const/4 v12, 0x0
:cond_7
if-eqz v14, :cond_5
invoke-virtual {v14}, Ljava/io/ByteArrayInputStream;->close()V
:try_end_c
.catch Ljava/io/IOException; {:try_start_c .. :try_end_c} :catch_3
goto :goto_4
:catch_3
move-exception v5
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_5
:cond_8
:try_start_d
invoke-virtual {v3}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v3
move-object/from16 v0, p0
iget-object v0, v0, Lcom/samsung/android/feature/SemCscFeature;->mFeatureList:Ljava/util/Hashtable;
move-object/from16 v20, v0
move-object/from16 v0, v20
invoke-virtual {v0, v2, v3}, Ljava/util/Hashtable;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
:try_end_d
.catch Ljava/lang/Exception; {:try_start_d .. :try_end_d} :catch_4
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_d .. :try_end_d} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_d .. :try_end_d} :catch_2
.catch Ljava/io/IOException; {:try_start_d .. :try_end_d} :catch_5
.catchall {:try_start_d .. :try_end_d} :catchall_0
goto/16 :goto_2
:catch_4
move-exception v8
:try_start_e
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v8}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_e
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_e .. :try_end_e} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_e .. :try_end_e} :catch_2
.catch Ljava/io/IOException; {:try_start_e .. :try_end_e} :catch_5
.catchall {:try_start_e .. :try_end_e} :catchall_0
goto/16 :goto_2
:catch_5
move-exception v5
move-object v12, v13
:goto_7
:try_start_f
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_f
.catchall {:try_start_f .. :try_end_f} :catchall_1
if-eqz v12, :cond_9
:try_start_10
invoke-virtual {v12}, Ljava/io/FileInputStream;->close()V
const/4 v12, 0x0
:cond_9
if-eqz v14, :cond_5
invoke-virtual {v14}, Ljava/io/ByteArrayInputStream;->close()V
:try_end_10
.catch Ljava/io/IOException; {:try_start_10 .. :try_end_10} :catch_6
goto/16 :goto_4
:catch_6
move-exception v5
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto/16 :goto_5
:catch_7
move-exception v5
:try_start_11
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_11
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_11 .. :try_end_11} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_11 .. :try_end_11} :catch_2
.catch Ljava/io/IOException; {:try_start_11 .. :try_end_11} :catch_5
.catchall {:try_start_11 .. :try_end_11} :catchall_0
goto/16 :goto_1
:catchall_0
move-exception v20
move-object v12, v13
:goto_8
if-eqz v12, :cond_a
:try_start_12
invoke-virtual {v12}, Ljava/io/FileInputStream;->close()V
const/4 v12, 0x0
:cond_a
if-eqz v14, :cond_b
invoke-virtual {v14}, Ljava/io/ByteArrayInputStream;->close()V
:try_end_12
.catch Ljava/io/IOException; {:try_start_12 .. :try_end_12} :catch_a
const/4 v14, 0x0
:cond_b
:goto_9
throw v20
:cond_c
if-eqz v13, :cond_d
:try_start_13
invoke-virtual {v13}, Ljava/io/FileInputStream;->close()V
:try_end_13
.catch Ljava/io/IOException; {:try_start_13 .. :try_end_13} :catch_11
const/4 v12, 0x0
:goto_a
if-eqz v14, :cond_5
:try_start_14
invoke-virtual {v14}, Ljava/io/ByteArrayInputStream;->close()V
:try_end_14
.catch Ljava/io/IOException; {:try_start_14 .. :try_end_14} :catch_8
goto/16 :goto_4
:catch_8
move-exception v5
:goto_b
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto/16 :goto_5
:catch_9
move-exception v5
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto/16 :goto_5
:catch_a
move-exception v5
const-string/jumbo v21, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v22
invoke-static/range {v21 .. v22}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_9
:catchall_1
move-exception v20
goto :goto_8
:catchall_2
move-exception v20
move-object v14, v15
move-object v12, v13
goto :goto_8
:catch_b
move-exception v6
goto/16 :goto_3
:catch_c
move-exception v6
move-object v14, v15
move-object v12, v13
goto/16 :goto_3
:catch_d
move-exception v4
goto/16 :goto_6
:catch_e
move-exception v4
move-object v14, v15
move-object v12, v13
goto/16 :goto_6
:catch_f
move-exception v5
goto/16 :goto_7
:catch_10
move-exception v5
move-object v14, v15
move-object v12, v13
goto/16 :goto_7
:catch_11
move-exception v5
move-object v12, v13
goto :goto_b
:cond_d
move-object v12, v13
goto :goto_a
.end method
And the invoke:
Code:
...
invoke-direct {p0, v2, v4}, Lcom/samsung/android/feature/SemCscFeature;->loadFeatureFile(ZLjava/lang/String;)Z
move-result v5
if-eqz v5, :cond_1
invoke-direct {p0, v2, v3}, Lcom/samsung/android/feature/SemCscFeature;->loadNetworkFeatureFile(ZLjava/lang/String;)V
[COLOR="Blue"]invoke-direct {p0, v2, v3}, Lcom/samsung/android/feature/SemCscFeature;->loadHadesFeatureFile(ZLjava/lang/String;)V[/COLOR]
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
...
The code can be simplified, i didn`t bothered to do that, feel free to manipulate it in which way you want.
3. Use ODM instead of OMC/CSC in Oreo
From S9 Samsung introduced a new kind of omc, ODM, which needs its own partition and needs to be loaded from fstab/dts. We can add it to non ODM devices with a pretty simple and clean workaround.
Inside ramdisk, in init.rc file (all the devices should have that), i found this:
Code:
# Link /vendor to /system/vendor for devices without a vendor partition.
symlink /system/vendor /vendor
Following this we can make it work just like this:
Code:
# Link /vendor to /system/vendor for devices without a vendor partition.
symlink /system/vendor /vendor
[color="Blue"] symlink /system/odm /odm[/color]
By unpacking odm partition content inside a folder from system and creating the symlink from above at boot, rom will load odm as it has the partition.
Hope these tips will help someone in the future of custom roms with more features.
I will attach to this thread my modified smalis from one of my roms, i tried these methods on 7.1.1, but the idea is the same for oreo too, code might be slighlty different.
All the best :fingers-crossed:

Thank U very much for ur efforts @corcicanu
Another simple and well explain workaround for all those for whom work or enjoy their hobbies. Keep on, great useful stuff!

Good job corsi, always been so creative
Don't stop buddy ?

3. Use ODM instead of OMC/CSC in Oreo
From S9 Samsung introduced a new kind of omc, ODM, which needs its own partition and needs to be loaded from fstab/dts. We can add it to non ODM devices with a pretty simple and clean workaround.
Inside ramdisk, in init.rc file (all the devices should have that), i found this:
Code:
# Link /vendor to /system/vendor for devices without a vendor partition.
symlink /system/vendor /vendor
Following this we can make it work just like this:
Code:
# Link /vendor to /system/vendor for devices without a vendor partition.
symlink /system/vendor /vendor
[color="Blue"] symlink /system/odm /odm[/color]
By unpacking odm partition content inside a folder from system and creating the symlink from above at boot, rom will load odm as it has the partition.
Updated first post as well :fingers-crossed:

corsicanu said:
Please take some time to read patiently everything. As always i`m not responsable for any damage that you do to your device.
Hello guys, i want to share some info with you. As recognised devs say from time to time, we just need to think outside the box, everything is there for us to read/learn. I`m gonna debate in this post 3 issues that i had and the workaround for them:
1. OMC code changing wants to wipe data..
But who will agree to that without a fair fight? I investigated the frameworks and found out that samsung sets country code to use from the mcc/mnc of the sim card inserted. Inside efs/imei should be a country code file named mps_code.dat, which it contains some code. Usually at the first boot framework is creating a new file in there named omcnw_code.dat containing sim card code.. After booting, it compares both files mps_code.dat and omcnw_code.dat and if the string inside doesn`t match, it prompts for a reboot to apply the country or reboot to factory reset to use new sim. Now, if you don`t have stock recovery to securely perform the wipe, you`ll probably end in bootloop. First time i ended in bootloop because of twrp, second time i mounted efs from twrp and manually changed the mps_code.dat according to sim country. Booted up and all just was ok, without the wipe that samsung added.
Therefore i tried to make a method inside SystemServer.smali (services.jar/smali/com/android/servers) that loads at boot, looks for the omcnw and if it`s found, it will delete mps_code.dat and rename omcnw_code.dat to mps_code.dat, so you won`t feel the change but also no more wipe prompt.
Under the # direct methods, anywhere after .method public constructor <init>()V i added this method:
Code:
.method private static deleteOmcnw()V
.locals 5
const-string/jumbo v2, "/efs/imei/omcnw_code.dat"
const-string/jumbo v3, "/efs/imei/mps_code.dat"
new-instance v0, Ljava/io/File;
invoke-direct {v0, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V
if-eqz v0, :cond_0
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v1
if-eqz v1, :cond_0
new-instance v1, Ljava/io/File;
invoke-direct {v1, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V
if-eqz v1, :cond_0
invoke-virtual {v1}, Ljava/io/File;->exists()Z
move-result v4
if-eqz v4, :cond_0
invoke-virtual {v1}, Ljava/io/File;->delete()Z
invoke-virtual {v0, v1}, Ljava/io/File;->renameTo(Ljava/io/File;)Z
:goto_0
return-void
:cond_0
const-string/jumbo v0, [COLOR="Blue"]"omcnw"[/COLOR]
const-string/jumbo v1, [COLOR="Blue"]"Some log lines, blah blah blah"[/COLOR]
invoke-static {v0, v1}, Lcom/android/server/utils/sysfwutil/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_0
.end method
And ofc now we need an invoke for this method.
I added it in .method private run()V after loading libandroid_servers
Code:
invoke-static {v0}, Landroid/os/Process;->setCanSelfBackground(Z)V
invoke-static {}, Landroid/os/Looper;->prepareMainLooper()V
const-string/jumbo v0, "android_servers"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
[COLOR="Blue"]invoke-static {}, Lcom/android/server/SystemServer;->deleteOmcnw()V[/COLOR]
invoke-direct {p0}, Lcom/android/server/SystemServer;->performPendingShutdown()V
invoke-direct {p0}, Lcom/android/server/SystemServer;->createSystemContext()V
new-instance v0, Lcom/android/server/SystemServiceManager;
After this, no more prompt about wipe to use the sim.
2. OMC is a pain when it comes to add features..
I wanted to add csc features but either omc was encrypted (which has a solution now), or either way too many xmls to edit.. Investigated a bit SemCscFeature.smali (framework.jar/smali_classes3/samsung/android/feature) and gave me an idea that actually worked.
The point was to duplicate loadNetworkFeatureFile method, rename it, point it to certain location where we will add a single xml file containing all the features we want and add the invoke right after loadNetworkFeatureFile invoke. By doing this, doesn`t matter what csc is loaded, the system will load our custom xml too. Less time to add features, cleaner way to load, and it doesn`t even need to decrypt omc. And by using a duplicate of loadNetworkFeatureFile we can encrypt our xml too .
I`m gonna post my methods too, might be a bit sloppy code, i lost myself inside of it, but as long as it does what it`s supposed, doesn`t matter anymore :laugh:
Gonna hide the method as it is a long one
Code:
.method private loadHadesFeatureFile(ZLjava/lang/String;)V
.locals 24
const/16 v16, 0x0
const/4 v12, 0x0
const/4 v14, 0x0
const/4 v7, -0x1
const/4 v2, 0x0
const/4 v3, 0x0
const/4 v10, 0x0
[COLOR="Blue"]const-string/jumbo v10, "/system/etc" # custom xml path here[/COLOR]
:try_start_0
new-instance v11, Ljava/io/File;
new-instance v20, Ljava/lang/StringBuilder;
invoke-direct/range {v20 .. v20}, Ljava/lang/StringBuilder;-><init>()V
move-object/from16 v0, v20
invoke-virtual {v0, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
[COLOR="Blue"]const-string/jumbo v21, "/hades.xml" # custom xml name here[/COLOR]
invoke-virtual/range {v20 .. v21}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v20
invoke-virtual/range {v20 .. v20}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v20
move-object/from16 v0, v20
invoke-direct {v11, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
invoke-virtual {v11}, Ljava/io/File;->exists()Z
move-result v20
if-eqz v20, :cond_0
invoke-virtual {v11}, Ljava/io/File;->length()J
move-result-wide v20
const-wide/16 v22, 0x0
cmp-long v20, v20, v22
if-gtz v20, :cond_1
:cond_0
return-void
:cond_1
invoke-static {}, Lorg/xmlpull/v1/XmlPullParserFactory;->newInstance()Lorg/xmlpull/v1/XmlPullParserFactory;
move-result-object v9
const/16 v20, 0x1
move/from16 v0, v20
invoke-virtual {v9, v0}, Lorg/xmlpull/v1/XmlPullParserFactory;->setNamespaceAware(Z)V
invoke-virtual {v9}, Lorg/xmlpull/v1/XmlPullParserFactory;->newPullParser()Lorg/xmlpull/v1/XmlPullParser;
move-result-object v16
new-instance v13, Ljava/io/FileInputStream;
invoke-direct {v13, v11}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
:try_end_0
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_0 .. :try_end_0} :catch_b
.catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_d
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_f
.catchall {:try_start_0 .. :try_end_0} :catchall_1
:try_start_1
move-object/from16 v0, p0
invoke-direct {v0, v11}, Lcom/samsung/android/feature/SemCscFeature;->isXmlEncoded(Ljava/io/File;)Z
move-result v20
if-eqz v20, :cond_3
invoke-virtual {v13}, Ljava/io/FileInputStream;->available()I
move-result v18
move/from16 v0, v18
new-array v0, v0, [B
move-object/from16 v19, v0
move-object/from16 v0, v19
invoke-virtual {v13, v0}, Ljava/io/FileInputStream;->read([B)I
invoke-virtual {v13}, Ljava/io/FileInputStream;->close()V
move-object/from16 v0, p0
move-object/from16 v1, v19
invoke-direct {v0, v1}, Lcom/samsung/android/feature/SemCscFeature;->decode([B)[B
move-result-object v17
new-instance v15, Ljava/io/ByteArrayInputStream;
move-object/from16 v0, v17
invoke-direct {v15, v0}, Ljava/io/ByteArrayInputStream;-><init>([B)V
:try_end_1
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_1 .. :try_end_1} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_1 .. :try_end_1} :catch_2
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_5
.catchall {:try_start_1 .. :try_end_1} :catchall_0
const/16 v20, 0x0
:try_start_2
move-object/from16 v0, v16
move-object/from16 v1, v20
invoke-interface {v0, v15, v1}, Lorg/xmlpull/v1/XmlPullParser;->setInput(Ljava/io/InputStream;Ljava/lang/String;)V
:try_end_2
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_2 .. :try_end_2} :catch_c
.catch Ljava/io/FileNotFoundException; {:try_start_2 .. :try_end_2} :catch_e
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_10
.catchall {:try_start_2 .. :try_end_2} :catchall_2
move-object v14, v15
:goto_0
:try_start_3
invoke-interface/range {v16 .. v16}, Lorg/xmlpull/v1/XmlPullParser;->getEventType()I
move-result v7
:goto_1
const/16 v20, 0x1
move/from16 v0, v20
if-eq v7, v0, :cond_c
const/16 v20, 0x2
move/from16 v0, v20
if-ne v7, v0, :cond_6
invoke-interface/range {v16 .. v16}, Lorg/xmlpull/v1/XmlPullParser;->getName()Ljava/lang/String;
:try_end_3
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_3 .. :try_end_3} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_3 .. :try_end_3} :catch_2
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_5
.catchall {:try_start_3 .. :try_end_3} :catchall_0
move-result-object v2
:cond_2
:goto_2
:try_start_4
invoke-interface/range {v16 .. v16}, Lorg/xmlpull/v1/XmlPullParser;->next()I
:try_end_4
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_7
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_4 .. :try_end_4} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_4 .. :try_end_4} :catch_2
.catchall {:try_start_4 .. :try_end_4} :catchall_0
move-result v7
goto :goto_1
:cond_3
const/16 v20, 0x0
:try_start_5
move-object/from16 v0, v16
move-object/from16 v1, v20
invoke-interface {v0, v13, v1}, Lorg/xmlpull/v1/XmlPullParser;->setInput(Ljava/io/InputStream;Ljava/lang/String;)V
:try_end_5
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_5 .. :try_end_5} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_5 .. :try_end_5} :catch_2
.catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_5
.catchall {:try_start_5 .. :try_end_5} :catchall_0
goto :goto_0
:catch_0
move-exception v6
move-object v12, v13
:goto_3
:try_start_6
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v6}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_1
if-eqz v12, :cond_4
:try_start_7
invoke-virtual {v12}, Ljava/io/FileInputStream;->close()V
const/4 v12, 0x0
:cond_4
if-eqz v14, :cond_5
invoke-virtual {v14}, Ljava/io/ByteArrayInputStream;->close()V
:try_end_7
.catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_9
:goto_4
const/4 v14, 0x0
:cond_5
:goto_5
return-void
:cond_6
const/16 v20, 0x4
move/from16 v0, v20
if-ne v7, v0, :cond_2
:try_start_8
invoke-interface/range {v16 .. v16}, Lorg/xmlpull/v1/XmlPullParser;->getText()Ljava/lang/String;
move-result-object v3
if-eqz v2, :cond_2
if-eqz v3, :cond_2
move-object/from16 v0, p0
iget-object v0, v0, Lcom/samsung/android/feature/SemCscFeature;->mFeatureList:Ljava/util/Hashtable;
move-object/from16 v20, v0
move-object/from16 v0, v20
invoke-virtual {v0, v2}, Ljava/util/Hashtable;->containsKey(Ljava/lang/Object;)Z
:try_end_8
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_8 .. :try_end_8} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_8 .. :try_end_8} :catch_2
.catch Ljava/io/IOException; {:try_start_8 .. :try_end_8} :catch_5
.catchall {:try_start_8 .. :try_end_8} :catchall_0
move-result v20
if-eqz v20, :cond_8
:try_start_9
invoke-interface/range {v16 .. v16}, Lorg/xmlpull/v1/XmlPullParser;->next()I
:try_end_9
.catch Ljava/io/IOException; {:try_start_9 .. :try_end_9} :catch_1
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_9 .. :try_end_9} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_9 .. :try_end_9} :catch_2
.catchall {:try_start_9 .. :try_end_9} :catchall_0
move-result v7
goto :goto_1
:catch_1
move-exception v5
:try_start_a
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_a
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_a .. :try_end_a} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_a .. :try_end_a} :catch_2
.catch Ljava/io/IOException; {:try_start_a .. :try_end_a} :catch_5
.catchall {:try_start_a .. :try_end_a} :catchall_0
goto :goto_1
:catch_2
move-exception v4
move-object v12, v13
:goto_6
:try_start_b
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v4}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_b
.catchall {:try_start_b .. :try_end_b} :catchall_1
if-eqz v12, :cond_7
:try_start_c
invoke-virtual {v12}, Ljava/io/FileInputStream;->close()V
const/4 v12, 0x0
:cond_7
if-eqz v14, :cond_5
invoke-virtual {v14}, Ljava/io/ByteArrayInputStream;->close()V
:try_end_c
.catch Ljava/io/IOException; {:try_start_c .. :try_end_c} :catch_3
goto :goto_4
:catch_3
move-exception v5
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_5
:cond_8
:try_start_d
invoke-virtual {v3}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v3
move-object/from16 v0, p0
iget-object v0, v0, Lcom/samsung/android/feature/SemCscFeature;->mFeatureList:Ljava/util/Hashtable;
move-object/from16 v20, v0
move-object/from16 v0, v20
invoke-virtual {v0, v2, v3}, Ljava/util/Hashtable;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
:try_end_d
.catch Ljava/lang/Exception; {:try_start_d .. :try_end_d} :catch_4
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_d .. :try_end_d} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_d .. :try_end_d} :catch_2
.catch Ljava/io/IOException; {:try_start_d .. :try_end_d} :catch_5
.catchall {:try_start_d .. :try_end_d} :catchall_0
goto/16 :goto_2
:catch_4
move-exception v8
:try_start_e
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v8}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_e
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_e .. :try_end_e} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_e .. :try_end_e} :catch_2
.catch Ljava/io/IOException; {:try_start_e .. :try_end_e} :catch_5
.catchall {:try_start_e .. :try_end_e} :catchall_0
goto/16 :goto_2
:catch_5
move-exception v5
move-object v12, v13
:goto_7
:try_start_f
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_f
.catchall {:try_start_f .. :try_end_f} :catchall_1
if-eqz v12, :cond_9
:try_start_10
invoke-virtual {v12}, Ljava/io/FileInputStream;->close()V
const/4 v12, 0x0
:cond_9
if-eqz v14, :cond_5
invoke-virtual {v14}, Ljava/io/ByteArrayInputStream;->close()V
:try_end_10
.catch Ljava/io/IOException; {:try_start_10 .. :try_end_10} :catch_6
goto/16 :goto_4
:catch_6
move-exception v5
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto/16 :goto_5
:catch_7
move-exception v5
:try_start_11
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_11
.catch Lorg/xmlpull/v1/XmlPullParserException; {:try_start_11 .. :try_end_11} :catch_0
.catch Ljava/io/FileNotFoundException; {:try_start_11 .. :try_end_11} :catch_2
.catch Ljava/io/IOException; {:try_start_11 .. :try_end_11} :catch_5
.catchall {:try_start_11 .. :try_end_11} :catchall_0
goto/16 :goto_1
:catchall_0
move-exception v20
move-object v12, v13
:goto_8
if-eqz v12, :cond_a
:try_start_12
invoke-virtual {v12}, Ljava/io/FileInputStream;->close()V
const/4 v12, 0x0
:cond_a
if-eqz v14, :cond_b
invoke-virtual {v14}, Ljava/io/ByteArrayInputStream;->close()V
:try_end_12
.catch Ljava/io/IOException; {:try_start_12 .. :try_end_12} :catch_a
const/4 v14, 0x0
:cond_b
:goto_9
throw v20
:cond_c
if-eqz v13, :cond_d
:try_start_13
invoke-virtual {v13}, Ljava/io/FileInputStream;->close()V
:try_end_13
.catch Ljava/io/IOException; {:try_start_13 .. :try_end_13} :catch_11
const/4 v12, 0x0
:goto_a
if-eqz v14, :cond_5
:try_start_14
invoke-virtual {v14}, Ljava/io/ByteArrayInputStream;->close()V
:try_end_14
.catch Ljava/io/IOException; {:try_start_14 .. :try_end_14} :catch_8
goto/16 :goto_4
:catch_8
move-exception v5
:goto_b
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto/16 :goto_5
:catch_9
move-exception v5
const-string/jumbo v20, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v21
invoke-static/range {v20 .. v21}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto/16 :goto_5
:catch_a
move-exception v5
const-string/jumbo v21, "SemCscFeature"
invoke-virtual {v5}, Ljava/lang/Throwable;->toString()Ljava/lang/String;
move-result-object v22
invoke-static/range {v21 .. v22}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_9
:catchall_1
move-exception v20
goto :goto_8
:catchall_2
move-exception v20
move-object v14, v15
move-object v12, v13
goto :goto_8
:catch_b
move-exception v6
goto/16 :goto_3
:catch_c
move-exception v6
move-object v14, v15
move-object v12, v13
goto/16 :goto_3
:catch_d
move-exception v4
goto/16 :goto_6
:catch_e
move-exception v4
move-object v14, v15
move-object v12, v13
goto/16 :goto_6
:catch_f
move-exception v5
goto/16 :goto_7
:catch_10
move-exception v5
move-object v14, v15
move-object v12, v13
goto/16 :goto_7
:catch_11
move-exception v5
move-object v12, v13
goto :goto_b
:cond_d
move-object v12, v13
goto :goto_a
.end method
And the invoke:
Code:
...
invoke-direct {p0, v2, v4}, Lcom/samsung/android/feature/SemCscFeature;->loadFeatureFile(ZLjava/lang/String;)Z
move-result v5
if-eqz v5, :cond_1
invoke-direct {p0, v2, v3}, Lcom/samsung/android/feature/SemCscFeature;->loadNetworkFeatureFile(ZLjava/lang/String;)V
[COLOR="Blue"]invoke-direct {p0, v2, v3}, Lcom/samsung/android/feature/SemCscFeature;->loadHadesFeatureFile(ZLjava/lang/String;)V[/COLOR]
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
...
The code can be simplified, i didn`t bothered to do that, feel free to manipulate it in which way you want.
3. Use ODM instead of OMC/CSC in Oreo
From S9 Samsung introduced a new kind of omc, ODM, which needs its own partition and needs to be loaded from fstab/dts. We can add it to non ODM devices with a pretty simple and clean workaround.
Inside ramdisk, in init.rc file (all the devices should have that), i found this:
Code:
# Link /vendor to /system/vendor for devices without a vendor partition.
symlink /system/vendor /vendor
Following this we can make it work just like this:
Code:
# Link /vendor to /system/vendor for devices without a vendor partition.
symlink /system/vendor /vendor
[color="Blue"] symlink /system/odm /odm[/color]
By unpacking odm partition content inside a folder from system and creating the symlink from above at boot, rom will load odm as it has the partition.
Hope these tips will help someone in the future of custom roms with more features.
I will attach to this thread my modified smalis from one of my roms, i tried these methods on 7.1.1, but the idea is the same for oreo too, code might be slighlty different.
All the best :fingers-crossed:
Click to expand...
Click to collapse
I believe this thread needs to be updated...????i followed your guide in oreo and i try to find the second smali SemCscFeature.smali (framework.jar/smali_classes3/samsung/android/feature)*but i dont seem to find it in framework.jar and smali_classes3/.....path you mentioned above.?

Giorgatzelos said:
I believe this thread needs to be updated...????i followed your guide in oreo and i try to find the second smali SemCscFeature.smali (framework.jar/smali_classes3/samsung/android/feature)*but i dont seem to find it in framework.jar and smali_classes3/.....path you mentioned above.
Click to expand...
Click to collapse
I eventually had found it! the guide is precise and well explained! Nice work bro! :fingers-crossed:

Related

[mod/source] show full kernel version & add "mod" version to settings

Hey again,
So after playing with the gingerbread leak, and seeing that samsung decided (so far, at least) to show the full kernel version in the "About Phone" menu in settings, I decided to fix it on normal vibrant froyo roms.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
At the same time, I also added the CM style "mod version" string. Someone else (I forget who and when, and I sincerely apologize for that) attempted this before, but I don't know if they didn't finish, or if it just never took off, but regardless, I decided to add it too, lol. For developers, all you need to add to your build.prop is:
Code:
ro.modversion=Bionix-1.2.1
Obviously replace everything after the = with your personal mod version.
Anyway, to show the full kernel version string:
Decompile Settings.apk, open /smali/com/android/settings/DeviceInfoSettings.smali and replace the entire method "getFormattedKernelVersion" with the following code:
Code:
.method private getFormattedKernelVersion()Ljava/lang/String;
.locals 11
.prologue
const/4 v8, 0x4
const-string v6, "\n"
const-string v10, "Unavailable"
const-string v9, "DeviceInfoSettings"
:try_start_0
new-instance v5, Ljava/io/BufferedReader;
new-instance v6, Ljava/io/FileReader;
const-string v7, "/proc/version"
invoke-direct {v6, v7}, Ljava/io/FileReader;-><init>(Ljava/lang/String;)V
const/16 v7, 0x100
invoke-direct {v5, v6, v7}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;I)V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.local v5, reader:Ljava/io/BufferedReader;
:try_start_1
invoke-virtual {v5}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
move-result-object v4
.local v4, procVersionStr:Ljava/lang/String;
:try_start_2
invoke-virtual {v5}, Ljava/io/BufferedReader;->close()V
const-string v0, "\\w+\\s+\\w+\\s+([^\\s]+)\\s+\\(([^\\[email protected]]+(?:@[^\\s.]+)?)[^)]*\\)\\s+\\((?:[^(]*\\([^)]*\\))?[^)]*\\)\\s+([^\\s]+)\\s+(?:PREEMPT\\s+)?(.+)"
.local v0, PROC_VERSION_REGEX:Ljava/lang/String;
const-string v6, "\\w+\\s+\\w+\\s+([^\\s]+)\\s+\\(([^\\[email protected]]+(?:@[^\\s.]+)?)[^)]*\\)\\s+\\((?:[^(]*\\([^)]*\\))?[^)]*\\)\\s+([^\\s]+)\\s+(?:PREEMPT\\s+)?(.+)"
invoke-static {v6}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
move-result-object v3
.local v3, p:Ljava/util/regex/Pattern;
invoke-virtual {v3, v4}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
move-result-object v2
.local v2, m:Ljava/util/regex/Matcher;
invoke-virtual {v2}, Ljava/util/regex/Matcher;->matches()Z
move-result v6
if-nez v6, :cond_0
const-string v6, "DeviceInfoSettings"
new-instance v7, Ljava/lang/StringBuilder;
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
const-string v8, "Regex did not match on /proc/version: "
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v7, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v7
invoke-static {v6, v7}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
const-string v6, "Unavailable"
move-object v6, v10
.end local v0 #PROC_VERSION_REGEX:Ljava/lang/String;
.end local v2 #m:Ljava/util/regex/Matcher;
.end local v3 #p:Ljava/util/regex/Pattern;
.end local v4 #procVersionStr:Ljava/lang/String;
.end local v5 #reader:Ljava/io/BufferedReader;
:goto_0
return-object v6
.restart local v5 #reader:Ljava/io/BufferedReader;
:catchall_0
move-exception v6
invoke-virtual {v5}, Ljava/io/BufferedReader;->close()V
throw v6
:try_end_2
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0
.end local v5 #reader:Ljava/io/BufferedReader;
:catch_0
move-exception v6
move-object v1, v6
.local v1, e:Ljava/io/IOException;
const-string v6, "DeviceInfoSettings"
const-string v6, "IO Exception when getting kernel version for Device Info screen"
invoke-static {v9, v6, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
const-string v6, "Unavailable"
move-object v6, v10
goto :goto_0
.end local v1 #e:Ljava/io/IOException;
.restart local v0 #PROC_VERSION_REGEX:Ljava/lang/String;
.restart local v2 #m:Ljava/util/regex/Matcher;
.restart local v3 #p:Ljava/util/regex/Pattern;
.restart local v4 #procVersionStr:Ljava/lang/String;
.restart local v5 #reader:Ljava/io/BufferedReader;
:cond_0
:try_start_3
invoke-virtual {v2}, Ljava/util/regex/Matcher;->groupCount()I
move-result v6
if-ge v6, v8, :cond_1
const-string v6, "DeviceInfoSettings"
new-instance v7, Ljava/lang/StringBuilder;
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
const-string v8, "Regex match on /proc/version only returned "
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v2}, Ljava/util/regex/Matcher;->groupCount()I
move-result v8
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v7
const-string v8, " groups"
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v7
invoke-static {v6, v7}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
const-string v6, "Unavailable"
move-object v6, v10
goto :goto_0
:cond_1
new-instance v6, Ljava/lang/StringBuilder;
const/4 v7, 0x1
invoke-virtual {v2, v7}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
move-result-object v7
invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
const-string v7, "\n"
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const/4 v7, 0x2
invoke-virtual {v2, v7}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
move-result-object v7
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const-string v7, " "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const/4 v7, 0x3
invoke-virtual {v2, v7}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
move-result-object v7
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const-string v7, "\n"
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const/4 v7, 0x4
invoke-virtual {v2, v7}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
move-result-object v7
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
:try_end_3
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_0
move-result-object v6
goto :goto_0
.end method
Then to add "Mod version" further down in the file, search for the following lines:
Code:
.line 74
const-string v2, "kernel_version"
invoke-virtual {p0, v2}, Lcom/android/settings/DeviceInfoSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
invoke-direct {p0}, Lcom/android/settings/DeviceInfoSettings;->getFormattedKernelVersion()Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 77
and before the .line 77 add the following:
Code:
const-string v2, "mod_version"
const-string v3, "ro.modversion"
invoke-direct {p0, v2, v3}, Lcom/android/settings/DeviceInfoSettings;->setValueSummary(Ljava/lang/String;Ljava/lang/String;)V
Then add or change the following to /res/xml/device_info_settings.xml
(I removed the "style="?androidreferenceInformationStyle" />" after Kernel version to ensure that it shows all three lines, since preferenceInformationStyle truncates at 2 lines by default)
Code:
<Preference android:title="@string/kernel_version" android:key="kernel_version" android:summary="@string/device_info_default" />
<Preference android:title="@string/mod_version" android:key="mod_version" android:summary="@string/mod_version_default" style="?android:preferenceInformationStyle" />
and for the mod version, add the following to /res/values/strings.xml
Code:
<string name="mod_version">Mod version</string>
<string name="mod_version_default">Unknown</string>
and finally, declare the strings in /res/values/public.xml
Code:
<public type="string" name="mod_version" id="0x7f090639" />
<public type="string" name="mod_version_default" id="0x7f09063a" />
Please note, you might need to increment/decrement the last digit or two to fit with any other mods already present in your Settings.apk.
UPDATE!
Attached to this post is Settings.apk for Bionix-v 1.3.1 already modified to show the long kernel version, and mod version. This should work on any other rom that includes my user-selectable am/pm mod, but its untested on anything other than bionix. And please note, mod version will be "unknown" unless you edit your build.prop yourself to reflect the real build number, and mod version.
Cheers everyone, =)
Nice
Sent from my SGH-T959 using XDA App
thanks for sharing this, its nice to see developers sharing source here in this forum instead of just compiled binaries
Jocey...
This is really good work!!!
Girl, you are freaking smart!!!!
All XDA App Users Rock Tapatalkie!!
sw33t! thanks again!!!
Wow, great work!
Check your pm's
Hi Jocelyn,
installed the settings.apk, I don't see the kernel version in the about phone.
I am using kernel with the honeycomb logo
something was up with my source. thanks for fixing it

Help: Change Color Clock status bar Galaxy Mini Samsung GT-S5570

Hi Guys
I have a Samsung GT-S5570 Galaxy Mini and want to change the color of the clock in the status bar, I was reviewing some options and come to decompile the file services.odex, I have seen options to change the color but I have not yet been possible, help me?
PD: Sorry for me english
My File StatusBarIcon.smali
.class Lcom/android/server/status/StatusBarIcon;
.super Ljava/lang/Object;
.source "StatusBarIcon.java"
# static fields
.field private static final ICON_GAP:I = 0x8
.field private static final ICON_HEIGHT:I = 0x19
.field private static final ICON_WIDTH:I = 0x19
# instance fields
.field mData:Lcom/android/server/status/IconData;
.field private mImageView:Lcom/android/server/status/AnimatedImageView;
.field private mNumberView:Landroid/widget/TextView;
.field private mTextView:Landroid/widget/TextView;
.field public view:Landroid/view/View;
# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/android/server/status/IconData;Landroid/view/ViewGroupV
.registers 13
.parameter "context"
.parameter "data"
.parameter "parent"
.prologue
const/4 v7, -0x1
const/4 v8, 0x0
.line 50
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 51
invoke-virtual {p2}, Lcom/android/server/status/IconData;->clone()Lcom/android/server/status/IconData;
move-result-object v6
iput-object v6, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
.line 53
iget v6, p2, Lcom/android/server/status/IconData;->type:I
packed-switch v6, switch_data_9a
.line 97
:goto_10
return-void
.line 56
switch_11
new-instance v4, Landroid/widget/TextView;
invoke-direct {v4, p1}, Landroid/widget/TextView;-><init>(Landroid/content/ContextV
.line 57
.local v4, t:Landroid/widget/TextView;
iput-object v4, p0, Lcom/android/server/status/StatusBarIcon;->mTextView:Landroid/widget/TextView;
.line 58
new-instance v2, Landroid/widget/LinearLayout$LayoutParams;
const/4 v6, -0x2
invoke-direct {v2, v6, v7}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V
.line 61
.local v2, layoutParams:Landroid/widget/LinearLayout$LayoutParams;
const/high16 v6, 0x4180
invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextSize(F)V
.line 62
invoke-virtual {v4, v7}, Landroid/widget/TextView;->setTextColor(I)V
.line 63
sget-object v6, Landroid/graphics/Typeface;->DEFAULT_BOLD:Landroid/graphics/Typeface;
invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/TypefaceV
.line 64
const/16 v6, 0x13
invoke-virtual {v4, v6}, Landroid/widget/TextView;->setGravity(I)V
.line 65
const/4 v6, 0x6
invoke-virtual {v4, v6, v8, v8, v8}, Landroid/widget/TextView;->setPadding(IIII)V
.line 66
invoke-virtual {v4, v2}, Landroid/widget/TextView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParamsV
.line 67
iget-object v6, p2, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
invoke-virtual {v4, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequenceV
.line 68
iput-object v4, p0, Lcom/android/server/status/StatusBarIcon;->view:Landroid/view/View;
goto :goto_10
.line 74
.end local v2 #layoutParams:Landroid/widget/LinearLayout$LayoutParams;
.end local v4 #t:Landroid/widget/TextView;
switch_3f
const-string v6, "layout_inflater"
invoke-virtual {p1, v6}, Landroid/content/Context;->getSystemService(Ljava/lang/StringLjava/lang/Object;
move-result-object v1
check-cast v1, Landroid/view/LayoutInflater;
.line 76
.local v1, inflater:Landroid/view/LayoutInflater;
const v6, 0x1090064
invoke-virtual {v1, v6, p3, v8}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
move-result-object v5
.line 77
.local v5, v:Landroid/view/View;
iput-object v5, p0, Lcom/android/server/status/StatusBarIcon;->view:Landroid/view/View;
.line 80
const v6, 0x102017e
invoke-virtual {v5, v6}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Lcom/android/server/status/AnimatedImageView;
.line 81
.local v0, im:Lcom/android/server/status/AnimatedImageView;
invoke-static {p1, p2}, Lcom/android/server/status/StatusBarIcon;->getIcon(Landroid/content/Context;Lcom/android/server/status/IconDataLandroid/graphics/drawable/Drawable;
move-result-object v6
invoke-virtual {v0, v6}, Lcom/android/server/status/AnimatedImageView;->setImageDrawable(Landroid/graphics/drawable/DrawableV
.line 82
iget v6, p2, Lcom/android/server/status/IconData;->iconLevel:I
invoke-virtual {v0, v6}, Lcom/android/server/status/AnimatedImageView;->setImageLevel(I)V
.line 83
iput-object v0, p0, Lcom/android/server/status/StatusBarIcon;->mImageView:Lcom/android/server/status/AnimatedImageView;
.line 86
const v6, 0x1020055
invoke-virtual {v5, v6}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v3
check-cast v3, Landroid/widget/TextView;
.line 87
.local v3, nv:Landroid/widget/TextView;
iput-object v3, p0, Lcom/android/server/status/StatusBarIcon;->mNumberView:Landroid/widget/TextView;
.line 88
iget v6, p2, Lcom/android/server/status/IconData;->number:I
if-lez v6, :cond_93
.line 89
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, ""
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v6
iget v7, p2, Lcom/android/server/status/IconData;->number:I
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-virtual {v3, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequenceV
.line 90
invoke-virtual {v3, v8}, Landroid/widget/TextView;->setVisibility(I)V
goto/16 :goto_10
.line 92
:cond_93
const/16 v6, 0x8
invoke-virtual {v3, v6}, Landroid/widget/TextView;->setVisibility(I)V
goto/16 :goto_10
.line 53
switch_data_9a
.packed-switch 0x1
switch_11
switch_3f
.end packed-switch
.end method
.method static getIcon(Landroid/content/Context;Lcom/android/server/status/IconDataLandroid/graphics/drawable/Drawable;
.registers 9
.parameter "context"
.parameter "data"
.prologue
const/4 v5, 0x0
const-string v6, "StatusBar"
.line 155
const/4 v2, 0x0
.line 157
.local v2, r:Landroid/content/res/Resources;
iget-object v3, p1, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
if-eqz v3, :cond_50
.line 159
:try_start_8
invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v3
iget-object v4, p1, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
invoke-virtual {v3, v4}, Landroid/content/pm/PackageManager;->getResourcesForApplication(Ljava/lang/StringLandroid/content/res/Resources;
:try_end_11
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_8 .. :try_end_11} :catch_32
move-result-object v2
.line 168
:goto_12
iget v3, p1, Lcom/android/server/status/IconData;->iconId:I
if-nez v3, :cond_55
.line 169
const-string v3, "StatusBar"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "No icon ID for slot "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v3
iget-object v4, p1, Lcom/android/server/status/IconData;->slot:Ljava/lang/String;
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v6, v3}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/StringI
move-object v3, v5
.line 181
:goto_31
return-object v3
.line 160
:catch_32
move-exception v3
move-object v1, v3
.line 161
.local v1, ex:Landroid/content/pm/PackageManager$NameNotFoundException;
const-string v3, "StatusBar"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "Icon package not found: "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v3
iget-object v4, p1, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v6, v3, v1}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/ThrowableI
move-object v3, v5
.line 162
goto :goto_31
.line 165
.end local v1 #ex:Landroid/content/pm/PackageManager$NameNotFoundException;
:cond_50
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
goto :goto_12
.line 174
:cond_55
:try_start_55
iget v3, p1, Lcom/android/server/status/IconData;->iconId:I
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
:try_end_5a
.catch Ljava/lang/RuntimeException; {:try_start_55 .. :try_end_5a} :catch_5c
move-result-object v3
goto :goto_31
.line 175
:catch_5c
move-exception v3
move-object v0, v3
.line 176
.local v0, e:Ljava/lang/RuntimeException;
const-string v3, "StatusBar"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "Icon not found in "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v3
iget-object v4, p1, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
if-eqz v4, :cond_92
iget v4, p1, Lcom/android/server/status/IconData;->iconId:I
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v4
:goto_75
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/ObjectLjava/lang/StringBuilder;
move-result-object v3
const-string v4, ": "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v3
iget v4, p1, Lcom/android/server/status/IconData;->iconId:I
invoke-static {v4}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
move-result-object v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v6, v3}, Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/StringI
move-object v3, v5
.line 181
goto :goto_31
.line 176
:cond_92
const-string v4, "<system>"
goto :goto_75
.end method
# virtual methods
.method getNumber()I
.registers 2
.prologue
.line 185
iget-object v0, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
iget v0, v0, Lcom/android/server/status/IconData;->number:I
return v0
.end method
.method public update(I)V
.registers 6
.parameter "number"
.prologue
const-string v3, ""
.line 133
iget-object v1, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
iget v1, v1, Lcom/android/server/status/IconData;->number:I
if-eq v1, p1, :cond_22
.line 134
iget-object v0, p0, Lcom/android/server/status/StatusBarIcon;->mNumberView:Landroid/widget/TextView;
.line 135
.local v0, nv:Landroid/widget/TextView;
if-lez p1, :cond_27
.line 136
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, ""
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequenceV
.line 141
.end local v0 #nv:Landroid/widget/TextView;
:cond_22
:goto_22
iget-object v1, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
iput p1, v1, Lcom/android/server/status/IconData;->number:I
.line 142
return-void
.line 138
.restart local v0 #nv:Landroid/widget/TextView;
:cond_27
const-string v1, ""
invoke-virtual {v0, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequenceV
goto :goto_22
.end method
.method public update(Landroid/content/Context;Lcom/android/server/status/IconDataV
.registers 9
.parameter "context"
.parameter "data"
.annotation system Ldalvik/annotation/Throws;
value = {
Lcom/android/server/status/StatusBarException;
}
.end annotation
.prologue
const-string v5, ""
.line 100
iget-object v3, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
iget v3, v3, Lcom/android/server/status/IconData;->type:I
iget v4, p2, Lcom/android/server/status/IconData;->type:I
if-eq v3, v4, :cond_12
.line 101
new-instance v3, Lcom/android/server/status/StatusBarException;
const-string v4, "status bar entry type can\'t change"
invoke-direct {v3, v4}, Lcom/android/server/status/StatusBarException;-><init>(Ljava/lang/StringV
throw v3
.line 103
:cond_12
iget v3, p2, Lcom/android/server/status/IconData;->type:I
packed-switch v3, switch_data_92
.line 129
:cond_17
:goto_17
iget-object v3, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
invoke-virtual {v3, p2}, Lcom/android/server/status/IconData;->copyFrom(Lcom/android/server/status/IconDataV
.line 130
return-void
.line 105
switch_1d
iget-object v3, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
iget-object v3, v3, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
iget-object v4, p2, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
invoke-static {v3, v4}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequenceZ
move-result v3
if-nez v3, :cond_17
.line 106
iget-object v2, p0, Lcom/android/server/status/StatusBarIcon;->mTextView:Landroid/widget/TextView;
.line 107
.local v2, tv:Landroid/widget/TextView;
iget-object v3, p2, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequenceV
goto :goto_17
.line 111
.end local v2 #tv:Landroid/widget/TextView;
switch_31
iget-object v3, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
iget-object v3, v3, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
if-eqz v3, :cond_47
iget-object v3, p2, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
if-eqz v3, :cond_47
iget-object v3, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
iget-object v3, v3, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
iget-object v4, p2, Lcom/android/server/status/IconData;->iconPackage:Ljava/lang/String;
invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/ObjectZ
move-result v3
if-eqz v3, :cond_57
:cond_47
iget-object v3, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
iget v3, v3, Lcom/android/server/status/IconData;->iconId:I
iget v4, p2, Lcom/android/server/status/IconData;->iconId:I
if-ne v3, v4, :cond_57
iget-object v3, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
iget v3, v3, Lcom/android/server/status/IconData;->iconLevel:I
iget v4, p2, Lcom/android/server/status/IconData;->iconLevel:I
if-eq v3, v4, :cond_65
.line 115
:cond_57
iget-object v0, p0, Lcom/android/server/status/StatusBarIcon;->mImageView:Lcom/android/server/status/AnimatedImageView;
.line 116
.local v0, im:Landroid/widget/ImageView;
invoke-static {p1, p2}, Lcom/android/server/status/StatusBarIcon;->getIcon(Landroid/content/Context;Lcom/android/server/status/IconDataLandroid/graphics/drawable/Drawable;
move-result-object v3
invoke-virtual {v0, v3}, Lcom/android/server/status/AnimatedImageView;->setImageDrawable(Landroid/graphics/drawable/DrawableV
.line 117
iget v3, p2, Lcom/android/server/status/IconData;->iconLevel:I
invoke-virtual {v0, v3}, Lcom/android/server/status/AnimatedImageView;->setImageLevel(I)V
.line 119
.end local v0 #im:Landroid/widget/ImageView;
:cond_65
iget-object v3, p0, Lcom/android/server/status/StatusBarIcon;->mData:Lcom/android/server/status/IconData;
iget v3, v3, Lcom/android/server/status/IconData;->number:I
iget v4, p2, Lcom/android/server/status/IconData;->number:I
if-eq v3, v4, :cond_17
.line 120
iget-object v1, p0, Lcom/android/server/status/StatusBarIcon;->mNumberView:Landroid/widget/TextView;
.line 121
.local v1, nv:Landroid/widget/TextView;
iget v3, p2, Lcom/android/server/status/IconData;->number:I
if-lez v3, :cond_8c
.line 122
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, ""
invoke-virtual {v3, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/StringLjava/lang/StringBuilder;
move-result-object v3
iget v4, p2, Lcom/android/server/status/IconData;->number:I
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-virtual {v1, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequenceV
goto :goto_17
.line 124
:cond_8c
const-string v3, ""
invoke-virtual {v1, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequenceV
goto :goto_17
.line 103
switch_data_92
.packed-switch 0x1
switch_1d
switch_31
.end packed-switch
.end method
Click to expand...
Click to collapse

[GUIDE][CM11][DISCONTINUED] NavbarEnabler, StatusBarClockStyle, Q.S with 3,4,5

Guide for CyanogenMod11 KOT49H
Navigationbar Enabler, Navigation bar dimension, StatusBar Clock and Date Style, QuickSettings with 3,4,5 per row, NetworkTrafic thingking bridge/ChaOS
Hello guys, I want to share to you Guide how to with settings.
1. Navbar Enable/Disable, Navbar dimension
2. Status bar clock style, choose normal/center, add date to clock, date format, add AM/PM to clock, colorpicker style
3. QuickSettings with 3,4, or 5 per row
4. Network traffic thingking bridge , Chameleon OS style, colorpicker style
This guide will only working for pure CM11 KK 4.4.2 ( Don't try this on stock KK AOSP, due to different structure of APK and etc with CM11 )
ok lets go to Guide:
first of all need some requirement for this MOD-GUIDE
REQUIREMENT:
- BRAIN
- Patient
- experience
- Know how to decompile/recompiling Apk and JAR file
- notepad++
- Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else
All these changes will work on the fly with no reboot necessary :good::laugh:
SETTINGS.APK
STEP-1
Decompile Settings.apk
1. go to Settings.apk/res/values/
Add the following at the end of the file
arrays.xml
Code:
<string-array name="clock_style_entries">
<item>@string/right_clock</item>
<item>@string/center_clock</item>
</string-array>
<string-array name="clock_style_values">
<item>0</item>
<item>1</item>
</string-array>
<string-array name="entries_status_bar_am_pm">
<item>@string/am_pm_clock_none</item>
<item>@string/am_pm_clock_small</item>
<item>@string/am_pm_clock_normal</item>
</string-array>
<string-array name="values_status_bar_am_pm">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="clock_date_display_entries">
<item>@string/clock_date_display_none</item>
<item>@string/clock_date_display_small</item>
<item>@string/clock_date_display_normal</item>
</string-array>
<string-array name="clock_date_display_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="clock_date_style_entries">
<item>@string/clock_date_style_normal</item>
<item>@string/clock_date_style_lowercase</item>
<item>@string/clock_date_style_uppercase</item>
</string-array>
<string-array name="clock_date_style_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>
<string-array name="clock_date_format_entries_values">
<item>dd/MM/yy</item>
<item>MM/dd/yy</item>
<item>yyyy-MM-dd</item>
<item>yyyy-dd-MM</item>
<item>dd-MM-yyyy</item>
<item>MM-dd-yyyy</item>
<item>MMM dd</item>
<item>MMM dd, yyyy</item>
<item>MMMM dd, yyyy</item>
<item>EEE</item>
<item>EEE dd</item>
<item>EEE dd/MM</item>
<item>EEE MM/dd</item>
<item>EEE dd MMM</item>
<item>EEE MMM dd</item>
<item>EEE MMMM dd</item>
<item>EEEE dd/MM</item>
<item>EEEE MM/dd</item>
<item>@string/clock_date_format_custom</item>
</string-array>
<string-array name="entries_status_bar_network_stats_update">
<item>½ second</item>
<item>1 second</item>
<item>2 seconds</item>
<item>5 seconds</item>
</string-array>
<string-array name="values_status_bar_network_stats_update">
<item>500</item>
<item>1000</item>
<item>2000</item>
<item>5000</item>
</string-array>
<string-array name="navigation_bar_width_entries">
<item>@string/navigation_bar_size_42_dp_default</item>
<item>@string/navigation_bar_size_40_dp</item>
<item>@string/navigation_bar_size_36_dp</item>
<item>@string/navigation_bar_size_30_dp</item>
<item>@string/navigation_bar_size_24_dp</item>
<item>@string/navigation_bar_size_0_dp</item>
</string-array>
<string-array name="navigation_bar_width">
<item>42</item>
<item>40</item>
<item>36</item>
<item>30</item>
<item>24</item>
<item>0</item>
</string-array>
<string-array name="navigation_bar_height_entries">
<item>@string/navigation_bar_size_48_dp_default</item>
<item>@string/navigation_bar_size_44_dp</item>
<item>@string/navigation_bar_size_42_dp</item>
<item>@string/navigation_bar_size_40_dp</item>
<item>@string/navigation_bar_size_36_dp</item>
<item>@string/navigation_bar_size_30_dp</item>
<item>@string/navigation_bar_size_24_dp</item>
<item>@string/navigation_bar_size_0_dp</item>
</string-array>
<string-array name="navigation_bar_height">
<item>48</item>
<item>44</item>
<item>42</item>
<item>40</item>
<item>36</item>
<item>30</item>
<item>24</item>
<item>0</item>
</string-array>
<string-array name="tiles_per_row_entries">
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
<string-array name="tiles_per_row_values">
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
ids.xml
Code:
<item type="id" name="hex">false</item>
<item type="id" name="enter">false</item>
<item type="id" name="white_panel">false</item>
<item type="id" name="black_panel">false</item>
<item type="id" name="cyan_panel">false</item>
<item type="id" name="red_panel">false</item>
<item type="id" name="green_panel">false</item>
<item type="id" name="yellow_panel">false</item>
<item type="id" name="old_color_panel">false</item>
<item type="id" name="new_color_panel">false</item>
dimens.xml
Code:
<item type="dimen" name="settings_side_margin">@*android:dimen/preference_fragment_padding_side</item>
<dimen name="navigation_bar_48">48.0dip</dimen>
<dimen name="navigation_bar_44">44.0dip</dimen>
<dimen name="navigation_bar_42">42.0dip</dimen>
<dimen name="navigation_bar_40">40.0dip</dimen>
<dimen name="navigation_bar_36">36.0dip</dimen>
<dimen name="navigation_bar_30">30.0dip</dimen>
<dimen name="navigation_bar_24">24.0dip</dimen>
<dimen name="navigation_bar_0">0.0dip</dimen>
strings.xml
Code:
<string name="reset">Reset</string>
<string name="enabled">Enabled</string>
<string name="attention">Attention</string>
<string name="default_string">Default</string>
<string name="reset_message">Reset all entries to default?</string>
<string name="style_title">Style</string>
<string name="alerts_and_warnings_title">Alerts and warnings</string>
<string name="alerts_and_warnings_style_title">Alerts and warnings options</string>
<string name="sound_title">Sound</string>
<string name="sound_settings_title">Sound settings</string>
<string name="dialog_color_picker">Color Picker</string>
<string name="press_color_to_apply">Press on color below to apply</string>
<string name="arrow_right">→</string>
<string name="arrow_down">↓</string>
<string name="hex">Hex:</string>
<string name="hex_hint">\#ff000000</string>
<string name="set">Set</string>
<string name="status_bar_style_title">Status bar options</string>
<string name="status_bar_general_title">General</string>
<string name="status_bar_clock">Clock and date</string>
<string name="status_bar_clock_title">Clock and date style</string>
<string name="clock_title_enable">Alignment</string>
<string name="clock_enabled">Enabled</string>
<string name="clock_disabled">Disabled</string>
<string name="clock_color_title">Color</string>
<string name="status_bar_clock_style_reset">Reset color</string>
<string name="status_bar_am_pm_title">AM/PM</string>
<string name="status_bar_am_pm_info">24-hour clock is enabled</string>
<string name="enable_clock_weekday">Day of the week</string>
<string name="enable_clock_weekday_summary">Abbreviated day of the week before the time</string>
<string name="right_clock">Right clock</string>
<string name="center_clock">Center clock</string>
<string name="dont_show">"Don't show"</string>
<string name="clock_date_display">Date</string>
<string name="clock_date_display_summary">Display custom date before the clock</string>
<string name="clock_date_style">Date style</string>
<string name="clock_date_format">Date format</string>
<string name="clock_date_string_edittext_title">Must be in DateFormat eg. MM/dd/yy</string>
<string name="clock_date_string_edittext_summary">Enter string</string>
<string name="am_pm_clock_normal">Normal font size</string>
<string name="am_pm_clock_small">Small font size</string>
<string name="am_pm_clock_none">"Don't show"</string>
<string name="clock_date_display_none">"Don't show"</string>
<string name="clock_date_display_small">Small font size</string>
<string name="clock_date_display_normal">Normal font size</string>
<string name="clock_date_style_normal">Normal</string>
<string name="clock_date_style_lowercase">Lowercase</string>
<string name="clock_date_style_uppercase">Uppercase</string>
<string name="clock_date_format_custom">Custom java format</string>
<string name="status_bar_clock_style_reset_message">Reset clock color?</string>
<string name="notification_drawer_style_title">Notification drawer options</string>
<string name="notification_style_summary">Change your notification drawer style</string>
<string name="general_settings_title">General settings</string>
<string name="general_settings_style_title">General options</string>
<string name="display_short">Display</string>
<string name="misc_short">Misc</string>
<string name="alt_resolver">Use Alt Default App Grid</string>
<string name="alt_resolver_summary">Use Alternate Default App Picker</string>
<string name="status_bar_network_cat">Network traffic meter</string>
<string name="status_bar_network_header">Network traffic meter</string>
<string name="status_bar_network_title">Network traffic</string>
<string name="status_bar_show_network_stats_title">Show network speeds</string>
<string name="status_bar_network_stats_update_title">Update frequency</string>
<string name="status_bar_network_usage_color_style">Color style</string>
<string name="status_bar_network_usage_color_reset">Reset color</string>
<string name="status_bar_network_usage_color_reset_message">Reset network stats color to default?</string>
<string name="hide_network_speed">Hide when there is no traffic</string>
<string name="hide_network_speed_summary">Hide network stats indicator when there is no traffic</string>
<string name="navbar_enable_bar">Enable navigation bar</string>
<string name="navbar_enable_bar_summary">Enable the navigation bar</string>
<string name="navbar_style_dimen_title">Dimensions</string>
<string name="navbar_dimensions_reset_message">Reset all dimensions entries to default?</string>
<string name="navigation_bar_height_title">Navigation bar height</string>
<string name="navigation_bar_height_summary">Navigation bar height while in portrait</string>
<string name="navigation_bar_width_title">Navigation bar width</string>
<string name="navigation_bar_width_summary">Navigation bar height if the bar is along a side</string>
<string name="navigation_bar_size_42_dp_default">42 dp (default)</string>
<string name="navigation_bar_size_36_dp">36 dp</string>
<string name="navigation_bar_size_30_dp">30 dp</string>
<string name="navigation_bar_size_24_dp">24 dp</string>
<string name="navigation_bar_size_48_dp_default">48 dp (default)</string>
<string name="navigation_bar_size_44_dp">44 dp</string>
<string name="navigation_bar_size_40_dp">40 dp</string>
<string name="navigation_bar_size_42_dp">42 dp</string>
<string name="navigation_bar_size_0_dp">0 dp (off)</string>
<string name="notification_style_title">Notification drawer style</string>
<string name="status_bar_network_traffic">Network speed meter</string>
<string name="status_bar_network_traffic_summary">Show network speed in statusbar (Thinking Bridge)</string>
<string name="status_bar_network_cat_summary">Show network traffic in statusbar (ChameleonOS)</string>
<string name="quicksettings_tiles_style">Quick Settings style</string>
<string name="summary_quicksettings_tiles_style">Show or change Quick Settings style options</string>
<string name="quicksettings_tiles_style_additional_options">Additional options</string>
<string name="tiles_per_row_title">Tiles per row</string>
<string name="tiles_per_row_duplicate_landscape_title">Scale landscape quantity</string>
<string name="tiles_per_row_duplicate_landscape_summary">Landscape view doubles tiles per row quantity</string>
<string name="qs_reset">Reset</string>
<string name="status_bar_show_network_traffic_title">Show network speeds</string>
2. Settings.apk/res/xml/
status_bar.xml
remove all lines and replace all by this :
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/status_bar_title"
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/status_bar_style_title">
<PreferenceScreen android:title="@string/status_bar_clock" android:key="clock_style_pref" android:fragment="com.android.settings.adi.StatusBarClockStyle" />
<PreferenceScreen android:title="@string/status_bar_network_cat" android:key="network_usage_stats" android:summary="@string/status_bar_network_cat_summary" android:fragment="com.android.settings.adi.NetworkUsageStats" />
<PreferenceScreen android:title="@string/status_bar_network_traffic" android:key="traffic_usage_stats" android:summary="@string/status_bar_network_traffic_summary" android:fragment="com.android.settings.adi.Traffic" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/status_bar_general_title">
<ListPreference android:entries="@array/entries_status_bar_battery" android:title="@string/status_bar_battery_title" android:key="status_bar_battery" android:defaultValue="0" android:dialogTitle="@string/status_bar_battery_title" android:entryValues="@array/values_status_bar_battery" />
<com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/status_bar_battery_show_percent_title" android:key="status_bar_battery_show_percent" android:defaultValue="false" />
<ListPreference android:entries="@array/entries_status_bar_signal" android:title="@string/status_bar_signal_text_title" android:key="status_bar_signal" android:dialogTitle="@string/status_bar_signal_text_title" android:entryValues="@array/values_status_bar_signal" />
<com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/status_bar_toggle_brightness" android:key="status_bar_brightness_control" android:summary="@string/status_bar_toggle_brightness_summary" android:defaultValue="false" />
<com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/status_bar_notif_count_title" android:key="status_bar_notif_count" android:summary="@string/status_bar_notif_count_summary" android:defaultValue="false" />
<com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/status_bar_double_tap_to_sleep_title" android:key="double_tap_sleep_gesture" android:defaultValue="false" />
</PreferenceCategory>
</PreferenceScreen>
system_ui_settings.xml
change to like in red code
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/system_interface_title"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<PreferenceScreen android:title="@string/status_bar_title" android:key="status_bar" android:fragment="com.android.settings.cyanogenmod.StatusBar" />
<PreferenceScreen android:title="@string/quick_settings_panel_title" android:key="quick_settings_panel" android:fragment="com.android.settings.quicksettings.QuickSettings" />
<PreferenceScreen android:title="@string/notification_drawer_title" android:key="notification_drawer" android:fragment="com.android.settings.cyanogenmod.NotificationDrawer" />
<ListPreference android:persistent="false" android:entries="@array/expanded_desktop_entries" android:title="@string/power_menu_expanded_desktop" android:key="expanded_desktop" android:entryValues="@array/expanded_desktop_values" />
<CheckBoxPreference android:persistent="true" android:title="@string/power_menu_expanded_desktop" android:key="expanded_desktop_no_navbar" />
<Preference android:key="touch_screen_gesture_settings">
<intent android:targetPackage="com.cyanogenmod.settings.device" android:action="com.cyanogenmod.action.LAUNCH_TOUCHSCREEN_GESTURE_SETTINGS" android:targetClass="com.cyanogenmod.settings.device.TouchscreenGestureSettings" />
</Preference>
[COLOR="Red"]<PreferenceCategory android:title="@string/navigation_bar_category">
<CheckBoxPreference android:title="@string/navbar_enable_bar" android:key="enable_nav_bar" android:summary="@string/navbar_enable_bar_summary" />
<PreferenceScreen android:title="@string/navbar_style_dimen_title" android:key="navbar_dimen_settings" android:fragment="com.android.settings.adi.NavbarDimenSettings" />
<PreferenceScreen android:title="@string/navigation_bar_title" android:key="navigation_bar" android:fragment="com.android.settings.cyanogenmod.NavBar" />
<PreferenceScreen android:title="@string/navigation_ring_title" android:key="navigation_ring" android:fragment="com.android.settings.cyanogenmod.NavRing" />
</PreferenceCategory>[/COLOR]
</PreferenceScreen>
quick_settings_panel.xml
add the red code
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="@string/title_general" android:key="pref_general_settings">
[COLOR="Red"]<PreferenceScreen android:title="@string/quicksettings_tiles_style" android:key="quicksettings_tiles_style" android:summary="@string/summary_quicksettings_tiles_style" android:fragment="com.android.settings.adi.QuickSettingsTilesStyle" />[/COLOR]
<ListPreference android:persistent="false" android:entries="@array/quick_pulldown_entries" android:title="@string/title_quick_pulldown" android:key="quick_pulldown" android:entryValues="@array/quick_pulldown_values" />
<com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/title_collapse_panel" android:key="qs_collapse_panel" android:summary="@string/summary_collapse_panel" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/title_static_tiles" android:key="static_tiles">
<PreferenceScreen android:title="@string/tile_picker_title" android:key="tile_picker" android:summary="@string/tile_picker_summary" android:fragment="com.android.settings.quicksettings.QuickSettingsTiles" />
<MultiSelectListPreference android:entries="@array/entries_ring_widget" android:title="@string/pref_ring_mode_title" android:key="pref_ring_mode" android:summary="@string/pref_ring_mode_summary" android:dialogTitle="@string/pref_ring_mode_title" android:entryValues="@array/values_ring_widget" />
<ListPreference android:entries="@array/entries_network_widget" android:title="@string/pref_network_mode_title" android:key="pref_network_mode" android:dialogTitle="@string/pref_network_mode_title" android:entryValues="@array/values_network_widget" />
<ListPreference android:entries="@array/entries_screentimeout_widget" android:title="@string/pref_screentimeout_mode_title" android:key="pref_screentimeout_mode" android:dialogTitle="@string/pref_screentimeout_mode_title" android:entryValues="@array/values_screentimeout_widget" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/title_dynamic_tiles" android:key="pref_dynamic_tiles">
<Preference android:title="@string/dynamic_tiles_note_title" android:selectable="false" android:summary="@string/dynamic_tiles_note_summary" style="?android:preferenceInformationStyle" />
<com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/title_dynamic_alarm" android:key="qs_dyanmic_alarm" android:defaultValue="true" />
<com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/title_dynamic_bugreport" android:key="qs_dyanmic_bugreport" android:defaultValue="true" />
<com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/title_dynamic_dock_battery" android:key="qs_dyanmic_dock_battery" android:defaultValue="true" />
<com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/title_dynamic_ime" android:key="qs_dyanmic_ime" android:defaultValue="true" />
<com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/title_dynamic_usbtether" android:key="qs_dyanmic_usbtether" android:defaultValue="true" />
<com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/title_dynamic_wifi" android:key="qs_dyanmic_wifi" android:defaultValue="true" />
</PreferenceCategory>
</PreferenceScreen>
Next Download attached on_the_fly_CM11_Settings.apk_by_Adi.zip, exstract it and merge to your decompiled Settings.apk
and compile your settings,apk
continue to STEP-2 in POST#2
STEP-2
Decompile the newly Recompiled APK again
- Next go to res/values/public.xml
open it with Notepad++
leave it, but keep it open
- Download attached on_the_fly_CM11_Settings.apk_public.xml
so now you have two public.xml which is opened in the Notepad++
1. your secondly decompiled Settings.apk public.xml and
2. on_the_fly_CM11_Settings.apk_public.xml
- Next go to all smalis you've merged to your settings.apk
find all ids which is started with :
Code:
0x7f[COLOR="Red"]xxxxxx[/COLOR]
and search it in on_the_fly_CM11_Settings.apk_public.xml
change, match the ids in the smali with your own new secondly decompiled public.xml
Done and recompile your settings.apk
SYSTEMUI.APK
STEP-1
Decompile SystemUI.apk
Download attached new_on_the_fly_CM11_SystemUI.apk.zip extract it and merge to your decompiled SystemUI.apk
1. go to SystemUI.apk/res/values/
Add the following at the end of the file
ids.xml
Code:
<item type="id" name="network_stats">false</item>
<item type="id" name="bytes_tx">false</item>
<item type="id" name="bytes_rx">false</item>
<item type="id" name="center_clock_layout">false</item>
<item type="id" name="center_clock">false</item>
<item type="id" name="traffic">false</item>
<item type="id" name="background">false</item>
dimens.xml
Code:
<dimen name="network_stats_text_size">9.0dip</dimen>
<dimen name="qs_4_column_text_padding">14.0dip</dimen>
<dimen name="qs_5_column_text_padding">12.0dip</dimen>
<dimen name="qs_3_column_text_size">12.0sp</dimen>
<dimen name="qs_4_column_text_size">10.0sp</dimen>
<dimen name="qs_5_column_text_size">9.0sp</dimen>
styles.xml
Code:
<style name="TextAppearance.StatusBar.NetworkStats" parent="@*android:style/TextAppearance.StatusBar">
<item name="android:textSize">@dimen/network_stats_text_size</item>
<item name="android:textColor">#ffffffff</item>
<item name="android:layout_gravity">center_vertical</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1.0</item>
</style>
<style name="TextAppearance.StatusBar.Traffic" parent="@*android:style/TextAppearance.StatusBar.Icon">
<item name="android:textSize">11.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ffffffff</item>
</style>
2. SystemUI.apk/smali/com/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver.smali
add the red code
Code:
const-string v1, "status_bar_clock"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
.line 373
const-string v1, "status_bar_signal"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
[COLOR="Red"]const-string v1, "quick_tiles_per_row"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
.line 373
const-string v1, "quick_tiles_per_row_duplicate_landscape"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V[/COLOR]
.line 375
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateSettings()V
invoke-static {v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$300(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.line 376
return-void
.end method
3. SystemUI.apk/smali/com/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver.smali
add the red code
Code:
.method public onChange(ZLandroid/net/Uri;)V
.locals 7
.parameter "selfChange"
.parameter "uri"
.prologue
const/4 v6, -0x2
const/4 v2, 0x1
const/4 v3, 0x0
.line 3301
if-eqz p2, :cond_3
const-string v4, "qs_quick_access"
invoke-static {v4}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v4
invoke-virtual {p2, v4}, Landroid/net/Uri;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_3
.line 3303
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v4, v4, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
.line 3304
.local v1, resolver:Landroid/content/ContentResolver;
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
const-string v5, "qs_quick_access"
invoke-static {v1, v5, v3, v6}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v5
if-ne v5, v2, :cond_1
:goto_0
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHasQuickAccessSettings:Z
invoke-static {v4, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$4702(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Z)Z
.line 3306
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHasQuickAccessSettings:Z
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$4700(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Z
move-result v2
if-eqz v2, :cond_2
.line 3307
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->inflateRibbon()V
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$4800(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.line 3308
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mRibbonView:Lcom/android/systemui/statusbar/phone/QuickSettingsHorizontalScrollView;
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$4900(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Lcom/android/systemui/statusbar/phone/QuickSettingsHorizontalScrollView;
move-result-object v2
invoke-virtual {v2, v3}, Lcom/android/systemui/statusbar/phone/QuickSettingsHorizontalScrollView;->setVisibility(I)V
.line 3335
.end local v1 #resolver:Landroid/content/ContentResolver;
:cond_0
:goto_1
return-void
.restart local v1 #resolver:Landroid/content/ContentResolver;
:cond_1
move v2, v3
.line 3304
goto :goto_0
.line 3310
:cond_2
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->cleanupRibbon()V
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$5000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
goto :goto_1
.line 3312
.end local v1 #resolver:Landroid/content/ContentResolver;
:cond_3
if-eqz p2, :cond_5
const-string v4, "qs_quick_access_linked"
invoke-static {v4}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v4
invoke-virtual {p2, v4}, Landroid/net/Uri;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_5
.line 3314
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v4, v4, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
.line 3315
.restart local v1 #resolver:Landroid/content/ContentResolver;
const-string v4, "qs_quick_access_linked"
invoke-static {v1, v4, v2, v6}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v4
if-ne v4, v2, :cond_4
move v0, v2
.line 3317
.local v0, layoutLinked:Z
:goto_2
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQuickAccessLayoutLinked:Z
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$5100(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Z
move-result v2
if-eq v2, v0, :cond_0
.line 3319
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQuickAccessLayoutLinked:Z
invoke-static {v2, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$5102(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Z)Z
.line 3320
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->cleanupRibbon()V
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$5000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.line 3321
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->inflateRibbon()V
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$4800(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.line 3322
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mRibbonView:Lcom/android/systemui/statusbar/phone/QuickSettingsHorizontalScrollView;
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$4900(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Lcom/android/systemui/statusbar/phone/QuickSettingsHorizontalScrollView;
move-result-object v2
invoke-virtual {v2, v3}, Lcom/android/systemui/statusbar/phone/QuickSettingsHorizontalScrollView;->setVisibility(I)V
goto :goto_1
.end local v0 #layoutLinked:Z
:cond_4
move v0, v3
.line 3315
goto :goto_2
.line 3324
.end local v1 #resolver:Landroid/content/ContentResolver;
:cond_5
if-eqz p2, :cond_6
const-string v2, "quick_settings_ribbon_tiles"
invoke-static {v2}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v2
invoke-virtual {p2, v2}, Landroid/net/Uri;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_6
.line 3326
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->cleanupRibbon()V
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$5000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.line 3327
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->inflateRibbon()V
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$4800(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.line 3328
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mRibbonView:Lcom/android/systemui/statusbar/phone/QuickSettingsHorizontalScrollView;
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$4900(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Lcom/android/systemui/statusbar/phone/QuickSettingsHorizontalScrollView;
move-result-object v2
invoke-virtual {v2, v3}, Lcom/android/systemui/statusbar/phone/QuickSettingsHorizontalScrollView;->setVisibility(I)V
goto :goto_1
.line 3329
:cond_6
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsContainer:Lcom/android/systemui/statusbar/phone/QuickSettingsContainerView;
if-eqz v2, :cond_0
[COLOR="Red"]iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsContainer:Lcom/android/systemui/statusbar/phone/QuickSettingsContainerView;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/QuickSettingsContainerView;->removeAllViews()V[/COLOR]
.line 3330
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQS:Lcom/android/systemui/statusbar/phone/QuickSettingsController;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/QuickSettingsController;->setupQuickSettings()V
[COLOR="Red"]iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsContainer:Lcom/android/systemui/statusbar/phone/QuickSettingsContainerView;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/QuickSettingsContainerView;->updateResources()V[/COLOR]
.line 3331
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQuickAccessLayoutLinked:Z
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$5100(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Z
move-result v2
if-eqz v2, :cond_0
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mRibbonQS:Lcom/android/systemui/statusbar/phone/QuickSettingsController;
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$5200(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Lcom/android/systemui/statusbar/phone/QuickSettingsController;
move-result-object v2
if-eqz v2, :cond_0
.line 3332
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mRibbonQS:Lcom/android/systemui/statusbar/phone/QuickSettingsController;
invoke-static {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$5200(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Lcom/android/systemui/statusbar/phone/QuickSettingsController;
move-result-object v2
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/QuickSettingsController;->setupQuickSettings()V
goto/16 :goto_1
.end method
Remove all this lines
Code:
.method public startObserving()V
.locals 4
.prologue
const/4 v3, 0x0
const/4 v2, -0x1
.line 3338
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v1, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
.line 3339
.local v0, cr:Landroid/content/ContentResolver;
const-string v1, "quick_settings_tiles"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3343
const-string v1, "qs_dyanmic_alarm"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3347
const-string v1, "qs_dyanmic_bugreport"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3351
const-string v1, "qs_dyanmic_dock_battery"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3355
const-string v1, "qs_dyanmic_ime"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3359
const-string v1, "qs_dyanmic_usbtether"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3363
const-string v1, "qs_dyanmic_wifi"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3367
const-string v1, "qs_quick_access"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3371
const-string v1, "qs_quick_access_linked"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3375
const-string v1, "quick_settings_ribbon_tiles"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3378
return-void
.end method
Replace with this :
Code:
[COLOR="Blue"].method public startObserving()V
.locals 4
.prologue
const/4 v3, -0x1
const/4 v2, 0x0
.line 3407
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$TilesChangedObserver;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v1, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
.line 3408
.local v0, cr:Landroid/content/ContentResolver;
const-string v1, "quick_settings_tiles"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3412
const-string v1, "qs_dyanmic_alarm"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3416
const-string v1, "qs_dyanmic_bugreport"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3420
const-string v1, "qs_dyanmic_dock_battery"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3424
const-string v1, "qs_dyanmic_ime"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3428
const-string v1, "qs_dyanmic_usbtether"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3432
const-string v1, "qs_dyanmic_wifi"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3436
const-string v1, "qs_quick_access"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3440
const-string v1, "qs_quick_access_linked"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3444
const-string v1, "quick_settings_ribbon_tiles"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 3448
const-string v1, "quick_tiles_per_row"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
.line 3452
const-string v1, "quick_tiles_per_row_duplicate_landscape"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
.line 3456
return-void
.end method[/COLOR]
4. SystemUI.apk/smali/com/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker.smali
remove all lines , and replace with this :
Code:
.class Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;
.super Lcom/android/systemui/statusbar/phone/Ticker;
.source "PhoneStatusBar.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x2
name = "MyTicker"
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
# direct methods
.method constructor <init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/content/Context;Landroid/view/View;)V
.locals 0
.parameter
.parameter "context"
.parameter "sb"
.prologue
.line 2473
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
.line 2474
invoke-direct {p0, p2, p3}, Lcom/android/systemui/statusbar/phone/Ticker;-><init>(Landroid/content/Context;Landroid/view/View;)V
.line 2475
return-void
.end method
# virtual methods
.method public tickerDone()V
.locals 6
.prologue
const/4 v5, 0x0
const v4, 0x10a002d
const/4 v1, 0x0
.line 2492
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V
.line 2493
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V
.line 2494
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickerView:Landroid/view/View;
invoke-static {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$2900(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/view/View;
move-result-object v0
const/16 v1, 0x8
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
.line 2495
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadAnim(ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
invoke-static {v1, v4, v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$3000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->startAnimation(Landroid/view/animation/Animation;)V
.line 2496
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickerView:Landroid/view/View;
invoke-static {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$2900(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/view/View;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
const v2, 0x10a002f
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v3, v3, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickingDoneListener:Landroid/view/animation/Animation$AnimationListener;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadAnim(ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
invoke-static {v1, v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$3000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/View;->startAnimation(Landroid/view/animation/Animation;)V
.line 2498
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadAnim(ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
invoke-static {v1, v4, v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$3000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->startAnimation(Landroid/view/animation/Animation;)V
.line 2501
return-void
.end method
.method public tickerHalting()V
.locals 4
.prologue
const/4 v1, 0x0
const/4 v3, 0x0
const/high16 v2, 0x10a
.line 2504
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
invoke-virtual {v0}, Landroid/widget/LinearLayout;->getVisibility()I
move-result v0
if-eqz v0, :cond_0
.line 2505
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V
.line 2506
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V
.line 2507
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadAnim(ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
invoke-static {v1, v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$3000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->startAnimation(Landroid/view/animation/Animation;)V
.line 2510
:cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickerView:Landroid/view/View;
invoke-static {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$2900(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/view/View;
move-result-object v0
const/16 v1, 0x8
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
.line 2511
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadAnim(ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
invoke-static {v1, v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$3000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->startAnimation(Landroid/view/animation/Animation;)V
.line 2512
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadAnim(ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
invoke-static {v1, v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$3000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->startAnimation(Landroid/view/animation/Animation;)V
.line 2514
return-void
.end method
.method public tickerStarting()V
.locals 5
.prologue
const v4, 0x10a0032
const/16 v2, 0x8
const/4 v3, 0x0
.line 2479
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
const/4 v1, 0x1
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTicking:Z
invoke-static {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$2802(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Z)Z
.line 2480
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
invoke-virtual {v0, v2}, Landroid/widget/LinearLayout;->setVisibility(I)V
.line 2481
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
invoke-virtual {v0, v2}, Landroid/widget/LinearLayout;->setVisibility(I)V
.line 2482
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickerView:Landroid/view/View;
invoke-static {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$2900(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/view/View;
move-result-object v0
const/4 v1, 0x0
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
.line 2483
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickerView:Landroid/view/View;
invoke-static {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$2900(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/view/View;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
const v2, 0x10a0031
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadAnim(ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
invoke-static {v1, v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$3000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/view/View;->startAnimation(Landroid/view/animation/Animation;)V
.line 2484
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadAnim(ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
invoke-static {v1, v4, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$3000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->startAnimation(Landroid/view/animation/Animation;)V
.line 2485
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
#calls: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadAnim(ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
invoke-static {v1, v4, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->access$3000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->startAnimation(Landroid/view/animation/Animation;)V
.line 2488
return-void
.end method
Note !!, make sure for access$xxxx got the correct line in PhoneStatusBar.smali
example
Code:
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->[COLOR="Red"]mTickerView:Landroid/view/View;[/COLOR]
invoke-static {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->[COLOR="Red"]access$2900[/COLOR](Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/view/View;
will get same in PhoneStatusBar.smali
Code:
.method static synthetic [COLOR="Red"]access$2900[/COLOR](Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/view/View;
.locals 1
.parameter "x0"
.prologue
.line 124
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->[COLOR="Red"]mTickerView:Landroid/view/View;[/COLOR]
return-object v0
.end method
5. SystemUI.apk/smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
add the red code
remove the blue code
Code:
.field private mCarrierLabelVisible:Z
[COLOR="Red"].field mCenterClockLayout:Landroid/widget/LinearLayout;[/COLOR]
.field private final mCheckBarModes:Ljava/lang/Runnable;
.field mClearButton:Landroid/view/View;
.field mClearButtonAnim:Landroid/animation/Animator;
.field private mClearButtonListener:Landroid/view/View$OnClickListener;
[COLOR="Blue"].field private mClockEnabled:Z[/COLOR]
[COLOR="Red"].field private mClockClickListener:Landroid/view/View$OnClickListener;[/COLOR]
.field private mCollapseAccelPx:F
.field private mCollapseMinDisplayFraction:F
Code:
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$34;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$34;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStartTracing:Ljava/lang/Runnable;
.line 3154
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$35;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$35;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStopTracing:Ljava/lang/Runnable;
[COLOR="Red"]new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$Adi;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$Adi;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mClockClickListener:Landroid/view/View$OnClickListener;[/COLOR]
.line 3289
return-void
.end method
find this method
Code:
.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
add the red code
and pay attention to the Blue highlight IDs , you must change , match it with your new ids
Code:
const v2, 0x7f070042
invoke-virtual {v0, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/LinearLayout;
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarContents:Landroid/widget/LinearLayout;
[COLOR="Red"]iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, [COLOR="Blue"]0x7f070084[/COLOR]
invoke-virtual {v0, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/LinearLayout;
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;[/COLOR]
.line 616
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v2, 0x7f07004e
invoke-virtual {v0, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickerView:Landroid/view/View;
Code:
const v0, 0x7f0a000b
invoke-virtual {v1, v0}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v0
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHasFlipSettings:Z
.line 635
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanelHeader:Landroid/view/View;
const v2, 0x7f070058
invoke-virtual {v0, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDateTimeView:Landroid/view/View;
[COLOR="Red"]iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDateTimeView:Landroid/view/View;
if-eqz v0, :cond_adi
.line 639
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDateTimeView:Landroid/view/View;
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mClockClickListener:Landroid/view/View$OnClickListener;
invoke-virtual {v0, v2}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
.line 640
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDateTimeView:Landroid/view/View;
invoke-virtual {v0, v6}, Landroid/view/View;->setEnabled(Z)V
:cond_adi[/COLOR]
.line 637
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v2, 0x7f07005d
invoke-virtual {v0, v2}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/ImageView;
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsButton:Landroid/widget/ImageView;
.line 638
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsButton:Landroid/widget/ImageView;
if-eqz v0, :cond_2
.line 639
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsButton:Landroid/widget/ImageView;
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsButtonListener:Landroid/view/View$OnClickListener;
invoke-virtual {v0, v2}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
.line 640
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHasSettingsPanel:Z
Remove this lines
Code:
.method public showClock(Z)V
.locals 0
.parameter "show"
.prologue
.line 1395
iput-boolean p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mShowClock:Z
.line 1396
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateClockVisibility()V
.line 1397
return-void
.end method
replace by this :
Code:
.method public showClock(Z)V
.locals 9
.parameter
.prologue
const/4 v8, -0x2
const/16 v4, 0x8
const/4 v1, 0x1
const/4 v2, 0x0
.line 1401
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
if-nez v0, :cond_1
.line 1417
:cond_0
:goto_0
return-void
.line 1402
:cond_1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
.line 1403
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v5, [COLOR="Blue"]0x7f07004d[/COLOR]
invoke-virtual {v0, v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v5
.line 1404
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v6, [COLOR="Blue"]0x7f070085[/COLOR]
invoke-virtual {v0, v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v6
.line 1405
const-string v0, "status_bar_clock"
invoke-static {v3, v0, v1, v8}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
if-ne v0, v1, :cond_4
move v0, v1
.line 1408
:goto_1
const-string v7, "statusbar_clock_style"
invoke-static {v3, v7, v2, v8}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v7
.line 1411
if-nez v7, :cond_2
if-eqz v5, :cond_2
.line 1412
if-eqz p1, :cond_6
if-eqz v0, :cond_5
move v3, v2
:goto_2
invoke-virtual {v5, v3}, Landroid/view/View;->setVisibility(I)V
.line 1414
:cond_2
if-ne v7, v1, :cond_0
if-eqz v6, :cond_0
.line 1415
if-eqz p1, :cond_3
if-eqz v0, :cond_3
move v4, v2
:cond_3
invoke-virtual {v6, v4}, Landroid/view/View;->setVisibility(I)V
goto :goto_0
:cond_4
move v0, v2
.line 1405
goto :goto_1
:cond_5
move v3, v4
.line 1412
goto :goto_2
:cond_6
move v3, v4
goto :goto_2
.end method
6. SystemUI.apk/smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
Remove this method, and we don't replace it/we don't need it.
Code:
.method private updateClockVisibility()V
.locals 2
.prologue
.line 1400
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
if-nez v0, :cond_1
.line 1405
:cond_0
:goto_0
return-void
.line 1401
:cond_1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v1, 0x7f07004d
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v1
.line 1402
if-eqz v1, :cond_0
.line 1403
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mClockEnabled:Z
if-eqz v0, :cond_2
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mShowClock:Z
if-eqz v0, :cond_2
const/4 v0, 0x0
:goto_1
invoke-virtual {v1, v0}, Landroid/view/View;->setVisibility(I)V
goto :goto_0
:cond_2
const/16 v0, 0x8
goto :goto_1
.end method
next :
remove all this lines
Code:
.method private updateSettings()V
.locals 6
.prologue
const/4 v1, 0x1
const/4 v2, 0x0
.line 2878
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
.line 2879
const-string v0, "screen_brightness_mode"
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCurrentUserId:I
invoke-static {v4, v0, v2, v3}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
.line 2882
if-ne v0, v1, :cond_0
.line 2883
iput-boolean v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBrightnessControl:Z
.line 2889
:goto_0
const-string v0, "status_bar_battery"
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCurrentUserId:I
invoke-static {v4, v0, v2, v3}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v3
.line 2891
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_ICON_PORTRAIT:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
.line 2892
packed-switch v3, :pswitch_data_0
.line 2913
:goto_1
:pswitch_0
const-string v3, "status_bar_battery_show_percent"
iget v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCurrentUserId:I
invoke-static {v4, v3, v2, v5}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v3
if-ne v3, v1, :cond_2
move v3, v1
.line 2916
:goto_2
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryView:Lcom/android/systemui/BatteryMeterView;
invoke-virtual {v5, v0}, Lcom/android/systemui/BatteryMeterView;->setMode(Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;)V
.line 2917
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
invoke-virtual {v5, v0}, Lcom/android/systemui/statusbar/policy/BatteryController;->onBatteryMeterModeChanged(Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;)V
.line 2918
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryView:Lcom/android/systemui/BatteryMeterView;
invoke-virtual {v5, v3}, Lcom/android/systemui/BatteryMeterView;->setShowPercent(Z)V
.line 2919
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
invoke-virtual {v5, v3}, Lcom/android/systemui/statusbar/policy/BatteryController;->onBatteryMeterShowPercent(Z)V
.line 2921
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDockBatteryView:Lcom/android/systemui/DockBatteryMeterView;
invoke-virtual {v5, v0}, Lcom/android/systemui/DockBatteryMeterView;->setMode(Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;)V
.line 2922
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDockBatteryController:Lcom/android/systemui/statusbar/policy/DockBatteryController;
invoke-virtual {v5, v0}, Lcom/android/systemui/statusbar/policy/DockBatteryController;->onBatteryMeterModeChanged(Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;)V
.line 2923
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDockBatteryView:Lcom/android/systemui/DockBatteryMeterView;
invoke-virtual {v0, v3}, Lcom/android/systemui/DockBatteryMeterView;->setShowPercent(Z)V
.line 2924
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDockBatteryController:Lcom/android/systemui/statusbar/policy/DockBatteryController;
invoke-virtual {v0, v3}, Lcom/android/systemui/statusbar/policy/DockBatteryController;->onBatteryMeterShowPercent(Z)V
.line 2926
const-string v0, "status_bar_clock"
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCurrentUserId:I
invoke-static {v4, v0, v1, v3}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
if-eqz v0, :cond_3
:goto_3
iput-boolean v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mClockEnabled:Z
.line 2928
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateClockVisibility()V
.line 2930
const-string v0, "status_bar_signal"
iget v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCurrentUserId:I
invoke-static {v4, v0, v2, v1}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
.line 2933
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSignalClusterView:Lcom/android/systemui/statusbar/SignalClusterView;
invoke-virtual {v1, v0}, Lcom/android/systemui/statusbar/SignalClusterView;->setStyle(I)V
.line 2934
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSignalTextView:Lcom/android/systemui/statusbar/SignalClusterTextView;
invoke-virtual {v1, v0}, Lcom/android/systemui/statusbar/SignalClusterTextView;->setStyle(I)V
.line 2935
return-void
.line 2885
:cond_0
const-string v0, "status_bar_brightness_control"
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCurrentUserId:I
invoke-static {v4, v0, v2, v3}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
if-ne v0, v1, :cond_1
move v0, v1
:goto_4
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBrightnessControl:Z
goto :goto_0
:cond_1
move v0, v2
goto :goto_4
.line 2894
:pswitch_1
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_CIRCLE:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
goto :goto_1
.line 2898
:pswitch_2
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_GONE:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
goto :goto_1
.line 2902
:pswitch_3
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_ICON_LANDSCAPE:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
goto :goto_1
.line 2906
:pswitch_4
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_TEXT:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
goto :goto_1
:cond_2
move v3, v2
.line 2913
goto :goto_2
:cond_3
move v1, v2
.line 2926
goto :goto_3
.line 2892
:pswitch_data_0
.packed-switch 0x2
:pswitch_1
:pswitch_0
:pswitch_2
:pswitch_3
:pswitch_4
.end packed-switch
.end method
replace by this :
Code:
.method private updateSettings()V
.locals 5
.prologue
const/4 v1, 0x1
const/4 v2, 0x0
.line 2908
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
.line 2910
const-string v0, "screen_brightness_mode"
invoke-static {v3, v0, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-ne v0, v1, :cond_0
move v0, v1
.line 2913
:goto_0
if-nez v0, :cond_1
const-string v0, "status_bar_brightness_control"
invoke-static {v3, v0, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-ne v0, v1, :cond_1
move v0, v1
:goto_1
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBrightnessControl:Z
.line 2916
const-string v0, "status_bar_battery"
invoke-static {v3, v0, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
.line 2917
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_ICON_PORTRAIT:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
.line 2918
packed-switch v4, :pswitch_data_0
.line 2935
:goto_2
:pswitch_0
const-string v4, "status_bar_battery_show_percent"
invoke-static {v3, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-ne v4, v1, :cond_2
.line 2938
:goto_3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryView:Lcom/android/systemui/BatteryMeterView;
invoke-virtual {v4, v0}, Lcom/android/systemui/BatteryMeterView;->setMode(Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;)V
.line 2939
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
invoke-virtual {v4, v0}, Lcom/android/systemui/statusbar/policy/BatteryController;->onBatteryMeterModeChanged(Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;)V
.line 2940
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryView:Lcom/android/systemui/BatteryMeterView;
invoke-virtual {v4, v1}, Lcom/android/systemui/BatteryMeterView;->setShowPercent(Z)V
.line 2941
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
invoke-virtual {v4, v1}, Lcom/android/systemui/statusbar/policy/BatteryController;->onBatteryMeterShowPercent(Z)V
.line 2943
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDockBatteryView:Lcom/android/systemui/DockBatteryMeterView;
invoke-virtual {v4, v0}, Lcom/android/systemui/DockBatteryMeterView;->setMode(Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;)V
.line 2944
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDockBatteryController:Lcom/android/systemui/statusbar/policy/DockBatteryController;
invoke-virtual {v4, v0}, Lcom/android/systemui/statusbar/policy/DockBatteryController;->onBatteryMeterModeChanged(Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;)V
.line 2945
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDockBatteryView:Lcom/android/systemui/DockBatteryMeterView;
invoke-virtual {v0, v1}, Lcom/android/systemui/DockBatteryMeterView;->setShowPercent(Z)V
.line 2946
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDockBatteryController:Lcom/android/systemui/statusbar/policy/DockBatteryController;
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/policy/DockBatteryController;->onBatteryMeterShowPercent(Z)V
.line 2948
const-string v0, "status_bar_signal"
invoke-static {v3, v0, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
.line 2950
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSignalClusterView:Lcom/android/systemui/statusbar/SignalClusterView;
invoke-virtual {v1, v0}, Lcom/android/systemui/statusbar/SignalClusterView;->setStyle(I)V
.line 2951
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSignalTextView:Lcom/android/systemui/statusbar/SignalClusterTextView;
invoke-virtual {v1, v0}, Lcom/android/systemui/statusbar/SignalClusterTextView;->setStyle(I)V
.line 2952
return-void
:cond_0
move v0, v2
.line 2910
goto :goto_0
:cond_1
move v0, v2
.line 2913
goto :goto_1
.line 2920
:pswitch_1
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_CIRCLE:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
goto :goto_2
.line 2924
:pswitch_2
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_GONE:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
goto :goto_2
.line 2928
:pswitch_3
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_ICON_LANDSCAPE:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
goto :goto_2
:pswitch_4
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_TEXT:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
goto :goto_2
:cond_2
move v1, v2
.line 2935
goto :goto_3
.line 2918
nop
:pswitch_data_0
.packed-switch 0x2
:pswitch_1
:pswitch_0
:pswitch_2
:pswitch_3
:pswitch_4
.end packed-switch
.end method
NEW CODE !! sync with latest CM11 source ,17 march 2014
do not delete this method
Code:
.method private updateClockVisibility()V
but change it to like this :
Code:
.method private updateClockVisibility()V
.locals 7
.prologue
const/16 v2, 0x8
const/4 v1, 0x0
.line 1860
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
if-nez v0, :cond_1
.line 1874
:cond_0
:goto_0
return-void
.line 1861
:cond_1
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
.line 1862
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
[COLOR="Red"]const v4, 0x7f080035[/COLOR]
invoke-virtual {v3, v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v3
.line 1864
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
[COLOR="Red"]const v5, 0x7f080097[/COLOR]
invoke-virtual {v4, v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v4
.line 1865
const-string v5, "statusbar_clock_style"
const/4 v6, -0x2
invoke-static {v0, v5, v1, v6}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v5
.line 1868
if-nez v5, :cond_2
if-eqz v3, :cond_2
.line 1869
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mClockEnabled:Z
if-eqz v0, :cond_3
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mShowClock:Z
if-eqz v0, :cond_3
move v0, v1
:goto_1
invoke-virtual {v3, v0}, Landroid/view/View;->setVisibility(I)V
.line 1871
:cond_2
const/4 v0, 0x1
if-ne v5, v0, :cond_0
if-eqz v4, :cond_0
.line 1872
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mClockEnabled:Z
if-eqz v0, :cond_4
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mShowClock:Z
if-eqz v0, :cond_4
:goto_2
invoke-virtual {v4, v1}, Landroid/view/View;->setVisibility(I)V
goto :goto_0
:cond_3
move v0, v2
.line 1869
goto :goto_1
:cond_4
move v1, v2
.line 1872
goto :goto_2
.end method
const v4, 0x7f080035 <public type="id" name="clock" id="0x7f??????" />
const v5, 0x7f080097 <public type="id" name="center_clock" id="0x7f??????" />
keep this method stock
Code:
.method private updateSettings()V
.locals 6
.prologue
const/4 v1, 0x1
const/4 v2, 0x0
.line 3029
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
.line 3030
const-string v0, "screen_brightness_mode"
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCurrentUserId:I
invoke-static {v4, v0, v2, v3}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
.line 3033
if-ne v0, v1, :cond_1
.line 3034
iput-boolean v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBrightnessControl:Z
.line 3040
:goto_0
const-string v0, "status_bar_battery"
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCurrentUserId:I
invoke-static {v4, v0, v2, v3}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v3
.line 3042
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_ICON_PORTRAIT:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
.line 3043
packed-switch v3, :pswitch_data_0
.line 3064
:goto_1
:pswitch_0
const-string v3, "status_bar_battery_show_percent"
iget v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCurrentUserId:I
invoke-static {v4, v3, v2, v5}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v3
if-ne v3, v1, :cond_3
move v3, v1
.line 3067
:goto_2
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryView:Lcom/android/systemui/BatteryMeterView;
invoke-virtual {v5, v0}, Lcom/android/systemui/BatteryMeterView;->setMode(Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;)V
.line 3068
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
invoke-virtual {v5, v0}, Lcom/android/systemui/statusbar/policy/BatteryController;->onBatteryMeterModeChanged(Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;)V
.line 3069
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryView:Lcom/android/systemui/BatteryMeterView;
invoke-virtual {v5, v3}, Lcom/android/systemui/BatteryMeterView;->setShowPercent(Z)V
.line 3070
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
invoke-virtual {v5, v3}, Lcom/android/systemui/statusbar/policy/BatteryController;->onBatteryMeterShowPercent(Z)V
.line 3072
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDockBatteryView:Lcom/android/systemui/DockBatteryMeterView;
invoke-virtual {v5, v0}, Lcom/android/systemui/DockBatteryMeterView;->setMode(Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;)V
.line 3073
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDockBatteryController:Lcom/android/systemui/statusbar/policy/DockBatteryController;
invoke-virtual {v5, v0}, Lcom/android/systemui/statusbar/policy/DockBatteryController;->onBatteryMeterModeChanged(Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;)V
.line 3074
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDockBatteryView:Lcom/android/systemui/DockBatteryMeterView;
invoke-virtual {v0, v3}, Lcom/android/systemui/DockBatteryMeterView;->setShowPercent(Z)V
.line 3075
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDockBatteryController:Lcom/android/systemui/statusbar/policy/DockBatteryController;
invoke-virtual {v0, v3}, Lcom/android/systemui/statusbar/policy/DockBatteryController;->onBatteryMeterShowPercent(Z)V
.line 3077
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNavigationBarView:Lcom/android/systemui/statusbar/phone/NavigationBarView;
if-eqz v0, :cond_0
.line 3078
const-string v0, "navigation_bar_left"
invoke-static {v4, v0, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-ne v0, v1, :cond_4
move v0, v1
.line 3080
:goto_3
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNavigationBarView:Lcom/android/systemui/statusbar/phone/NavigationBarView;
invoke-virtual {v3, v0}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->setLeftInLandscape(Z)V
.line 3083
:cond_0
const-string v0, "status_bar_clock"
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCurrentUserId:I
invoke-static {v4, v0, v1, v3}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
if-eqz v0, :cond_5
:goto_4
iput-boolean v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mClockEnabled:Z
.line 3085
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateClockVisibility()V
.line 3087
const-string v0, "status_bar_signal"
iget v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCurrentUserId:I
invoke-static {v4, v0, v2, v1}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
.line 3090
invoke-static {}, Landroid/telephony/MSimTelephonyManager;->getDefault()Landroid/telephony/MSimTelephonyManager;
move-result-object v1
invoke-virtual {v1}, Landroid/telephony/MSimTelephonyManager;->isMultiSimEnabled()Z
move-result v1
if-eqz v1, :cond_6
.line 3091
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mMSimSignalClusterView:Lcom/android/systemui/statusbar/MSimSignalClusterView;
invoke-virtual {v1, v0}, Lcom/android/systemui/statusbar/MSimSignalClusterView;->setStyle(I)V
.line 3096
:goto_5
return-void
.line 3036
:cond_1
const-string v0, "status_bar_brightness_control"
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCurrentUserId:I
invoke-static {v4, v0, v2, v3}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
if-ne v0, v1, :cond_2
move v0, v1
:goto_6
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBrightnessControl:Z
goto/16 :goto_0
:cond_2
move v0, v2
goto :goto_6
.line 3045
:pswitch_1
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_CIRCLE:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
goto :goto_1
.line 3049
:pswitch_2
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_GONE:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
goto/16 :goto_1
.line 3053
:pswitch_3
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_ICON_LANDSCAPE:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
goto/16 :goto_1
.line 3057
:pswitch_4
sget-object v0, Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;->BATTERY_METER_TEXT:Lcom/android/systemui/BatteryMeterView$BatteryMeterMode;
goto/16 :goto_1
:cond_3
move v3, v2
.line 3064
goto/16 :goto_2
:cond_4
move v0, v2
.line 3078
goto :goto_3
:cond_5
move v1, v2
.line 3083
goto :goto_4
.line 3093
:cond_6
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSignalClusterView:Lcom/android/systemui/statusbar/SignalClusterView;
invoke-virtual {v1, v0}, Lcom/android/systemui/statusbar/SignalClusterView;->setStyle(I)V
.line 3094
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSignalTextView:Lcom/android/systemui/statusbar/SignalClusterTextView;
invoke-virtual {v1, v0}, Lcom/android/systemui/statusbar/SignalClusterTextView;->setStyle(I)V
goto :goto_5
.line 3043
nop
:pswitch_data_0
.packed-switch 0x2
:pswitch_1
:pswitch_0
:pswitch_2
:pswitch_3
:pswitch_4
.end packed-switch
.end method
and also keep this method stock
Code:
.method public showClock(Z)V
.locals 0
.parameter "show"
.prologue
.line 1505
iput-boolean p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mShowClock:Z
.line 1506
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateClockVisibility()V
.line 1507
return-void
.end method
Done and recompile your SystemUI.apk ,
Next continue to STEP-2
STEP-2
Decompile the newly Recompiled APK again
- Next go to res/values/public.xml
open it with Notepad++
leave it, but keep it open
- Download attached on_the_fly_CM11_SystemUI.apk_public.xml
so now you have two public.xml which is opened in the Notepad++
1. your secondly decompiled SystemUI.apk public.xml and
2. on_the_fly_CM11_SystemUI.apk_public.xml
- Next go to all smalis you've merged to your SystemUI.apk
find all ids which is started with :
Code:
0x7f[COLOR="Red"]xxxxxx[/COLOR]
and search it in on_the_fly_CM11_SystemUI.apk_public.xml
change, match the ids in the smali with your own new secondly decompiled public.xml
don't forget to do it too, to Blue highlight IDs in PhoneStatusBar.smali
Done and recompile your SystemUI.apk
NAVIGATION BAR
STEP-1
Decompile framework-res.apk
framework-res.apk\res\values
bools.xml
change to "true"
Code:
<bool name="config_showNavigationBar">[COLOR="Red"]true[/COLOR]</bool>
STEP-2
Decompile android.policy.jar
1. com/android/internal/policy/impl/PhoneWindowManager$SettingsObserver.smali
add the blue code
Code:
const-string v1, "key_app_switch_long_press_action"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 661
const-string v1, "hardware_key_rebinding"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
[COLOR="Blue"]const-string v1, "navigation_bar_show"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 711
const-string v1, "navigation_bar_height"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
.line 714
const-string v1, "navigation_bar_width"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v3, p0, v2}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V[/COLOR]
.line 665
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$SettingsObserver;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
invoke-virtual {v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->updateSettings()V
.line 666
return-void
.end method
.method public onChange(Z)V
.registers 4
.parameter "selfChange"
2. com/android/internal/policy/impl/PhoneWindowManager.smali
find this method and remove all line in the method
Code:
.method public setInitialDisplaySize(Landroid/view/Display;III)V
-
-
remove all
-
-
.end method
replaced with this
Code:
.method public setInitialDisplaySize(Landroid/view/Display;III)V
.registers 15
.parameter "display"
.parameter "width"
.parameter "height"
.parameter "density"
.prologue
.line 1399
iget-object v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
if-eqz v7, :cond_a
invoke-virtual {p1}, Landroid/view/Display;->getDisplayId()I
move-result v7
if-eqz v7, :cond_b
.line 1476
:cond_a
:goto_a
return-void
.line 1402
:cond_b
iput-object p1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mDisplay:Landroid/view/Display;
.line 1404
iget-object v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v7}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
.line 1406
.local v3, res:Landroid/content/res/Resources;
if-le p2, p3, :cond_c2
.line 1407
move v4, p3
.line 1408
.local v4, shortSize:I
move v0, p2
.line 1409
.local v0, longSize:I
const/4 v7, 0x0
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLandscapeRotation:I
.line 1410
const/4 v7, 0x2
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSeascapeRotation:I
.line 1411
const v7, 0x1110022
invoke-virtual {v3, v7}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v7
if-eqz v7, :cond_ba
.line 1412
const/4 v7, 0x1
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPortraitRotation:I
.line 1413
const/4 v7, 0x3
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUpsideDownRotation:I
.line 1432
:goto_2c
const v7, 0x105000c
invoke-virtual {v3, v7}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v7
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBarHeight:I
.line 1436
mul-int/lit16 v7, v4, 0xa0
div-int v5, v7, p4
.line 1437
.local v5, shortSizeDp:I
mul-int/lit16 v7, v0, 0xa0
div-int v1, v7, p4
.line 1440
.local v1, longSizeDp:I
const/16 v7, 0x258
if-ge v5, v7, :cond_e3
const/4 v7, 0x1
:goto_42
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarCanMove:Z
.line 1442
iget-object v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v7}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v7
const v8, 0x111004e
invoke-virtual {v7, v8}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v7
if-eqz v7, :cond_e6
const/4 v6, 0x1
.line 1444
.local v6, showByDefault:I
:goto_54
iget-object v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v7}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v7
const-string v8, "navigation_bar_show"
const/4 v9, -0x2
invoke-static {v7, v8, v6, v9}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v7
const/4 v8, 0x1
if-ne v7, v8, :cond_e9
const/4 v7, 0x1
:goto_65
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHasNavigationBar:Z
.line 1450
const-string v7, "qemu.hw.mainkeys"
invoke-static {v7}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;
move-result-object v2
.line 1451
.local v2, navBarOverride:Ljava/lang/String;
const-string v7, "1"
invoke-virtual {v7, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v7
if-eqz v7, :cond_ec
.line 1452
const/4 v7, 0x0
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHasNavigationBar:Z
.line 1453
const/4 v7, 0x1
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mOverWriteHasNavigationBar:Z
.line 1461
:cond_7b
:goto_7b
const-string v7, "portrait"
const-string v8, "persist.demo.hdmirotation"
invoke-static {v8}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;
move-result-object v8
invoke-virtual {v7, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v7
if-eqz v7, :cond_fb
.line 1462
iget v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPortraitRotation:I
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mDemoHdmiRotation:I
.line 1466
:goto_8d
const-string v7, "persist.demo.hdmirotationlock"
const/4 v8, 0x0
invoke-static {v7, v8}, Landroid/os/SystemProperties;->getBoolean(Ljava/lang/String;Z)Z
move-result v7
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mDemoHdmiRotationLock:Z
.line 1470
const/16 v7, 0x3c0
if-lt v1, v7, :cond_100
const/16 v7, 0x2d0
if-lt v5, v7, :cond_100
const v7, 0x1110061
invoke-virtual {v3, v7}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v7
if-eqz v7, :cond_100
const-string v7, "true"
const-string v8, "config.override_forced_orient"
invoke-static {v8}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;
move-result-object v8
invoke-virtual {v7, v8}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v7
if-nez v7, :cond_100
const/4 v7, 0x1
:goto_b6
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mForceDefaultOrientation:Z
goto/16 :goto_a
.line 1415
.end local v1 #longSizeDp:I
.end local v2 #navBarOverride:Ljava/lang/String;
.end local v5 #shortSizeDp:I
.end local v6 #showByDefault:I
:cond_ba
const/4 v7, 0x3
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPortraitRotation:I
.line 1416
const/4 v7, 0x1
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUpsideDownRotation:I
goto/16 :goto_2c
.line 1419
.end local v0 #longSize:I
.end local v4 #shortSize:I
:cond_c2
move v4, p2
.line 1420
.restart local v4 #shortSize:I
move v0, p3
.line 1421
.restart local v0 #longSize:I
const/4 v7, 0x0
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPortraitRotation:I
.line 1422
const/4 v7, 0x2
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUpsideDownRotation:I
.line 1423
const v7, 0x1110022
invoke-virtual {v3, v7}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v7
if-eqz v7, :cond_db
.line 1424
const/4 v7, 0x3
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLandscapeRotation:I
.line 1425
const/4 v7, 0x1
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSeascapeRotation:I
goto/16 :goto_2c
.line 1427
:cond_db
const/4 v7, 0x1
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLandscapeRotation:I
.line 1428
const/4 v7, 0x3
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSeascapeRotation:I
goto/16 :goto_2c
.line 1440
.restart local v1 #longSizeDp:I
.restart local v5 #shortSizeDp:I
:cond_e3
const/4 v7, 0x0
goto/16 :goto_42
.line 1442
:cond_e6
const/4 v6, 0x0
goto/16 :goto_54
.line 1444
.restart local v6 #showByDefault:I
:cond_e9
const/4 v7, 0x0
goto/16 :goto_65
.line 1454
.restart local v2 #navBarOverride:Ljava/lang/String;
:cond_ec
const-string v7, "0"
invoke-virtual {v7, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v7
if-eqz v7, :cond_7b
.line 1455
const/4 v7, 0x1
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHasNavigationBar:Z
.line 1456
const/4 v7, 0x1
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mOverWriteHasNavigationBar:Z
goto :goto_7b
.line 1464
:cond_fb
iget v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLandscapeRotation:I
iput v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mDemoHdmiRotation:I
goto :goto_8d
.line 1470
:cond_100
const/4 v7, 0x0
goto :goto_b6
.end method
next find this method
and re move all line in the method
Code:
.method public updateSettings()V
-
-
remove all
-
-
.end method
and replaced with this
Code:
.method public updateSettings()V
.registers 28
.prologue
.line 1502
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v9}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
.line 1503
.local v4, resolver:Landroid/content/ContentResolver;
const/4 v6, 0x0
.line 1504
.local v6, updateRotation:Z
move-object/from16 v0, p0
iget-object v10, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLock:Ljava/lang/Object;
monitor-enter v10
.line 1505
:try_start_e
const-string v9, "end_button_behavior"
const/4 v11, 0x2
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
move-object/from16 v0, p0
iput v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mEndcallBehavior:I
.line 1509
const-string v9, "incall_power_button_behavior"
const/4 v11, 0x1
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$Secure;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
move-object/from16 v0, p0
iput v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIncallPowerBehavior:I
.line 1513
const-string v9, "ring_home_button_behavior"
const/4 v11, 0x1
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$Secure;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
move-object/from16 v0, p0
iput v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mRingHomeBehavior:I
.line 1517
const-string v9, "home_wake_screen"
const/4 v11, 0x1
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
const/4 v11, 0x1
if-ne v9, v11, :cond_1a5
const/4 v9, 0x1
:goto_3e
move-object/from16 v0, p0
iput-boolean v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomeWakeScreen:Z
.line 1519
const-string v9, "volume_wake_screen"
const/4 v11, 0x0
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
const/4 v11, 0x1
if-ne v9, v11, :cond_1a8
const/4 v9, 0x1
:goto_4e
move-object/from16 v0, p0
iput-boolean v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeWakeScreen:Z
.line 1521
const-string v9, "volbtn_music_controls"
const/4 v11, 0x1
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
const/4 v11, 0x1
if-ne v9, v11, :cond_1ab
const/4 v9, 0x1
:goto_5e
move-object/from16 v0, p0
iput-boolean v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:Z
.line 1524
const-string v9, "expanded_desktop_style"
const/4 v11, 0x0
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
move-object/from16 v0, p0
iput v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mExpandedDesktopStyle:I
.line 1526
const-string v9, "expanded_desktop_state"
const/4 v11, 0x0
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
if-nez v9, :cond_7d
.line 1528
const/4 v9, 0x0
move-object/from16 v0, p0
iput v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mExpandedDesktopStyle:I
.line 1531
:cond_7d
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->updateKeyAssignments()V
.line 1534
const-string v9, "user_rotation"
const/4 v11, 0x0
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v7
.line 1538
.local v7, userRotation:I
move-object/from16 v0, p0
iget v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotation:I
if-eq v9, v7, :cond_93
.line 1539
move-object/from16 v0, p0
iput v7, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotation:I
.line 1540
const/4 v6, 0x1
.line 1542
:cond_93
const-string v9, "accelerometer_rotation"
const/4 v11, 0x0
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
if-eqz v9, :cond_1ae
const/4 v8, 0x0
.line 1546
.local v8, userRotationMode:I
:goto_9e
move-object/from16 v0, p0
iget v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotationMode:I
if-eq v9, v8, :cond_ac
.line 1547
move-object/from16 v0, p0
iput v8, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotationMode:I
.line 1548
const/4 v6, 0x1
.line 1549
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->updateOrientationListenerLp()V
.line 1552
:cond_ac
const-string v9, "accelerometer_rotation_angles"
const/4 v11, -0x1
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
move-object/from16 v0, p0
iput v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotationAngles:I
.line 1556
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v9}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v9
const v11, 0x111004e
invoke-virtual {v9, v11}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v9
if-eqz v9, :cond_1b1
const/4 v5, 0x1
.line 1558
.local v5, showByDefault:I
:goto_ca
const-string v9, "navigation_bar_show"
const/4 v11, -0x2
invoke-static {v4, v9, v5, v11}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
const/4 v11, 0x1
if-ne v9, v11, :cond_1b4
const/4 v9, 0x1
:goto_d5
move-object/from16 v0, p0
iput-boolean v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHasNavigationBar:Z
.line 1562
move-object/from16 v0, p0
iget-boolean v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHasNavigationBar:Z
if-nez v9, :cond_1b7
.line 1564
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v0, p0
iget v11, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPortraitRotation:I
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v0, p0
iget v13, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUpsideDownRotation:I
move-object/from16 v0, p0
iget-object v14, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v0, p0
iget v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLandscapeRotation:I
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v16, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSeascapeRotation:I
move/from16 v17, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v18, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPortraitRotation:I
move/from16 v19, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v20, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUpsideDownRotation:I
move/from16 v21, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v22, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLandscapeRotation:I
move/from16 v23, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v24, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSeascapeRotation:I
move/from16 v25, v0
const/16 v26, 0x0
aput v26, v24, v25
aput v26, v22, v23
aput v26, v20, v21
aput v26, v18, v19
aput v26, v16, v17
aput v26, v14, v15
aput v26, v12, v13
aput v26, v9, v11
.line 1598
:goto_145
move-object/from16 v0, p0
iget-boolean v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemReady:Z
if-eqz v9, :cond_167
.line 1599
const-string v9, "pointer_location"
const/4 v11, 0x0
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v3
.line 1601
.local v3, pointerLocation:I
move-object/from16 v0, p0
iget v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPointerLocationMode:I
if-eq v9, v3, :cond_167
.line 1602
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPointerLocationMode:I
.line 1603
move-object/from16 v0, p0
iget-object v11, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
if-eqz v3, :cond_240
const/4 v9, 0x1
:goto_164
invoke-virtual {v11, v9}, Landroid/os/Handler;->sendEmptyMessage(I)Z
.line 1609
.end local v3 #pointerLocation:I
:cond_167
const-string v9, "screen_off_timeout"
const/4 v11, 0x0
const/4 v12, -0x2
invoke-static {v4, v9, v11, v12}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v9
move-object/from16 v0, p0
iput v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLockScreenTimeout:I
.line 1611
const-string v9, "default_input_method"
const/4 v11, -0x2
invoke-static {v4, v9, v11}, Landroid/provider/Settings$Secure;->getStringForUser(Landroid/content/ContentResolver;Ljava/lang/String;I)Ljava/lang/String;
move-result-object v2
.line 1613
.local v2, imId:Ljava/lang/String;
if-eqz v2, :cond_243
invoke-virtual {v2}, Ljava/lang/String;->length()I
move-result v9
if-lez v9, :cond_243
const/4 v1, 0x1
.line 1614
.local v1, hasSoftInput:Z
:goto_183
move-object/from16 v0, p0
iget-boolean v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHasSoftInput:Z
if-eq v9, v1, :cond_18e
.line 1615
move-object/from16 v0, p0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHasSoftInput:Z
.line 1616
const/4 v6, 0x1
.line 1618
:cond_18e
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mImmersiveModeConfirmation:Lcom/android/internal/policy/impl/ImmersiveModeConfirmation;
if-eqz v9, :cond_19b
.line 1619
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mImmersiveModeConfirmation:Lcom/android/internal/policy/impl/ImmersiveModeConfirmation;
invoke-virtual {v9}, Lcom/android/internal/policy/impl/ImmersiveModeConfirmation;->loadSetting()V
.line 1621
:cond_19b
monitor-exit v10
:try_end_19c
.catchall {:try_start_e .. :try_end_19c} :catchall_23d
.line 1623
if-eqz v6, :cond_1a4
.line 1624
const/4 v9, 0x1
move-object/from16 v0, p0
invoke-virtual {v0, v9}, Lcom/android/internal/policy/impl/PhoneWindowManager;->updateRotation(Z)V
.line 1626
:cond_1a4
return-void
.line 1517
.end local v1 #hasSoftInput:Z
.end local v2 #imId:Ljava/lang/String;
.end local v5 #showByDefault:I
.end local v7 #userRotation:I
.end local v8 #userRotationMode:I
:cond_1a5
const/4 v9, 0x0
goto/16 :goto_3e
.line 1519
:cond_1a8
const/4 v9, 0x0
goto/16 :goto_4e
.line 1521
:cond_1ab
const/4 v9, 0x0
goto/16 :goto_5e
.line 1542
.restart local v7 #userRotation:I
:cond_1ae
const/4 v8, 0x1
goto/16 :goto_9e
.line 1556
.restart local v8 #userRotationMode:I
:cond_1b1
const/4 v5, 0x0
goto/16 :goto_ca
.line 1558
.restart local v5 #showByDefault:I
:cond_1b4
const/4 v9, 0x0
goto/16 :goto_d5
.line 1574
:cond_1b7
:try_start_1b7
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v0, p0
iget v11, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPortraitRotation:I
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarHeightForRotation:[I
move-object/from16 v0, p0
iget v13, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUpsideDownRotation:I
move-object/from16 v0, p0
iget-object v14, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v14}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v14
const-string v15, "navigation_bar_height"
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
move-object/from16 v16, v0
invoke-virtual/range {v16 .. v16}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v16
const v17, 0x105000d
invoke-virtual/range {v16 .. v17}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v16
const/16 v17, -0x2
invoke-static/range {v14 .. v17}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v14
aput v14, v12, v13
aput v14, v9, v11
.line 1585
move-object/from16 v0, p0
iget-object v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v0, p0
iget v11, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPortraitRotation:I
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v0, p0
iget v13, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUpsideDownRotation:I
move-object/from16 v0, p0
iget-object v14, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v0, p0
iget v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLandscapeRotation:I
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBarWidthForRotation:[I
move-object/from16 v16, v0
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSeascapeRotation:I
move/from16 v17, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
move-object/from16 v18, v0
invoke-virtual/range {v18 .. v18}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v18
const-string v19, "navigation_bar_width"
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
move-object/from16 v20, v0
invoke-virtual/range {v20 .. v20}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v20
const v21, 0x105000f
invoke-virtual/range {v20 .. v21}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v20
const/16 v21, -0x2
invoke-static/range {v18 .. v21}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v18
aput v18, v16, v17
aput v18, v14, v15
aput v18, v12, v13
aput v18, v9, v11
goto/16 :goto_145
.line 1621
.end local v5 #showByDefault:I
.end local v7 #userRotation:I
.end local v8 #userRotationMode:I
:catchall_23d
move-exception v9
monitor-exit v10
:try_end_23f
.catchall {:try_start_1b7 .. :try_end_23f} :catchall_23d
throw v9
.line 1603
.restart local v3 #pointerLocation:I
.restart local v5 #showByDefault:I
.restart local v7 #userRotation:I
.restart local v8 #userRotationMode:I
:cond_240
const/4 v9, 0x2
goto/16 :goto_164
.line 1613
.end local v3 #pointerLocation:I
.restart local v2 #imId:Ljava/lang/String;
:cond_243
const/4 v1, 0x0
goto/16 :goto_183
.end method
Done , Enjoy !
proof & screenshot http://forum.xda-developers.com/showthread.php?t=2557122
Credit & Thanks :
- Recognized developer Arco
- Recognized developer Educk
- Paranoid Android
- Cristiano Matos
- crDroid team
- CyanogenMod team
- AOKP team
- Carbon rom team
- Chameleon OS team
- Slimbean team
pertamax save :laugh:
nice guide :fingers-crossed:
eddy_nugroz said:
pertamax save :laugh:
nice guide :fingers-crossed:
Click to expand...
Click to collapse
ok, ok, ok .. hahaha :good::laugh:
Updated
I added wrong smali for PhoneStatusBar$MyTicker.smali
so there is new code for that smali
thanks
Will this guide work on JB 4.2/CM10.1?
sir @Adi Aisiteru Reborn, will this guide work on JB 4.2/CM10.1? I mean only to enable the navigation bar button? i have follow a guide from another thread to show the navigation bar but it's not work on mine. Since i have edit the framework-res.apk bool.xml, the navigation bar doesn't showed.
Btw, you're Rock Sir...keep it up with other nicely guide
blu3m4n said:
sir @Adi Aisiteru Reborn, will this guide work on JB 4.2/CM10.1? I mean only to enable the navigation bar button? i have follow a guide from another thread to show the navigation bar but it's not work on mine. Since i have edit the framework-res.apk bool.xml, the navigation bar doesn't showed.
Btw, you're Rock Sir...keep it up with other nicely guide
Click to expand...
Click to collapse
I think you can try to start it from here, http://forum.xda-developers.com/showthread.php?t=2499075
Compare my CM10.1 mod with your stock file.
Remember per OP said that this thread is for CM11, don't take any risk
Sent from my GT-I8150 using xda app-developers app
Yeah, success with this guide
Big thanks sir
nice guide
work at GT-I9082, tanks
error
i get errors recompiling. which tool should i use? what do you mean by going to the smalis and doing the oxf stuff?
GHE_1908 said:
i get errors recompiling. which tool should i use? what do you mean by going to the smalis and doing the oxf stuff?
Click to expand...
Click to collapse
and what tool u usually use for compile/decompile CM11 ?,
I have enough giving information in the guide.
search all ids number which is started with 0x7fxxxxxx in all smalis I gave, and find that in my public xml what is for.
can be layout of what, strings of what, id of what, xml of what, drawable of what, etc..
next if you find it already then search it in your own public.xml, and change the number in the smali according to your own public.xml
Adi Aisiteru Reborn said:
and what tool u usually use for compile/decompile CM11 ?,
I have enough giving information in the guide.
search all ids number which is started with 0x7fxxxxxx in all smalis I gave, and find that in my public xml what is for.
can be layout of what, strings of what, id of what, xml of what, drawable of what, etc..
next if you find it already then search it in your own public.xml, and change the number in the smali according to your own public.xml
Click to expand...
Click to collapse
apktool beta by ibanez7 for kitkat
GHE_1908 said:
apktool beta by ibanez7 for kitkat
Click to expand...
Click to collapse
don't care what tool u ussualy use, so what is the error ?.
have u tried decompile and recompile apk back without change anythng yet ?

How to create Custom Button OnClick (CM7.2)

Hello
I share my Mod
Decompile your SystemUI (with Apk Multi Tool or other tool)
Code:
Go to smali/android/systemui/statusbar and open StatusBarService.Smali
and find
Code:
.method public settingsButton(Landroid/view/View;)V
.locals 3
.parameter "v"
.prologue
.line 1717
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v0
new-instance v1, Landroid/content/Intent;
const-string v2, "android.settings.SETTINGS"
invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
const/high16 v2, 0x1000
invoke-virtual {v1, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
invoke-virtual {p0}, Lcom/android/systemui/statusbar/StatusBarService;->animateCollapse()V
.line 1720
return-void
.end method
below just copy and paste the code
Code:
.method public zorekhcustombutton(Landroid/view/View;)V
.locals 11
.parameter "v"
.prologue
new-instance v0, Landroid/content/Intent;
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
invoke-virtual {p1}, Landroid/view/View;->getTag()Ljava/lang/Object;
move-result-object v5
check-cast v5, Ljava/lang/String;
:try_start_0
const-string v3, ","
invoke-virtual {v5, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;
move-result-object v6
const/4 v4, 0x0
aget-object v4, v6, v4
const/4 v7, 0x1
aget-object v7, v6, v7
invoke-virtual {v0, v4, v7}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/high16 v2, 0x1000
invoke-virtual {v0, v2}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
move-result-object v0
invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
:goto_0
const-string v1, "statusbar"
invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/StatusBarManager;
invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V
return-void
:catch_0
move-exception v0
.local v0, e:Ljava/lang/Exception;
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
const-string v10, "Error:\n"
invoke-virtual {v10, v5}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object v5
const/16 v9, 0x7d0
invoke-static {p0, v5, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v8
invoke-virtual {v8}, Landroid/widget/Toast;->show()V
goto :goto_0
.end method
use now
Code:
android:tag="Package,Activity" to insert the activity to open
android:onClick="zorekhcustombutton"
Sorry for mi bad english ​
Nice work mate! I was just googling for quick reference to start activity in smali, and this is best result so far. Some suggestions though:
Add to title or subtitle something like "Start Activity from XML tag in Smali"
And maybe some comments in your code like this:
Code:
# v0 is an instance of Intent
# v4 is the packageName, e.g. "com.android.settings"
# v7 is the className, e.g. ".DateTimeSettingsSetupWizard"
invoke-virtual {v0, v4, v7}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
[code]
Cheers! :D

[GUIDE / HOW-TO] Add screen off animations to KitKat 4.4 [CRT/FADE/NONE]

It seems that no matter how many cool mods you put out there, a lot of folks continue to ask for CRT. So here's a 'How-To' based off of the Sprint NE5 4.4 release, but this should also work in other variants and/or Samsung devices.
We will be working with the services.jar, and some knowledge decompiling and/or baksmali is required.
Also note that the debug code has been removed; to do the same use the -b switch when decompiling with apktool.
Code:
apktool d -b services.jar
PART 1
To start:
Navigate and open
Code:
smali\com\android\server\power\DisplayPowerController.smali
ADD the lines in RED right at the top
Code:
.class final Lcom/android/server/power/DisplayPowerController;
.super Ljava/lang/Object;
.source "DisplayPowerController.java"
[COLOR="Red"]# interfaces
.implements Landroid/animation/Animator$AnimatorListener;[/COLOR]
# annotations
Search for and add the lines in RED
Code:
.field private mElectronBeamFadesConfig:Z
[COLOR="Red"].field private mElectronBeamOff:I[/COLOR]
.field private mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
[COLOR="Red"].field private mElectronBeamOn:I[/COLOR]
.field private mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
Next search for
Code:
.method private getDynamicAutoBrightnessHighHysteresis(F)F
And add the following method DIRECTLY ABOVE
Code:
.method static getBeamCfg(Ljava/lang/String;I)I
.locals 3
move v0, p1
invoke-static {p0}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;
move-result-object v1
const-string v2, "none"
invoke-virtual {v1, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_0
const v0, 0x0
return v0
:cond_0
const-string v2, "crt"
invoke-virtual {v1, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_1
const v0, 0x1
return v0
:cond_1
const-string v2, "fade"
invoke-virtual {v1, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_2
const v0, 0x2
:cond_2
return v0
.end method
We will now be working in the following method so search for it next!
Code:
.method private initialize()V
Within the above referenced method, search for
Code:
iput-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
And add the line in RED
Code:
iput-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
[COLOR="Red"]const v4, 0x2[/COLOR]
iget-object v0, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
Still working within the same method REPLACE
Code:
const-wide/16 v1, 0xc8
WITH
Code:
const-wide/16 v1, 0x190
# This changes the animation speed. Looks much better
And yet still within this method, REPLACE these 2 lines
Code:
iget-object v1, p0, Lcom/android/server/power/DisplayPowerController;->mAnimatorListener:Landroid/animation/Animator$AnimatorListener;
invoke-virtual {v0, v1}, Landroid/animation/Animator;->addListener(Landroid/animation/Animator$AnimatorListener;)V
WITH THE FOLLOWING # This step updated 08.03.14
Code:
invoke-virtual {v0, p0}, Landroid/animation/ObjectAnimator;->addListener(Landroid/animation/Animator$AnimatorListener;)V
const-string v2, "persist.sys.screen_off"
const v3, 0x1
invoke-static {v2, v3}, Lcom/android/server/power/DisplayPowerController;->getBeamCfg(Ljava/lang/String;I)I
move-result v4
iput v4, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOff:I
Finally ADD
Code:
nop
nop
DIRECTLY BELOW
Code:
return-void
That's it for this method!
Continue to Part 2 due to post length limitations
Part 2
Almost there!! Search for
Code:
.method private updatePowerState()V
And REPLACE THE ENTIRE METHOD WITH THE FOLLOWING
Code:
.method private updatePowerState()V
.locals 12
const/4 v7, 0x1
const/4 v8, 0x0
const/4 v0, 0x0
iget-boolean v4, p0, Lcom/android/server/power/DisplayPowerController;->mTwilightChanged:Z
const/4 v5, 0x0
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mTwilightChanged:Z
iget-object v9, p0, Lcom/android/server/power/DisplayPowerController;->mLock:Ljava/lang/Object;
monitor-enter v9
const/4 v6, 0x0
:try_start_0
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingUpdatePowerStateLocked:Z
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestLocked:Lcom/android/server/power/DisplayPowerRequest;
if-nez v6, :cond_1
monitor-exit v9
:cond_0
:goto_0
return-void
:cond_1
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
if-nez v6, :cond_c
new-instance v6, Lcom/android/server/power/DisplayPowerRequest;
iget-object v10, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestLocked:Lcom/android/server/power/DisplayPowerRequest;
invoke-direct {v6, v10}, Lcom/android/server/power/DisplayPowerRequest;-><init>(Lcom/android/server/power/DisplayPowerRequest;)V
iput-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingWaitForNegativeProximityLocked:Z
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mWaitingForNegativeProximity:Z
const/4 v6, 0x0
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingWaitForNegativeProximityLocked:Z
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingScreenOnEvenThoughProximityPositiveLocked:Z
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z
const/4 v6, 0x0
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingScreenOnEvenThoughProximityPositiveLocked:Z
const/4 v6, 0x0
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestChangedLocked:Z
const/4 v0, 0x1
:cond_2
:goto_1
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mDisplayReadyLocked:Z
if-nez v6, :cond_10
move v1, v7
:goto_2
monitor-exit v9
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v0, :cond_3
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->initialize()V
:cond_3
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mWaitProximityToggled:Z
if-nez v6, :cond_4
iget v6, p0, Lcom/android/server/power/DisplayPowerController;->mProximity:I
if-ne v6, v7, :cond_4
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z
if-eqz v6, :cond_4
iput-boolean v7, p0, Lcom/android/server/power/DisplayPowerController;->mWaitProximityToggled:Z
:cond_4
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mWaitProximityToggled:Z
if-eqz v6, :cond_5
iget v6, p0, Lcom/android/server/power/DisplayPowerController;->mProximity:I
if-nez v6, :cond_5
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mWaitProximityToggled:Z
:cond_5
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mProximitySensor:Landroid/hardware/Sensor;
if-eqz v6, :cond_18
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->useProximitySensor:Z
if-eqz v6, :cond_15
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z
if-nez v6, :cond_11
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I
invoke-static {v6}, Lcom/android/server/power/DisplayPowerController;->wantScreenOn(I)Z
move-result v6
if-nez v6, :cond_11
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->lastGoToSleepReason:I
if-nez v6, :cond_11
invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setProximitySensorEnabled(Z)V
invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
:cond_6
:goto_3
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mLightSensor:Landroid/hardware/Sensor;
if-eqz v6, :cond_7
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mTiltSensor:Landroid/hardware/Sensor;
if-eqz v6, :cond_7
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->useAutoBrightness:Z
if-eqz v6, :cond_19
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I
invoke-static {v6}, Lcom/android/server/power/DisplayPowerController;->wantScreenOn(I)Z
move-result v6
if-eqz v6, :cond_19
move v6, v7
:goto_4
invoke-direct {p0, v6, v4}, Lcom/android/server/power/DisplayPowerController;->setLightSensorEnabled(ZZ)V
:cond_7
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I
invoke-static {v6}, Lcom/android/server/power/DisplayPowerController;->wantScreenOn(I)Z
move-result v6
if-eqz v6, :cond_1d
iget v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenAutoBrightness:I
if-ltz v6, :cond_1a
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mLightSensorEnabled:Z
if-eqz v6, :cond_1a
iget v3, p0, Lcom/android/server/power/DisplayPowerController;->mScreenAutoBrightness:I
iget-boolean v2, p0, Lcom/android/server/power/DisplayPowerController;->mUsingScreenAutoBrightness:Z
iput-boolean v7, p0, Lcom/android/server/power/DisplayPowerController;->mUsingScreenAutoBrightness:Z
:goto_5
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I
const/4 v9, 0x2
if-ne v6, v9, :cond_8
iput v3, p0, Lcom/android/server/power/DisplayPowerController;->mScreenBrightnessOnCover:I
:cond_8
invoke-direct {p0, v3}, Lcom/android/server/power/DisplayPowerController;->getFinalBrightness(I)I
move-result v3
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I
if-ne v6, v7, :cond_1b
add-int/lit8 v6, v3, -0xa
iget v9, p0, Lcom/android/server/power/DisplayPowerController;->mScreenBrightnessDimConfig:I
invoke-static {v6, v9}, Ljava/lang/Math;->min(II)I
move-result v3
const/4 v2, 0x0
:cond_9
:goto_6
invoke-direct {p0, v3}, Lcom/android/server/power/DisplayPowerController;->clampScreenBrightness(I)I
move-result v9
if-eqz v2, :cond_1c
const/16 v6, 0x1f4
:goto_7
invoke-direct {p0, v9, v6}, Lcom/android/server/power/DisplayPowerController;->animateScreenBrightness(II)V
:goto_8
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z
if-nez v6, :cond_a
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I
invoke-static {v6}, Lcom/android/server/power/DisplayPowerController;->wantScreenOn(I)Z
move-result v6
if-eqz v6, :cond_23
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z
move-result v6
if-nez v6, :cond_a
invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->blockScreenOn:Z
if-eqz v6, :cond_1e
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F
move-result v6
const v10, 0x0
cmpl-float v6, v6, v10
if-nez v6, :cond_1e
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->blockScreenOn()V
:cond_a
:goto_9
if-eqz v1, :cond_0
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnWasBlocked:Z
if-nez v6, :cond_0
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z
move-result v6
if-nez v6, :cond_0
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z
move-result v6
if-nez v6, :cond_0
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
iget-object v7, p0, Lcom/android/server/power/DisplayPowerController;->mCleanListener:Ljava/lang/Runnable;
invoke-virtual {v6, v7}, Lcom/android/server/power/DisplayPowerState;->waitUntilClean(Ljava/lang/Runnable;)Z
move-result v6
if-eqz v6, :cond_0
iget-object v7, p0, Lcom/android/server/power/DisplayPowerController;->mLock:Ljava/lang/Object;
monitor-enter v7
:try_start_1
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestChangedLocked:Z
if-nez v6, :cond_b
const/4 v6, 0x1
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mDisplayReadyLocked:Z
sget-boolean v6, Lcom/android/server/power/DisplayPowerController;->DEBUG:Z
if-eqz v6, :cond_b
const-string v6, "DisplayPowerController"
const-string v8, "Display ready!"
invoke-static {v6, v8}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
:cond_b
monitor-exit v7
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendOnStateChangedWithWakelock()V
goto/16 :goto_0
:cond_c
:try_start_2
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestChangedLocked:Z
if-eqz v6, :cond_2
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenAutoBrightnessAdjustment:F
iget-object v10, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestLocked:Lcom/android/server/power/DisplayPowerRequest;
iget v10, v10, Lcom/android/server/power/DisplayPowerRequest;->screenAutoBrightnessAdjustment:F
cmpl-float v6, v6, v10
if-eqz v6, :cond_d
const/4 v4, 0x1
:cond_d
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->autoBrightnessForEbookOnly:Z
iget-object v10, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestLocked:Lcom/android/server/power/DisplayPowerRequest;
iget-boolean v10, v10, Lcom/android/server/power/DisplayPowerRequest;->autoBrightnessForEbookOnly:Z
if-eq v6, v10, :cond_e
const-string v6, "DisplayPowerController"
new-instance v10, Ljava/lang/StringBuilder;
invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V
const-string v11, "[DAB] updatePowerState : autoBrightnessForEbookOnly : "
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v10
iget-object v11, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestLocked:Lcom/android/server/power/DisplayPowerRequest;
iget-boolean v11, v11, Lcom/android/server/power/DisplayPowerRequest;->autoBrightnessForEbookOnly:Z
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v10
invoke-static {v6, v10}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
const/4 v4, 0x1
:cond_e
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I
if-ne v6, v7, :cond_f
move v5, v7
:goto_a
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget-object v10, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestLocked:Lcom/android/server/power/DisplayPowerRequest;
invoke-virtual {v6, v10}, Lcom/android/server/power/DisplayPowerRequest;->copyFrom(Lcom/android/server/power/DisplayPowerRequest;)V
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mWaitingForNegativeProximity:Z
iget-boolean v10, p0, Lcom/android/server/power/DisplayPowerController;->mPendingWaitForNegativeProximityLocked:Z
or-int/2addr v6, v10
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mWaitingForNegativeProximity:Z
const/4 v6, 0x0
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingWaitForNegativeProximityLocked:Z
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z
iget-boolean v10, p0, Lcom/android/server/power/DisplayPowerController;->mPendingScreenOnEvenThoughProximityPositiveLocked:Z
or-int/2addr v6, v10
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z
const/4 v6, 0x0
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingScreenOnEvenThoughProximityPositiveLocked:Z
const/4 v6, 0x0
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestChangedLocked:Z
const/4 v6, 0x0
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mDisplayReadyLocked:Z
goto/16 :goto_1
:catchall_0
move-exception v6
monitor-exit v9
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
throw v6
:cond_f
move v5, v8
goto :goto_a
:cond_10
move v1, v8
goto/16 :goto_2
:cond_11
invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setProximitySensorEnabled(Z)V
iget v6, p0, Lcom/android/server/power/DisplayPowerController;->mProximity:I
if-ne v6, v7, :cond_14
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z
if-nez v6, :cond_12
iput-boolean v7, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z
invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendOnProximityPositiveWithWakelock()V
goto/16 :goto_3
:cond_12
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z
if-eqz v6, :cond_6
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z
if-eqz v6, :cond_6
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z
invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z
if-eqz v6, :cond_13
const-string v6, "DisplayPowerController"
const-string v9, "[sensor] proximity : mScreenOnEvenThoughProximityPositive is true"
invoke-static {v6, v9}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
:cond_13
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendOnProximityNegativeWithWakelock()V
goto/16 :goto_3
:cond_14
iget v6, p0, Lcom/android/server/power/DisplayPowerController;->mProximity:I
if-nez v6, :cond_6
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z
if-eqz v6, :cond_6
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z
invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendOnProximityNegativeWithWakelock()V
goto/16 :goto_3
:cond_15
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mWaitingForNegativeProximity:Z
if-eqz v6, :cond_17
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z
iget v6, p0, Lcom/android/server/power/DisplayPowerController;->mProximity:I
if-ne v6, v7, :cond_16
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I
invoke-static {v6}, Lcom/android/server/power/DisplayPowerController;->wantScreenOn(I)Z
move-result v6
if-eqz v6, :cond_6
:cond_16
invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setProximitySensorEnabled(Z)V
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z
invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendOnProximityNegativeWithWakelock()V
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mWaitingForNegativeProximity:Z
goto/16 :goto_3
:cond_17
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z
invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setProximitySensorEnabled(Z)V
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z
if-eqz v6, :cond_6
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z
invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendOnProximityNegativeWithWakelock()V
goto/16 :goto_3
:cond_18
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mWaitingForNegativeProximity:Z
goto/16 :goto_3
:cond_19
move v6, v8
goto/16 :goto_4
:cond_1a
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget v3, v6, Lcom/android/server/power/DisplayPowerRequest;->screenBrightness:I
const/4 v2, 0x0
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mUsingScreenAutoBrightness:Z
goto/16 :goto_5
:cond_1b
if-eqz v5, :cond_9
const/4 v2, 0x0
goto/16 :goto_6
:cond_1c
const/16 v6, 0x7d0
goto/16 :goto_7
:cond_1d
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mUsingScreenAutoBrightness:Z
goto/16 :goto_8
:cond_1e
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->unblockScreenOn()V
iget v10, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOn:I
if-nez v10, :cond_1f
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
const/high16 v7, 0x3f80
invoke-virtual {v6, v7}, Lcom/android/server/power/DisplayPowerState;->setElectronBeamLevel(F)V
invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->dismissElectronBeam()V
goto/16 :goto_9
:cond_1f
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z
move-result v6
if-nez v6, :cond_a
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F
move-result v6
const/high16 v7, 0x3f80
cmpl-float v6, v6, v7
if-nez v6, :cond_20
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->dismissElectronBeam()V
goto/16 :goto_9
:cond_20
const v6, 0x2
if-eq v6, v10, :cond_21
const v10, 0x0
:cond_21
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
invoke-virtual {v6, v10}, Lcom/android/server/power/DisplayPowerState;->prepareElectronBeam(I)Z
move-result v6
if-eqz v6, :cond_22
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->start()V
goto/16 :goto_9
:cond_22
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->end()V
goto/16 :goto_9
:cond_23
iget v10, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOff:I
if-nez v10, :cond_24
invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;
iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->blockScreenOn:Z
if-nez v6, :cond_a
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->unblockScreenOn()V
goto/16 :goto_9
:cond_24
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z
move-result v6
if-nez v6, :cond_a
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z
move-result v6
if-nez v6, :cond_a
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F
move-result v6
const v10, 0x0
cmpl-float v6, v6, v10
if-nez v6, :cond_25
invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V
goto/16 :goto_9
:cond_25
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
iget v10, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOff:I
invoke-virtual {v6, v10}, Lcom/android/server/power/DisplayPowerState;->prepareElectronBeam(I)Z
move-result v6
if-eqz v6, :cond_26
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;
invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->isScreenOn()Z
move-result v6
if-eqz v6, :cond_26
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->start()V
goto/16 :goto_9
:cond_26
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;
invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->end()V
goto/16 :goto_9
:catchall_1
move-exception v6
:try_start_3
monitor-exit v7
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_1
throw v6
.end method
Last step in this smali
Search for
Code:
.method public requestPowerState(Lcom/android/server/power/DisplayPowerRequest;ZZ)Z
And place the following methods DIRECTLY ABOVE it
Code:
.method public onAnimationCancel(Landroid/animation/Animator;)V
.locals 0
return-void
.end method
.method public onAnimationEnd(Landroid/animation/Animator;)V
.locals 0
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendUpdatePowerState()V
return-void
.end method
.method public onAnimationRepeat(Landroid/animation/Animator;)V
.locals 0
return-void
.end method
.method public onAnimationStart(Landroid/animation/Animator;)V
.locals 0
return-void
.end method
That's all for the services.jar!
Finally you must add this value to your build.prop
Code:
#CRT Mod
persist.sys.screen_off=crt
You can use any of the following values for off : fade, crt, none
I have also attached both the original and edited smali for diffing out
Enjoy!!
Reserved just because :silly:
Great guide.
Can't wait to see it in action.
Aewsome, this is great, thanks @rompnit, great work!:good::good: Out of thanks, be back shortly, I got to do this mod here real quick....
worked on both S5 and Note3...rocking now...thanks. Nice work...?
Great guide, thank you!
In theory, someone that has this working on a stock (rooted of course) NCG build could share the modded files to save others the more sensitive and tricky work right? If so, anyone willing to share those files? Haven't touched bs in a couple years now ☺
Know of any other bool or setting that would be preventing this from working?
Versatile1 said:
Know of any other bool or setting that would be preventing this from working?
Click to expand...
Click to collapse
Could double check framework-res for
Code:
<bool name="config_animateScreenLights">true</bool>
Make sure it's indeed set to 'true'.
What firmware/device are you modding?
S5 DEV edition G900VOYU1ANCG
services.jar is almost identical as retail.
Sent from my SM-G900V using Tapatalk
Versatile1 said:
S5 DEV edition G900VOYU1ANCG
services.jar is almost identical as retail.
Sent from my SM-G900V using Tapatalk
Click to expand...
Click to collapse
Did you check that bool? Get it worked out?
Sent from my SM-G900P using Tapatalk
rompnit said:
Did you check that bool? Get it worked out?
Sent from my SM-G900P using Tapatalk
Click to expand...
Click to collapse
Checked the bool, still a no go. I probably fat fingered it
Sent from my SM-G900V using Tapatalk
Versatile1 said:
Checked the bool, still a no go. I probably fat fingered it
Sent from my SM-G900V using Tapatalk
Click to expand...
Click to collapse
My apologies.. I excluded the interfaces in the guide.. :crying: The OP has been updated, but here's what was added:
ADD the lines in RED right at the top
Code:
.class final Lcom/android/server/power/DisplayPowerController;
.super Ljava/lang/Object;
.source "DisplayPowerController.java"
[COLOR="Red"]# interfaces
.implements Landroid/animation/Animator$AnimatorListener;[/COLOR]
# annotations
Let me know if this does it? If not PM me your services
rompnit said:
My apologies.. I excluded the interfaces in the guide.. :crying: The OP has been updated, but here's what was added:
ADD the lines in RED right at the top
Code:
.class final Lcom/android/server/power/DisplayPowerController;
.super Ljava/lang/Object;
.source "DisplayPowerController.java"
[COLOR="Red"]# interfaces
.implements Landroid/animation/Animator$AnimatorListener;[/COLOR]
# annotations
Let me know if this does it? If not PM me your services
Click to expand...
Click to collapse
Thank you, will try tomorrow morning.
Sent from my SM-G900V using Tapatalk
Thank you for all the help. Working great! !!
Sent from my SM-G900V using Tapatalk
Thanks rompnit, works great.
metalfan78 said:
Thanks rompnit, works great.
Click to expand...
Click to collapse
A lot of thanks by guide.
Its worked here crt and fade but im having reboots when i use rotation screen.
Any tips?
eric-filth said:
A lot of thanks by guide.
Its worked here crt and fade but im having reboots when i use rotation screen.
Any tips?
Click to expand...
Click to collapse
Pull a logcat while it happens to narrow it down.
eric-filth said:
A lot of thanks by guide.
Its worked here crt and fade but im having reboots when i use rotation screen.
Any tips?
Click to expand...
Click to collapse
Found the issue with rotation and this mod. It was the screen on animator... The OP has been updated to reflect the change
rompnit said:
Reserved just because :silly:
Click to expand...
Click to collapse
Great guide, thank you!

Categories

Resources