[Android General] By Zonik:
Guide Port Smart Capture (Scroll Capture) Nougat 7.xx

Hi guys, as usual samsung always adds and removes features for each device, this method is for those who are working on xx base rom and this does not have Smart Capture support, and a long time ago I could port this but did not have time to write and post the guide here ..

Well without more to say let's start

••••••••••First Method ••••••••••

Note: For some Smart Capture can work with this first method, if this does not work then follow method 2

--Decompile framework.jar and merge smali SystemServiceRegistry$xxx

--go to smali/android/app/SystemServiceRegistry

--Now check what is you last : SystemServiceRegistry$xxx

Example if you last method is 99 add smali 100 if you last smali is 100 add 101 and so on...

--Now search this method

.method static constructor <clinit>()V

before of

return-void add this:

const-string/jumbo v0, "spengestureservice"

const-class v1, Lcom/samsung/android/content/smartclip/SpenGestureManager;

new-instance v2, Landroid/app/SystemServiceRegistry$100;

invoke-direct {v2}, Landroid/app/SystemServiceRegistry$100;-><init>()V

invoke-static {v0, v1, v2}, Landroid/app/SystemServiceRegistry;->registerService(Ljava/lang/String;Ljava/lang/Class;Landroid/app/SystemServiceRegistry$ServiceFetcher;)V

invoke-static {}, Lcom/samsung/android/feature/SemFloatingFeature;->getInstance()Lcom/samsung/android/feature/SemFloatingFeature;

(if you last smali is 100 add this)

const-string/jumbo v0, "spengestureservice"

const-class v1, Lcom/samsung/android/content/smartclip/SpenGestureManager;

new-instance v2, Landroid/app/SystemServiceRegistry$101;

invoke-direct {v2}, Landroid/app/SystemServiceRegistry$101;-><init>()V

invoke-static {v0, v1, v2}, Landroid/app/SystemServiceRegistry;->registerService(Ljava/lang/String;Ljava/lang/Class;Landroid/app/SystemServiceRegistry$ServiceFetcher;)V

invoke-static {}, Lcom/samsung/android/feature/SemFloatingFeature;->getInstance()Lcom/samsung/android/feature/SemFloatingFeature;

Now Recompile framework.jar and flash (Test scroll capture if it work,if not work make second method)

••••••••••Second Method ••••••••••

Note: Check where it says (compare) here you have to verify if the sequence values in the smali method are the same as the guide, if this is not the same, adapt to your stock value. Edit only where it says (compare) if necessary

--Decompile services.jar

--go to smali/com/android/server/SystemServer.smali

--search for : StartSamplingProfilerService

you will see like this :

const-string/jumbo v6, "StartSamplingProfilerService"

invoke-static {v6}, Lcom/android/server/SystemServer;->traceBeginAndSlog(Ljava/lang/String;)V

:try_start_82
const-string/jumbo v6, "samplingprofiler"

new-instance v7, Lcom/android/server/SamplingProfilerService;

invoke-direct {v7, v5}, Lcom/android/server/SamplingProfilerService;-><init>(Landroid/content/Context;)V

invoke-static {v6, v7}, Landroid/os/ServiceManager;->addService(Ljava/lang/String;Landroid/os/IBinder;)V
:try_end_82
.catch Ljava/lang/Throwable; {:try_start_82 .. :try_end_82} :catch_58

:goto_5d

after goto_xxxx (Add this one)

const-string/jumbo v6[COLOR="red"](compare)[/COLOR], "StartSpenGestureManagerService"

invoke-static {v6[COLOR="red"](compare)[/COLOR]}, Lcom/android/server/SystemServer;->traceBeginAndSlog(Ljava/lang/String;)V

:try_start_f9
const-string/jumbo v6[COLOR="red"](compare)[/COLOR], "spengestureservice"

new-instance v7[COLOR="red"](compare)[/COLOR], Lcom/android/server/smartclip/SpenGestureManagerService;

invoke-direct {v7, v5, v0[COLOR="red"](compare)[/COLOR]}, Lcom/android/server/smartclip/SpenGestureManagerService;-><init>(Landroid/content/Context;)V

invoke-static {v6, v7[COLOR="red"](compare)[/COLOR]}, Landroid/os/ServiceManager;->addService(Ljava/lang/String;Landroid/os/IBinder;)V
:try_end_f9
.catch Ljava/lang/Throwable; {:try_start_f9 .. :try_end_f9} :catch_f9

:goto_f9

--search for starting SamplingProfiler Service

you will see like this:

move-exception v84

const-string/jumbo v4, "starting SamplingProfiler Service"

move-object/from16 v0, p0

move-object/from16 v1, v84

invoke-direct {v0, v4, v1}, Lcom/android/server/SystemServer;->reportWtf(Ljava/lang/String;Ljava/lang/Throwable;)V

goto/16 :goto_59

after goto/xxxx (Add this one)

:catch_f9
move-exception v84(compare)

const-string/jumbo v4, "starting SpenGestureManager Service"

move-object/from16 v0, p0

move-object/from16 v1, v84(compare)

invoke-direct {v0, v4, v1}, Lcom/android/server/SystemServer;->reportWtf(Ljava/lang/String;Ljava/lang/Throwable;)V

goto/16 :goto_f9

const-string/jumbo v4, "starting SpenGestureManager Service"

move-object/from16 v0, p0

move-object/from16 v1, v84(compare)

invoke-direct {v0, v4, v1}, Lcom/android/server/SystemServer;->reportWtf(Ljava/lang/String;Ljava/lang/Throwable;)V

goto/16 :goto_f9

Now recompile and flash (Now scroll capture it should work without problems) :angel:

do not forget add the apk and libs corresponding to your android version 7.0.1 or 7.1.1

Credt: Thanks also to [MENTION=6911575]BlackMesa123[/MENTION] for the idea of the first method, unfortunately this first method did not work on my phone since it was necessary to add full support in services.jar

Captures: