FORUMS
Remove All Ads from XDA

Guides Android 7 modding with main emphasis on S7edge this time

5,330 posts
Thanks Meter: 6,958
 
By asc1977, Account currently disabled on 25th November 2016, 04:45 PM
Post Reply Email Thread
Guides Android 7
I decided after a long thinking about to open a new thread for modding guides for Android 7 because i see that there are much differences to older Android versions. So we keep up to date to make life easier. I hope all agree with me in that and share like me guides here. If you didnt agree with me keep your mind by yourself please and dont make my life harder

Thanks




Framework-res.apk and services.jar
How to add Reboot Recovery Android 7 Style with toggle

Services.jar
Howto remove confirm buttons in Reboot menue for shutoff and reboot
USB Plug/Unplug disable wake up with toggle in RomControl
How to hide (Power Menu) Emergency Button with a Toggle
How to hide (Power Menu) Power Off Button with a Toggle
How to Disable Signature Check
Remove Volume Safe Warning with checkbox

GooglePackageInstaller.apk
Granting permissions dialog - Ok button always available with window (or alert) overlays

SamsungCamera6.apk
Another way of using Camera Flash on low battery

SystemUI.apk
Guide - SysScope - Status = Official

SystemUI.apk
How to enable Lockscreen rotation with toggle in RomControl V2
How to unlock after reboot with fingerprint without pin or pattern
Network traffic indicator in status bar
GearUtils
How to open app if click on statusbar clock
Adaption for 6thGear Data Usage Preferences on the fly without observer and without CSC changes
Adaption of Gear device info in notification panel
Adaption of 6htGear Carrier label preferences - as ADDITION to 6thGear device info mod
How to Make Data Usage Center From Right in Notification Panelwithout RomControl
How to add virtual lock, recent and home button to statusbar with RomControl
Add Battery Bar to ROM
How to make a option to choose between Stock and 3Minit battery
Volume safe warning to be permanently disabled (at bottom of post)

SecSettings2.apk
Activate duration keys lighting in the setting
How to build 0.25x anmimation scale in developer options

Different mods
Nougat compatible -=V6=- 1060 FONTS
Whitepages /identify unsaved numbers

The Following 36 Users Say Thank You to asc1977 For This Useful Post: [ View ] Gift asc1977 Ad-Free
 
 
25th November 2016, 04:45 PM |#2  
OP Account currently disabled
Flag Schwetzingen
Thanks Meter: 6,958
 
Donate to Me
More
reserved1
The Following 4 Users Say Thank You to asc1977 For This Useful Post: [ View ] Gift asc1977 Ad-Free
25th November 2016, 05:26 PM |#3  
OP Account currently disabled
Flag Schwetzingen
Thanks Meter: 6,958
 
Donate to Me
More
How to add Reboot Recovery to power menu with toggle

Credits goes to @sagitt67 and @daxgirl .
Credits for toggle goes to @tdunham

Now after some fc and logcats of old guides i finished sucessfull the mod and share what i have done

We work in framework-res.apk and services.jar

Framework-res.apk

Download framework.zip
Paste files in same folders of decompiles freamework-res.apk
now open res/values/arrays.xml
find <string-array name="config_globalActionsList"> and add blue
Code:
<string-array name="config_globalActionsList">
        <item>power</item>
        <item>datamode</item>
        <item>airplane</item>
        <item>restart</item>
        <item>lockdown</item>
        <item>bugreport</item>
        <item>users</item>
        <item>rebootrecovery</item>
        <item>emergencymode</item>
        <item>subscreen</item>
        <item>screenrec</item>
    </string-array>
now go to res/values/strings.xml and add blue

Code:
    <string name="charging_connected_via_usb">Charging connected device via USB...</string>
    <string name="config_tspstate_threshold">10,32,768,10,60</string>
    <string name="tw_ic_do_rebootrecovery">Reboot Recovery</string>
</resources>
done with framework-res.apk
recompile and push to phone

Services.jar

download services.zip and paste files in same folders of decompiles services.jar
open smali/com/android/server/policy/GlobalActions.smali
add blue line in # instance fields
Code:
.field mEmergencyStringId:I

.field private mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;

.field private mGlobalActionsFrameLayout:Landroid/app/GlobalActionsFrameLayout
find .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog;
add blue
Code:
if-eqz v4, :cond_8

    const v4, 0x10809f4

    :goto_4
    const v6, 0x10406e2

    move-object/from16 v0, p0

    invoke-direct {v5, v0, v4, v6}, Lcom/android/server/policy/GlobalActions$20;-><init>(Lcom/android/server/policy/GlobalActions;II)V

    move-object/from16 v0, p0

    iput-object v5, v0, Lcom/android/server/policy/GlobalActions;->mRestart:Lcom/android/server/policy/GlobalActions$SinglePressAction;
	
    new-instance v4, Lcom/android/server/policy/GlobalActions$47;

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;

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

    move-result-object v0

    const-string v1, "tw_ic_do_rebootrecovery" 

    const-string v2, "drawable" 

    const-string v3, "android"

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

    move-result v5 

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;

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

    move-result-object v0

    const-string v1, "tw_ic_do_rebootrecovery"

    const-string v2, "string"

    const-string v3, "android"

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

    move-result v6

    move-object/from16 v0, p0

    invoke-direct {v4, v0, v5, v6}, Lcom/android/server/policy/GlobalActions$47;-><init>(Lcom/android/server/policy/GlobalActions;II)V

    move-object/from16 v0, p0

    iput-object v4, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction; 

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

    move-result-object v4

    const-string/jumbo v5, "CscFeature_Common_ConfigBikeMode"
Now next part is tricky, add lines in blue and changes in green

Code:
const/16 v6, 0x80

    const/4 v7, 0x1

    move-object/from16 v0, p0

    invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z

    new-instance v4, Lcom/android/server/policy/GlobalActions$BugReportAction;

    move-object/from16 v0, p0

    invoke-direct {v4, v0}, Lcom/android/server/policy/GlobalActions$BugReportAction;-><init>(Lcom/android/server/policy/GlobalActions;)V

    move-object/from16 v0, p0

    iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
	
	const/16 v6, 0x100

    move-object/from16 v0, p0

    iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;

    move-object/from16 v0, p0

    iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;

    const/4 v7, 0x1

    move-object/from16 v0, p0

    invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z 

    const/16 v6, 0x200 #before was 0x100

    const/4 v7, 0x1

    move-object/from16 v0, p0

    invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
now search for const-string/jumbo v4, "silent" and add blue line above it and delete red ones
green parts must match yellow part
Code:
const-string/jumbo v4, "emergencymode"

    invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_15

    move-object/from16 v0, p0

    iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;

    move-object/from16 v0, p0

    iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mEmergency:Lcom/android/server/policy/GlobalActions$ToggleAction;

    invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto/16 :goto_7   #look that green part match this

    :cond_15
    const-string/jumbo v4, "rebootrecovery"

    invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_asc1

    move-object/from16 v0, p0

    iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;

    move-object/from16 v0, p0

    iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;

    invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto/16 :goto_7 

    :cond_asc1
    const-string/jumbo v4, "silent"
next part is missing in Android 7 services.jar so we need to readd it for mod
find .method private addCustomDialogItems(Landroid/graphics/drawable/BitmapDrawable;Ljava/lang/String;Landroid/content/Intent;ILjava/util/ArrayList;)Z

add this above method

Code:
.method static synthetic access$500(Lcom/android/server/policy/GlobalActions;)Landroid/content/Context;
    .locals 1

    iget-object v0, p0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;

    return-object v0
.end method
thats it, recompile and push to phone

Note: For me one time i get after reboot a loop of phone restarts, only one time happens. If it happen i solved it with wipe dalvik-cache and cache

RomControl V2
Code:
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:title="Reboot Recovery Button" android:key="reboot_recovery" android:defaultValue="false" android:summaryOn="Reboot Recovery will be shown" android:summaryOff="Currently removed" />
Attached Files
File Type: zip framework.zip - [Click for QR Code] (13.8 KB, 720 views)
File Type: zip services.zip - [Click for QR Code] (1.7 KB, 662 views)
The Following 11 Users Say Thank You to asc1977 For This Useful Post: [ View ] Gift asc1977 Ad-Free
25th November 2016, 05:45 PM |#4  
thereassaad's Avatar
Recognized Contributor
Flag Bierut
Thanks Meter: 9,605
 
More
Interesting ,,
The Following 3 Users Say Thank You to thereassaad For This Useful Post: [ View ] Gift thereassaad Ad-Free
26th November 2016, 03:27 AM |#5  
OP Account currently disabled
Flag Schwetzingen
Thanks Meter: 6,958
 
Donate to Me
More
Howto remove confirm buttons in Reboot menue for shutoff and reboot

