[Galaxy S 4 i9500 Android Development] grgsiocl:
As title says, this mod brings you the multiple apps in multiple windows or flashbar! Since Shealth doesnt support the multiwindow, this mod makes a dirty trick to bypass the SHEALTH app from the multiwindow and making the rest of the app's to work on flashbar!

What it does?

All the applications which are installed in app drawer are available in flashbar! Even if new apps are installed, then those apps are also available in flashbar...hence you dont need any apk to control or add the applications in flashbar!

Screenshots

View attachment 2017045View attachment 2017046View attachment 2017047View attachment 2017048

Must Have

1. Apktool

2. Some knowledge about compiling and decompiling

3. 7zip

4. notepad++

5. backsmali

How to

1. Decompile the flashbarservice.apk which is available in system/app

Go to flashbarservice\smali\com\sec\android\app\FlashBar Service\FlashBarInfo.smali

Open the file FlashBarInfo.smali using notepad++

search for method .method public generateFlashBarList()V

and make the following changes:

iget-object v8, v7, Landroid/content/pm/ResolveInfo;->filter:Landroid/content/IntentFilter;

- const-string v9, "android.intent.category.MULTIWINDOW_LAUNCHER"
+ const-string v9, "android.intent.category.LAUNCHER"

invoke-virtual {v8, v9}, Landroid/content/IntentFilter;->hasCategory(Ljava/lang/String;)Z

Now Save and recompile it and the first part is done!

2. Decompile services.jar which is available in system/framework folder

and go to services.jar.out\smali\com\android\server\am\Multi WindowManagerService.smali

Open the file MultiWindowManagerService.smali using notepad++ and make following changes

#the value of this static final field might be set in the static constructor
.field static final synthetic $assertionsDisabled:Z = false

+.field private static final CONFIG_FILE:Ljava/lang/String; = "/system/etc/multiwindow_blacklist.txt"
+
.field public static START_ACTIVITY_WITH_LAST_PINUP:Z = false

.field private static final TAG:Ljava/lang/String; = "MultiWindowManagerService"
@@ -52,6 +54,17 @@

.field private mMinimizedSlotManager:Lcom/android/server/am/MultiWindowManagerService$MinimizedSlotManager;

+.field private mMultiWindowBlackList:Ljava/util/List;
+ .annotation system Ldalvik/annotation/Signature;
+ value = {
+ "Ljava/util/List",
+ "<",
+ "Ljava/lang/String;",
+ ">;"
+ }
+ .end annotation
+.end field
+
.field private mSupportAllApps:Z

.field mSupportAppList:Ljava/util/ArrayList;
@@ -6344,39 +6357,104 @@
.end method

.method public isSupportApp(Ljava/lang/String;)Z
- .locals 1
+ .locals 4
.parameter "packageName"

.prologue
- .line 567
- iget-object v0, p0, Lcom/android/server/am/MultiWindowManagerService;->mSupportAppList:Ljava/util/ArrayList;
+ .line 15
+ iget-object v2, p0, Lcom/android/server/am/MultiWindowManagerService;->mMultiWindowBlackList:Ljava/util/List;

- invoke-virtual {v0, p1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z
+ if-nez v2, :cond_1

- move-result v0
+ .line 16
+ new-instance v2, Ljava/util/ArrayList;

- if-nez v0, :cond_0
+ invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

- const-string v0, "android"
+ iput-object v2, p0, Lcom/android/server/am/MultiWindowManagerService;->mMultiWindowBlackList:Ljava/util/List;

- invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
+ .line 17
+ new-instance v2, Ljava/io/File;

- move-result v0
+ const-string v3, "/system/etc/multiwindow_blacklist.txt"

- if-eqz v0, :cond_1
+ invoke-direct {v2, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V

- .line 568
- :cond_0
- const/4 v0, 0x1
+ invoke-virtual {v2}, Ljava/io/File;->exists()Z
+
+ move-result v2
+
+ if-eqz v2, :cond_1
+
+ .line 19
+ :try_start_0
+ new-instance v1, Ljava/io/BufferedReader;
+
+ new-instance v2, Ljava/io/FileReader;
+
+ const-string v3, "/system/etc/multiwindow_blacklist.txt"
+
+ invoke-direct {v2, v3}, Ljava/io/FileReader;-><init>(Ljava/lang/String;)V

- .line 571
+ invoke-direct {v1, v2}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
+
+ .line 22
+ .local v1, reader:Ljava/io/BufferedReader;
+ :cond_0
:goto_0
- return v0
+ invoke-virtual {v1}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;

- :cond_1
- const/4 v0, 0x0
+ move-result-object v0
+
+ .local v0, pkgName:Ljava/lang/String;
+ if-eqz v0, :cond_1
+
+ .line 23
+ invoke-virtual {v0}, Ljava/lang/String;->trim()Ljava/lang/String;
+
+ move-result-object v0
+
+ .line 24
+ invoke-virtual {v0}, Ljava/lang/String;->length()I
+
+ move-result v2
+
+ if-lez v2, :cond_0
+
+ .line 25
+ iget-object v2, p0, Lcom/android/server/am/MultiWindowManagerService;->mMultiWindowBlackList:Ljava/util/List;
+
+ invoke-interface {v2, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
+ :try_end_0
+ .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

goto :goto_0
+
+ .line 28
+ .end local v0 #pkgName:Ljava/lang/String;
+ .end local v1 #reader:Ljava/io/BufferedReader;
+ :catch_0
+ move-exception v2
+
+ .line 33
+ :cond_1
+ iget-object v2, p0, Lcom/android/server/am/MultiWindowManagerService;->mMultiWindowBlackList:Ljava/util/List;
+
+ invoke-interface {v2, p1}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
+
+ move-result v2
+
+ if-nez v2, :cond_2
+
+ const/4 v2, 0x1
+
+ :goto_1
+ return v2
+
+ :cond_2
+ const/4 v2, 0x0
+
+ goto :goto_1
.end method

.method public isSupportControlbar()Z

Make the above said changes and save it. Recompile and flash the same!

Attached multiwindow_blacklist.txt in this post. Download the same and copy to /system/etc adn change the permissions to make SHEALTH works!

After flashing, you will see all apps in app drawer will be listed in multiwindow / flashbar...Search for flashbar in data/data and then delete the folder. Now reboot...You will have all the apps in flashbar in sorted order!

Credits

-------------

Lidroid

Feel Helped, Press Thanks! Any one free to use this with due credits and link to this thread