decompile
open services.jar/com/android/server/policy/GlobalActions
goto method
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/view/WindowManagerPolicy$WindowManagerFuncs;)V
scroll down and find and delete this lines. ID´s maybe different
Code:
    const v1, 0x1080a25

    iput v1, p0, Lcom/android/server/policy/GlobalActions;->mPowerOffIconResId:I

    const v1, 0x1080a26

    iput v1, p0, Lcom/android/server/policy/GlobalActions;->mConfirmPowerOffIconResId:I

    const v1, 0x1080a27

    iput v1, p0, Lcom/android/server/policy/GlobalActions;->mRestartIconResId:I

    const v1, 0x1080a28

    iput v1, p0, Lcom/android/server/policy/GlobalActions;->mConfirmRestartIconResId:I
The Following 4 Users Say Thank You to asc1977 For This Useful Post: [ View ] Gift asc1977 Ad-Free
26th November 2016, 04:19 AM |#6  
OP Account currently disabled
Flag Schwetzingen
Thanks Meter: 6,958
 
Donate to Me
More
USB Plug/Unplug disable wake up with toggle in RomControl

Decompile Services.jar
Go to smali/com/android/server/power/PowerManagerService.smali

find and add blue and remoce red
Code:
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v2

    invoke-direct {p0, v13, v11, v8}, Lcom/android/server/power/PowerManagerService;->shouldWakeUpWhenPluggedOrUnpluggedLocked(ZIZ)Z

    move-result v1
	
    iget-object v5, p0, Lcom/android/server/power/PowerManagerService;->mContext:Landroid/content/Context;

    invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v5

    const v4, 0x1

    const-string/jumbo v6, "usb_plugged"

    invoke-static {v5, v6, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    if-eqz v4, :cond_4  # this cond must match :cond after that line

    if-eqz v1, :cond_4

    if-eqz v12, :cond_4

    new-instance v1, Ljava/lang/StringBuilder;

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

    iget-object v4, p0, Lcom/android/server/power/PowerManagerService;->mScreenOnReason:Ljava/lang/String;

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

    move-result-object v1

    const-string/jumbo v4, " powered change"

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

    move-result-object v1

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

    move-result-object v1

    iput-object v1, p0, Lcom/android/server/power/PowerManagerService;->mScreenOnReason:Ljava/lang/String;

    const/16 v1, 0xb

    iput v1, p0, Lcom/android/server/power/PowerManagerService;->mLastWakeUpReason:I

    const-string/jumbo v4, "android.server.power:POWER"

RomControl

Code:
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:title="USB plug in/out wakeup" android:icon="@drawable/usb" android:key="usb_plugged" android:defaultValue="true" android:summaryOn="On" android:summaryOff="Off" />
Thx for helping for this mod to great @thereassaad
The Following 3 Users Say Thank You to asc1977 For This Useful Post: [ View ] Gift asc1977 Ad-Free
26th November 2016, 05:14 AM |#7  
OP Account currently disabled
Flag Schwetzingen
Thanks Meter: 6,958
 
Donate to Me
More
How to hide (Power Menu) Emergency Button with a Toggle

First of all thx @tdunham for original guide here

Services.jar

open smali/com/android/server/policy/GlobalActions$16.smali
Search for followed text to be sure you have right smali. If you not find search in other GlobalAction$.......... smalis for that key
Code:
"EmergencyMode"

Replace method with below
Code:
.method public showConditional()Z
    .locals 4

    const/4 v0, 0x0

    const/4 v1, 0x1

    iget-object v2, p0, Lcom/android/server/policy/GlobalActions$16;->this$0:Lcom/android/server/policy/GlobalActions; #ThisGlobalActions$16 must match your smali

    # getter for: Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
    invoke-static {v2}, Lcom/android/server/policy/GlobalActions;->access$500(Lcom/android/server/policy/GlobalActions;)Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "power_emergency"

    invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v2

    if-ne v2, v0, :cond_0

    :goto_0
    return v0

    :cond_0
    move v0, v1

    goto :goto_0
.end method
Now we go to main smali
open smali/com/android/server/policy/GlobalActions.smali

search for this method. On Android 7 it never excist so we have to add it. Maybe its there from earlier mods so only check if there or not and add if not above
method: .method private addCustomDialogItems(Landroid/graphics/drawable/BitmapDrawable;Ljava/lang/String;Landroid/content/Intent;ILjava/util/ArrayList;)Z
Code:
.method static synthetic access$500(Lcom/android/server/policy/GlobalActions;)Landroid/content/Context;
    .locals 1

    iget-object v0, p0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;

    return-object v0
.end method
RomControl
Code:
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:title="Emergency Mode Button" android:key="power_emergency" android:defaultValue="true" android:summaryOn="Emergency mode will be shown" android:summaryOff="Currently removed" />
Thx again to get it to work on Android 6.9.1 @tdunham
The Following 3 Users Say Thank You to asc1977 For This Useful Post: [ View ] Gift asc1977 Ad-Free
26th November 2016, 09:50 AM |#8  
OP Account currently disabled
Flag Schwetzingen
Thanks Meter: 6,958
 
Donate to Me
More
How to unlock after reboot with fingerprint without pin or pattern

decompile SystemUI.apk
Go to smali/com/android/keyguard

open Keyguardupdatemonitor.smali
add blue
Code:
.method private isFingerprintDisabled(I)Z

..................

 :goto_0
 const/4 v1, 0x0 

 return v1

   :cond_0
   invoke-virtual {p0}, Lcom/android/keyguard/KeyguardUpdateMonitor;->isSimPinSecure()Z

   move-result v1

   goto :goto_0
.end method
Code:
.method public isUnlockCompleted()Z

........................................

 move-result v0
const/4 v0, 0x1 

    return v0
.end method
Code:
.method public isUnlockWithFingerprintPossible(I)Z

............................................
  :cond_3
  const/4 v0, 0x1

    return v1
.end method
Open KeyguardUpdateMonitor$StrongAuthTracker.smali
add blue
Code:
.method public isUnlockingWithFingerprintAllowed()Z
    .locals 2

    .prologue
    const/4 v0, 0x0

    .line 936
    iget-object v1, p0, Lcom/android/keyguard/KeyguardUpdateMonitor;->mStrongAuthTracker:Lcom/android/keyguard/KeyguardUpdateMonitor$StrongAuthTracker;

    invoke-virtual {v1}, Lcom/android/keyguard/KeyguardUpdateMonitor$StrongAuthTracker;->isUnlockingWithFingerprintAllowed()Z

    move-result v1
	
	const/4 v1, 0x1 

    if-eqz v1, :cond_0

    .line 937
    sget v1, Lcom/android/keyguard/KeyguardUpdateMonitor;->sCurrentUser:I

    invoke-virtual {p0, v1}, Lcom/android/keyguard/KeyguardUpdateMonitor;->hasFingerprintUnlockTimedOut(I)Z

    move-result v1
	
	if-eqz v1, :cond_1

    .line 936
    :cond_0
    :goto_0
    return v0

    .line 937
    :cond_1
    const/4 v0, 0x1

    goto :goto_0
.end method
recompile

Thx @sanoc69
The Following 7 Users Say Thank You to asc1977 For This Useful Post: [ View ] Gift asc1977 Ad-Free
26th November 2016, 09:59 AM |#9  
OP Account currently disabled
Flag Schwetzingen
Thanks Meter: 6,958
 
Donate to Me
More
How to Disable Signature Check

Decompil Services.jar

Go into smali\com\android\server\pm\PackageManagerService. smali

Search for :
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
Replace the entire .method with this one:
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
    .locals 7

    const/4 v0, 0x0

    return v0
.end method
Recompil Services.jar
Done

Now you can install any application with different signature

Thanks to @one_love_420
The Following 4 Users Say Thank You to asc1977 For This Useful Post: [ View ] Gift asc1977 Ad-Free
30th November 2016, 08:54 AM |#10  
Ather's Avatar
Retired Senior Moderator
Thanks Meter: 772
 
Donate to Me
More
To move the network traffic indicator to the left of the status bar, follow the guide (amazing) by @daxgirl but in the 6th step, add the

Code:
<com.android.wubydax.NetworkTraffic android:layout_width="wrap_content" android:layout_height="fill_parent" />
after:
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/status_bar_contents" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingStart="@dimen/status_bar_padding_start" android:paddingEnd="@dimen/status_bar_padding_end">
screenshot:


Thanks to @daxgirl for pointing it out
The Following 4 Users Say Thank You to Ather For This Useful Post: [ View ] Gift Ather Ad-Free
5th December 2016, 05:33 PM |#11  
Senior Member
Thanks Meter: 94
 
More
@asc1977
How can we deodex nougat firmware? SVADeodexer doesn't work anymore for nougat
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes