[GT-I9105/P] Samsung Galaxy S II Plus - Camera Mod - Samsung Galaxy S II Plus

I9105P HOW TO CAMERA MOD (power button shutter)
---Decompile "SamsungCamera.apk"---
1. Go to com\sec\android\app\camera\ folder and open Camera.smali file.
2. Search for "
.method public onKeyDown(ILandroid/view/KeyEventZ
Click to expand...
Click to collapse
" and look for ".sparse-switch".
3. Here you will see a lot of :sswitch definitions... see the one for 0x17 (it's the touch shutter button and is defined as :sswitch_e4).
We need to make :sswitch that are defined to power button for read the same as the one defined to the touch shutter button. ( 0x1a is for power button)
4. So now change that :sswitch for these button to read as same as that for the touch shutter button.
for example:
Antes…(before)
:line 1884
:sswitch_data_28c
.sparse-switch
0x4 -> :sswitch_85
0x17 -> :sswitch_e4 <!—Boton de disparo (normal shutter)
0x18 -> :sswitch_225 <!—Volumen+ (zoom in)
0x19 -> :sswitch_225 <!—Volumen- (zoom out)
0x1a -> :sswitch_85 <!—Boton de Power (power button)
0x1b -> :sswitch_e4
0x42 -> :sswitch_e4
0x45 -> :sswitch_225
0x46 -> :sswitch_225
0x50 -> :sswitch_89
0x52 -> :sswitch_83
0x55 -> :sswitch_87
0x59 -> :sswitch_87
0x5a -> :sswitch_87
0x9c -> :sswitch_225
0x9d -> :sswitch_225
.end sparse-switch
.end method
Click to expand...
Click to collapse
Despues... (after)
: line 1884
:sswitch_data_28c
.sparse-switch
0x4 -> :sswitch_85
0x17 -> :sswitch_e4 <!—Boton de disparo (normal shutter)
0x18 -> :sswitch_225 <!—Volumen+ (zoom in)
0x19 -> :sswitch_225 <!—Volumen- (zoom out)
0x1a -> :sswitch_e4 <!—Boton de Power (power button)
0x1b -> :sswitch_e4
0x42 -> :sswitch_e4
0x45 -> :sswitch_225
0x46 -> :sswitch_225
0x50 -> :sswitch_89
0x52 -> :sswitch_83
0x55 -> :sswitch_87
0x59 -> :sswitch_87
0x5a -> :sswitch_87
0x9c -> :sswitch_225
0x9d -> :sswitch_225
.end sparse-switch
.end method
Click to expand...
Click to collapse
5. Now search for "
.method public onKeyUp(ILandroid/view/KeyEventZ
Click to expand...
Click to collapse
" and look for ".sparse-switch".
6. Again you will see several :sswitch definitions... see the one for 0x17, it's the touch shutter button and is defined as :sswitch_10d. (0x1a is for power button)
7. So now change that :sswitch for these button to read as same as that for the touch shutter button. See example bellow:
Code:
.line 2172
.sparse-switch
0x3 -> :sswitch_24e
0x4 -> :sswitch_50
0x17 -> :sswitch_10d <!—Boton de disparo (normal shutter)
0x18 -> :sswitch_1f8 <!—Boton Vol+ (zoom in)
0x19 -> :sswitch_1f8 <!—Boton Vol- (zoom out)
0x1a -> :sswitch_1f8 <!-Boton Power (power button)
0x1b -> :sswitch_10d
0x42 -> :sswitch_10d
0x50 -> :sswitch_1fb
0x52 -> :sswitch_d4
.end sparse-switch
Click to expand...
Click to collapse
After:
.line 2172
.sparse-switch
0x3 -> :sswitch_25f
0x4 -> :sswitch_60
0x17 -> :sswitch_10d <!—Boton de disparo (normal shutter)
0x18 -> :sswitch_1f8 <!—Boton Vol+ (zoom in)
0x19 -> :sswitch_1f8 <!—Boton Vol- (zoom out)
0x1a -> :sswitch_10d <!-Boton Power (power button)
0x1b -> :sswitch_10d
0x42 -> :sswitch_10d
0x50 -> :sswitch_2fb
0x52 -> :sswitch_d4
.end sparse-switch
Click to expand...
Click to collapse
greetings from spain

N/A.

Will this work with 4.2.2?
OT: @klurosu what happened to you, mate? You've gone quiet for 2 months
Sent from my GT-I9105 using xda app-developers app

corduroy84 said:
Will this work with 4.2.2?
OT: @klurosu what happened to you, mate? You've gone quiet for 2 months
Sent from my GT-I9105 using xda app-developers app
Click to expand...
Click to collapse
Hi dude
No, this only works 100% on 4.1
P.S I have been promoted in my job so now ain't got much time and actually I'm working in S4 (I9505)
Grretings from spain

Related

[TUT]How to have Auto Rotate Home

Hi Guys, have you ever loved the stock launcher (like i did with SE stock launcher ) but wishes that it would auto rotate on your keyboard-less phone and you don't want any extra launcher? Have you ever popped out to your home launcher (after running an app) and finding the layout is rotated but soon to be set as portrait, and you want that landscape mode? Well you can actually
This is the requirement:
Home.apk of your phone
AutoAPKTool or APKMultiTool to decompile and recompile
Google SDK
Any editing and searching program (e.g. Notepad++ and WinGrep)
The steps are:
Backup your Home.apk
Decompile and Find the HomeActivity.smali
Change the Orientation Flag
Compile back and apply to the phone
The following sample is taken from my Modified Home.apk in Sony Ericsson, but should be comparable to all Launcher
These are the steps:
1. Backup your Home.apk
This is to prevent some unwanted behaviour since a home.apk is essentially your gateway to all apps so please make sure to backup (and create flashable zip to make it easier to revert back)
2. Decompile and Find the HomeActivity.smali
The idea is to find the Main Activity Class of Home Launcher (Activity is, in easier language, is the display of the active app on the screen)
Decompile the Home.apk first and find the Home Activity class.
In my sample from SE ICS Beta ROM, the file that needs to be edited is named smali\com\sonyericsson\home\HomeActivity.smali
3. Change Orientation Flag
If you have found it on the previous page, open it and find any line that contains this function
Code:
iget v6, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I
invoke-virtual {p0, v6}, Lcom/sonyericsson/home/HomeActivity;->[B]setRequestedOrientation(I)V[/B]
The Bold line is the essential function that determine your preferred orientation of home.apk.
After you found it, you must find the variable that used as the default orientation. From my sample above, it can be read as
Code:
[I]//this, in smali code, is p0[/I]
[B]
v6 = this.mDefaultOrientation;
this.setRequestedOrientation(v6);
[/B]
So the variable used here is the v6, which is stored before as this.mDefaultOrientation. Now your task is to find out what variable name that is used to store your Orientation Flag, and then later you need to watch for it if that variable get changed in the line.
My sample code is like this:
Code:
.method public constructor <init>()V
.
.
const v0, 0x5
iput v0, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I
.
.
.end method
.method public onCreate(Landroid/os/Bundle;)V
const v13, 0x4
.
.
const v10, 0x5
iput v10, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I
.
.
:goto_1
iget v6, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I
invoke-virtual {p0, v6}, Lcom/sonyericsson/home/HomeActivity;->setRequestedOrientation(I)V
.
.
.local v5, uiModeManager:Landroid/app/UiModeManager;
invoke-virtual {v5}, Landroid/app/UiModeManager;->getCurrentModeType()I
move-result v6
if-ne v6, v7, :cond_b
.line 580
const v6, 0x5
iput v6, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I
goto/16 :goto_1
.line 582
:cond_b
iput v13, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I
goto/16 :goto_1
.
.
.end method
As you see:
1. the init and OnCreate function assigns the default value to mDefaultOrientation of the Object and evaluates it if you have a docking function on the phone cond_b above).
2. The flag used above is set at 0x5 value, which is value of ActivityInfo.SCREEN_ORIENTATION_NOSENSOR (No sensor data will be applied to change orientation of the phone). To modify it, we need to modify that value to ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED which means it will follow device autoRotate settings.
3. In Sony Ericsson where there are docking accessories, they implement them as 0x4 (ActivityInfo.SCREEN_ORIENTATION_SENSOR) which means the device will always change the home orientation even though we turn off auto Rotate.
So, based on that info i changed the above lines to the following
Code:
.method public constructor <init>()V
.
.
[B]const v0, -0x1[/B]
iput v0, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I
.
.
.end method
.method public onCreate(Landroid/os/Bundle;)V
const v13, 0x4
.
.
[B]const v10, -0x1[/B]
iput v10, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I
.
.
:goto_1
iget v6, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I
invoke-virtual {p0, v6}, Lcom/sonyericsson/home/HomeActivity;->setRequestedOrientation(I)V
.
.
.local v5, uiModeManager:Landroid/app/UiModeManager;
invoke-virtual {v5}, Landroid/app/UiModeManager;->getCurrentModeType()I
move-result v6
if-ne v6, v7, :cond_b
.line 580
[B]const v6, -0x1[/B]
iput v6, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I
goto/16 :goto_1
.line 582
:cond_b //I keep this line to have 0x4 flag since it doesn't have to be taken care of.
iput v13, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I
goto/16 :goto_1
.
.
.end method
4. Compile back and Apply
Compile the Home.apk and don't forget to put the original MANIFEST Folder from original Home.apk so the Home.apk is signed
Voila, my Home Launcher is auto rotated now
CAUTION: Some error may occur at the first time you apply this mod (Possibly because of some unfit widgets on home when auto rotated). If it gives you error, please flash the stock one you backed up before and the home will be reset and then reapply the modded home. It should work
For further references, You can go to:
http://developer.android.com/reference/android/content/pm/ActivityInfo.html - For any kind of Orientation flag info
http://forum.xda-developers.com/showthread.php?t=1511730 - How-to of decompile and recompile APK (especially ICS)
Any question, please feel free to ask
G'day!
I couldn't get why 0x5 changed to -0x1, does that make the value to 0x4?
Sorry new in smali
fundre said:
I couldn't get why 0x5 changed to -0x1, does that make the value to 0x4?
Sorry new in smali
Click to expand...
Click to collapse
Please refer to google sdk link that i gave on the op. 0x5 is for no sensor behaviour. -0x1 means the orientation behaviour relies on device setting.
sent from my white ray using XDA App
Help please
brov please help me out, i dnt seem to understand anything when i open it with notepad+++
have attached my home.apk.....
I was very confused, because in my code a lot of orientation variable , please check
this is the source code from jd-gui
Code:
public void onCreate(Bundle paramBundle)
{
Context localContext = getApplicationContext();
this.mPackageLoader = ((HomeApplication)getApplication()).getPackageLoader();
this.mInfoGroupManager = ((HomeApplication)getApplication()).getInfoGroupManager();
MyInstanceState localMyInstanceState = (MyInstanceState)getLastNonConfigurationInstance();
label91: boolean bool;
label222: Object localObject1;
if (localMyInstanceState != null)
{
this.mResourceLoader = localMyInstanceState.resourceLoader;
this.mAdapterHelper = localMyInstanceState.adapterHelper;
this.mStatistics = localMyInstanceState.statistics;
this.mLandscapeModeEnabled = true;
this.mThemeOptionEnabled = true;
if (this.mLandscapeModeEnabled)
break label990;
this.mDefaultOrientation = 1;
setRequestedOrientation(this.mDefaultOrientation);
this.mDeskStandListener = new DeskStandListener(null);
this.mStartupMap = new LinkedHashMap();
this.mStartupMap.put("Application", roundToNearest100(((HomeApplication)getApplication()).getApplicationCreateDuration()) + "");
this.mOnCreateStartTime = SystemClock.uptimeMillis();
super.onCreate(paramBundle);
setContentView((ViewGroup)LayoutInflater.from(this).inflate(2130903060, null));
getWindow().setSoftInputMode(3);
if (getResources().getConfiguration().orientation != 2)
break label1033;
bool = true;
this.mOrientationLandscape = bool;
this.mDisplayMetrics = getResources().getDisplayMetrics();
this.mFullScreenEffectPlaceholder = ((ViewGroup)findViewById(2131624002));
this.mFadeView = ((BackgroundFadeSrcXferView)findViewById(2131623998));
setWallpaperDimensions();
this.mTransferView = ((TransferView)findViewById(2131623997));
setupTransferView(this.mTransferView);
this.mSwitchButtonHideAnim = AnimationUtils.loadAnimation(this, 2130968638);
this.mSwitchButtonShowAnim = AnimationUtils.loadAnimation(this, 2130968639);
this.mNetworkNameManager = new NetworkNameManager((NetworkNameView)findViewById(2131624004));
this.mSwitchButtonHideAnim.setInterpolator(new DecelerateInterpolator());
setDefaultKeyMode(4);
this.mAppTrayButton = findViewById(2131623964);
this.mAppTrayButton.setOnClickListener(new View.OnClickListener()
{
public void onClick(View paramView)
{
HomeActivity.this.hideDesktopAndOpenApptay(true);
}
});
this.mHomeButton = findViewById(2131623949);
this.mAppTrayButton.requestFocus();
this.mHomeButton.setOnClickListener(new View.OnClickListener()
{
public void onClick(View paramView)
{
if (HomeActivity.this.mStageController != null)
HomeActivity.this.mStageController.sparkle();
HomeActivity.this.closeApptrayAndShowDesktop(true);
}
});
createActivityFlow();
this.mOnTouchModeChangeListener = new ViewTreeObserver.OnTouchModeChangeListener()
{
public void onTouchModeChanged(boolean paramBoolean)
{
if ((!paramBoolean) && (HomeActivity.this.mStealFocusNextModeChange))
HomeActivity.this.mTransferView.setDescendantFocusability(393216);
HomeActivity.access$402(HomeActivity.this, true);
}
};
this.mInfoGroupManager.setInfoListener(new InfoGroupManager.InfoListener()
{
public void onInfoRemoved(Info paramInfo)
{
HomeActivity.this.removeInfo(paramInfo);
}
});
this.mInfoGroupManager.bind(this, this.mResourceLoader);
this.mWidgetManager = new WidgetManager(localContext, AppWidgetManager.getInstance(localContext), new HomeAppWidgetHost(localContext, 171808569));
this.mAdvWidgetManager = new AdvWidgetManager(this, this.mAdvWidgetHost, this.mPackageLoader);
createDesktop();
if (localMyInstanceState == null)
break label1039;
localObject1 = localMyInstanceState.stageModel;
label518: createStage(localObject1);
createCornerButtons();
if (localMyInstanceState == null)
break label1045;
}
label1025: label1033: label1039: label1045: for (Object localObject2 = localMyInstanceState.apptrayModel; ; localObject2 = null)
{
while (true)
{
createAppTray(localObject2);
createFolderLayer();
createAppShareDropZone();
createTrashcan();
if (localMyInstanceState != null)
{
if (localMyInstanceState.apptrayIsOpen)
{
hideDesktopAndOpenApptay(false);
this.mAppTrayController.moveToPane(localMyInstanceState.apptrayPane);
if (localMyInstanceState.apptrayIsEditing)
this.mAppTrayController.enterEditMode();
}
if (localMyInstanceState.isInOverview)
{
this.mDesktopController.setOverviewProgress(localMyInstanceState.overviewProgress);
if (this.mCornerController != null)
this.mCornerController.hide(false);
}
if (localMyInstanceState.isFolderOpen)
{
openFolder(localMyInstanceState.openFolder, localMyInstanceState.openFolderSourceLayer, localMyInstanceState.openFolderSourceLocation, false);
if (localMyInstanceState.openFolderRenaming)
this.mFolderController.setRenamingFolder(true);
}
if ((this.mStageController != null) && (localMyInstanceState.stageCreatingFolder))
{
this.mStageController.setCreatingFolder(true);
this.mStageController.setDroppedAtInfo(localMyInstanceState.stageDroppedAtInfo);
this.mStageController.setSavedPickedUpInfo(localMyInstanceState.stageSavedPickedUpInfo);
this.mStageController.setHintLocation(localMyInstanceState.stageHintLocation);
}
if ((this.mCornerController != null) && (localMyInstanceState.openCorner != -1))
this.mCornerController.expandCorner(localMyInstanceState.openCorner, false);
this.mSavedFolderText = localMyInstanceState.savedFolderText;
this.mAddingFolder = localMyInstanceState.addingFolder;
this.mRenamingFolder = localMyInstanceState.openFolderRenaming;
this.mAddTo = localMyInstanceState.addTo;
this.mDesktopLongPressLocation = localMyInstanceState.addFolderToDesktopLocation;
this.mStageLocation = localMyInstanceState.addFolderToStageLocation;
this.mAppTrayController.setButtonsDisabled(localMyInstanceState.apptrayDisableDuringSortDialog);
}
createBadgeBroadcastReceiver();
this.mStartupMap.put("onCreate", roundToNearest100(SystemClock.uptimeMillis() - this.mOnCreateStartTime) + "");
setupSmartSlider();
Configuration localConfiguration = getResources().getConfiguration();
this.mCurrentMcc = localConfiguration.mcc;
this.mCurrentMnc = localConfiguration.mnc;
if (this.mAddingFolder)
this.mActivityFlow.addFolder(this.mAddFolderListener, this.mSavedFolderText);
if (this.mRenamingFolder)
this.mFolderController.onCreate();
return;
this.mResourceLoader = new ResourceLoader(localContext, this.mPackageLoader, this.mInfoGroupManager, ((HomeApplication)getApplication()).getBadgeManager());
this.mAdapterHelper = new AdapterHelper(localContext, this.mResourceLoader);
this.mStatistics = new Statistics(localContext, this.mPackageLoader);
break;
try
{
label990: if (((UiModeManager)getSystemService("uimode")).getCurrentModeType() != 1)
break label1025;
this.mDefaultOrientation = 5;
}
catch (NoClassDefFoundError localNoClassDefFoundError)
{
this.mDefaultOrientation = 5;
}
}
break label91;
this.mDefaultOrientation = 4;
break label91;
bool = false;
break label222;
localObject1 = null;
break label518;
}
}
this is on smali code
Code:
.method public constructor <init>()V
.locals 1
.prologue
.line 137
invoke-direct {p0}, Landroid/app/Activity;-><init>()V
.line 332
[B]const/4 v0, -0x1[/B]
iput v0, p0, Lcom/sonyericsson/home/HomeActivity;->mDefaultOrientation:I
thanks...
Thank you very much. I won't use auto rotate, but you have helped me understand smali (a pretty weird language) well enough to do something else: disable themes in Home.apk (disable the menu item and the button in the long-press menu).
To make myself helpful, if someone wants to do that (themes are pretty useless if you don't have a real xperia S, because they only change the background), here's how I did it. It's very similar to the auto-rotate thing, you just need to flip a flag.
I changed this in HomeActivity.smali (line 3156 in version 2.2.A.0.14):
Code:
.line 571
const/4 v7, 0x1
iput-boolean v7, p0, Lcom/sonyericsson/home/HomeActivity;->mThemeOptionEnabled:Z
to this (the change is underlined):
Code:
.line 571
const/4 v7, [B][U]0x0[/U][/B]
iput-boolean v7, p0, Lcom/sonyericsson/home/HomeActivity;->mThemeOptionEnabled:Z
It didnt work!
i tool a stock HOME.APK... changed all the values like you did and nothing :\
and my xperia xro used to do it a few days ago by itself even when the keyboard is not out... than it rotated only when the charger was in... and now... nothing :\
any tips?
rmeker said:
It didnt work!
i tool a stock HOME.APK... changed all the values like you did and nothing :\
and my xperia xro used to do it a few days ago by itself even when the keyboard is not out... than it rotated only when the charger was in... and now... nothing :\
any tips?
Click to expand...
Click to collapse
Try downloading Rotation Locker and that'll be able to rotate any app or part of your device you'd like.
I'm a product of the system I was born to destroy!
KidCarter93 said:
Try downloading and that'll be able to rotte any app or part of your device you'd like.
a
I'm a product of the system I was born to destroy!
Click to expand...
Click to collapse
i know that there are tons of apps that do it... i want it to be integrated in the HOME.APK like it used to be...
ok new update... i was able to do it... but the home.apk doesnt work... which means i cant see anything besides my wallpaper... but the wallpaper is autorotating... now what should i do about the non working apk? :\ (I already flashed the old home.apk without the auto-rotate... but i want that feature!!!)

[HOW-TO] Samsung Galaxy S II Plus - Modding Guides

Hello everyone, here, I'll be writing a few guides on how to setup some XML/SMALI mods to aid people on ROM/MOD development. I will try to make everything as simple as possible. However, there will be different difficulty levels for each tutorial, which are [VERY EASY, EASY, MODERATE, HARD, VERY HARD]
GRAB YOUR TOOLS
​Below is a list of essential programs or tools for any sort of modding, which also applies to the guides below.
APKTOOL
Here's how to setup apktool and use it
Notepad++
7zip
Brain
GUIDES
​ADD MORE TOGGLES TO THE NAVIGATION PANEL
Difficulty level: [EASY]
Special thanks to @MalekoUK
​
Decompile SystemUI.apk
Go to \res\values\arrays.xml (Open using Notepad++)
You will see a list similar to this:
Code:
<string-array name="QuickSettingButtonAttribute">
<item>Wifi</item>
<item>Location</item>
<item>SilentMode</item>
<item>AutoRotate</item>
<item>Bluetooth</item>
<item>MobileData</item>
<item>DormantMode</item>
<item>PowerSaving</item>
<item>Sync</item>
</string-array>
This represents the order in which the toggles are placed in the navigation panel.
You can add a toggle for a few stuff which Samsung have disabled by default, here are the available toggles that can be added:
Code:
<item>AirplaneMode</item> - Airplane mode
<item>DoNotDisturb</item> - Disable/enable notifications toggle
<item>DrivingMode</item> - Driving mode
<item>NfcP2p</item> - NFC
<item>SBeam</item> - S Beam
<item>SmartStay</item> - Smart Stay
So if for example we add Smart Stay, just after Power Saving, the new code portion will look like this:
Code:
<string-array name="QuickSettingButtonAttribute">
<item>Wifi</item>
<item>Location</item>
<item>SilentMode</item>
<item>AutoRotate</item>
<item>Bluetooth</item>
<item>MobileData</item>
<item>DormantMode</item>
<item>PowerSaving</item>
[B][COLOR=Red] <item>SmartStay</item>[/COLOR][/B]
<item>Sync</item>
</string-array>
Save and recompile the APK
HOW TO CHANGE THE TOGGLE LABELS (TEXT UNDER TOGGLES)
This is an additional step and you may or may not do it. It is recommended for one weirdly named toggle though, the NFC one, so this is the one we'll be renaming.
Navigate to \res\values\strings.xml (Open using Notepad++)
Use CTRL+F to bring up the search box and enter quickpanel_nfc_text... You will see this line of code:
Code:
<string name="quickpanel_nfc_text">"R/W
P2P"</string>
Change it to:
Code:
<string name="quickpanel_nfc_text">"NFC"</string>
Save and recompile the APK.
INCREASE LOCKSCREEN SHORTCUTS NUMBER TO 4
Difficulty level: [VERY EASY]
Special thanks to @majdinj
Decompile SecSettings.apk
Navigate to \smali\com\android\settings\lockscreenshortcut\LockscreenShortcutSettings.smali
Look for this code
Code:
# direct methods
.method static constructor <clinit>()V
.locals 2
.prologue
const/4 v1, 0x0
.line 79
const/4 v0, 0x3
Change it to this
Code:
# direct methods
.method static constructor <clinit>()V
.locals 2
.prologue
const/4 v1, 0x0
.line 79
const/4 v0, 0x2
Save the file and decompile SecSettings.apk
ENABLE SMART ROTATION
Difficulty level: [VERY EASY]
Special thanks to @majdinj again
Decompile SecSettings.apk
Navigate to \smali\com\android\settings\DisplaySettings.smali
Search for this code portion:
Code:
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v10
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mSmartRotation:Landroid/preference/CheckBoxPreference;
invoke-virtual {v10, v11}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
Delete the 4 lines.
Save the file and recompile SecSettings.apk
More to come...
​
POWER BUTTON AS CAMERA SHUTTER
Difficulty level: [EASY]
Special thanks to @klurosu
His guide
Decompile SamsungCamera.apk
Navigate to \smali\com\sec\android\app\camera and open Camera.smali
As you can see, codes go under specific "methods", like categories, wrapped around .method and .end method tags... So the "category" we'll be going for is:
Code:
.method public onKeyDown(ILandroid/view/KeyEvent;)Z
Scroll down ( a lot, but not too much, just before the .end method of the method we went to) to the following code portion:
Code:
.line 1884
:sswitch_data_0
.sparse-switch
0x4 -> :sswitch_1
0x17 -> :sswitch_4
0x18 -> :sswitch_5
0x19 -> :sswitch_5
[B][COLOR=Blue]0x1a -> :sswitch_1[/COLOR][/B]
0x1b -> :sswitch_4
0x42 -> :sswitch_4
0x45 -> :sswitch_5
0x46 -> :sswitch_5
0x50 -> :sswitch_3
0x52 -> :sswitch_0
0x55 -> :sswitch_2
0x59 -> :sswitch_2
0x5a -> :sswitch_2
0x9c -> :sswitch_5
0x9d -> :sswitch_5
.end sparse-switch
A few things need to be noted here. First, the switch name (sswitch_x) is not always the same as you might have, but the id (0x##) is always the same. Here 0x17 is the shutter key on the screen, and 0x1a is the power button... we need to reroute the power button's switch to the shutter key's switch. So we'll be focusing on the blue line.
Change the code to the following if you haven't already figured it out.
Code:
.line 1884
:sswitch_data_0
.sparse-switch
0x4 -> :sswitch_1
0x17 -> :sswitch_4
0x18 -> :sswitch_5
0x19 -> :sswitch_5
[B][COLOR=Red]0x1a -> :sswitch_4[/COLOR][/B]
0x1b -> :sswitch_4
0x42 -> :sswitch_4
0x45 -> :sswitch_5
0x46 -> :sswitch_5
0x50 -> :sswitch_3
0x52 -> :sswitch_0
0x55 -> :sswitch_2
0x59 -> :sswitch_2
0x5a -> :sswitch_2
0x9c -> :sswitch_5
0x9d -> :sswitch_5
.end sparse-switch
No we're not done yet lazy! The next method is just under the .end method of the previous one, which we were already at, but if you saved and closed the smali out of sheer excitement, reopen it and go to this method:
Code:
.method public onKeyUp(ILandroid/view/KeyEvent;)Z
Now scroll down (a lot, but not too much, right before the .end method tag) to the following code portion:
Code:
:sswitch_data_0
.sparse-switch
0x3 -> :sswitch_5
0x4 -> :sswitch_0
0x17 -> :sswitch_2
0x18 -> :sswitch_3
0x19 -> :sswitch_3
[B][COLOR=Blue]0x1a -> :sswitch_3[/COLOR][/B]
0x1b -> :sswitch_2
0x42 -> :sswitch_2
0x50 -> :sswitch_4
0x52 -> :sswitch_1
.end sparse-switch
Again the switch names might not be the same and we'll focus on the 0x1a switch (blue line), as the previous step, and reroute it to 0x17.
Again, if you haven't figured it out yourself, edit the code to the following:
Code:
:sswitch_data_0
.sparse-switch
0x3 -> :sswitch_5
0x4 -> :sswitch_0
0x17 -> :sswitch_2
0x18 -> :sswitch_3
0x19 -> :sswitch_3
[COLOR=Blue] [COLOR=Red][B]0x1a -> :sswitch_2[/B][/COLOR][/COLOR]
0x1b -> :sswitch_2
0x42 -> :sswitch_2
0x50 -> :sswitch_4
0x52 -> :sswitch_1
.end sparse-switch
Save the file and recompile the APK
CRT-OFF EFFECT
Difficulty level: [EASY]
@Special thanks to @klurosu and @majdinj
klurosu's guide
NEW TOOL MUST BE DOWNLOADED: Classes.dex compiler/decompiler
Download the tool and extract it to a location of your liking and let's begin.
Take services.jar from framework folder and open it with 7zip.
Copy classes.dex from services.jar (opened with 7zip) to the input folder in the folder of the tool we extracted initially.
Run Script.bat and choose "decompile classes.dex"
Navigate to the decompiled folder in the tool folder and go to \com\android\server and openPowerManagerService$ScreenBrightnessAnimator.smali file
Look for the following portion of code:
Code:
.line 3064
.end local v0 #delta:I
:cond_60
:goto_60
iget-object v7, p0, Lcom/android/server/PowerManagerService$ScreenBrightnessAnimator;->this$0:Lcom/android/server/PowerManagerService;
#getter for: Lcom/android/server/PowerManagerService;->mScreenBrightnessHandler:Landroid/os/Handler;
invoke-static {v7}, Lcom/android/server/PowerManagerService;->access$7200(Lcom/android/server/PowerManagerService;)Landroid/os/Handler;
move-result-object v7
const/16 v9, 0xa
invoke-virtual {v7, v9}, Landroid/os/Handler;->removeMessages(I)V
Change it to this: ( add the red lines )
Code:
.line 3064
.end local v0 #delta:I
:cond_60
:goto_60
iget-object v7, p0, Lcom/android/server/PowerManagerService$ScreenBrightnessAnimator;->this$0:Lcom/android/server/PowerManagerService;
#getter for: Lcom/android/server/PowerManagerService;->mScreenBrightnessHandler:Landroid/os/Handler;
invoke-static {v7}, Lcom/android/server/PowerManagerService;->access$7200(Lcom/android/server/PowerManagerService;)Landroid/os/Handler;
move-result-object v7
[B][COLOR=Red]if-eqz p2, :cond_maj
const/16 v9, 0xb
const/4 v10, 0x0
const v2, 0x10
invoke-virtual {v7, v9, v2, v10}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;
move-result-object v9
invoke-virtual {v9}, Landroid/os/Message;->sendToTarget()V
:cond_maj[/COLOR][/B]
const/16 v9, 0xa
invoke-virtual {v7, v9}, Landroid/os/Handler;->removeMessages(I)V
Reserved 2
Reserved 3
I am currently trying to get the power button to work as a camera shutter key... Will post a tutorial if I succeed.
panda00 said:
I am currently trying to get the power button to work as a camera shutter key... Will post a tutorial if I succeed.
Click to expand...
Click to collapse
Very easy...told ya tomorrow (i'm in bed)
Enviado desde mi GT-I9105P usando Tapatalk 2
klurosu said:
Very easy...told ya tomorrow (i'm in bed)
Enviado desde mi GT-I9105P usando Tapatalk 2
Click to expand...
Click to collapse
That's great. Thanks. Was just about to start some testing but I guess that won't be necessary LOL.
The power button as camera shutter is, in my opinion, the most necessary thing here, at least for me, as the phone works great out of the box!!
Thank you very much for that!!
daruu92 said:
The power button as camera shutter is, in my opinion, the most necessary thing here, at least for me, as the phone works great out of the box!!
Thank you very much for that!!
Click to expand...
Click to collapse
It's actually gonna go in the very easy category lol... so pretty much anyone would be able to do it.
Sent from my GT-I9105P using xda app-developers app
Well, I'm total noobish, actually I bought the phone yesterday in Amazon, and the only thing that I didn't like was the absence of shutter button in camera.
The camera of this phone is so great
Thank you again
I'm yet to see a Samsung Android phone with a shutter key...
Tonight panda and me will post the how to tutorial dudes
Just hold on a little more
From I9105P hipervitaminated
Just gave it a shot... bootloop. I don't understand, even if I did something wrong (which I'm sure I didn't!)... The camera shouldn't be able to bootloop me, unless the apk wasn't signed, but it is... any suggestions @klurosu?
panda00 said:
Just gave it a shot... bootloop. I don't understand, even if I did something wrong (which I'm sure I didn't!)... The camera shouldn't be able to bootloop me, unless the apk wasn't signed, but it is... any suggestions @klurosu?
Click to expand...
Click to collapse
I rwturn home 'bout 22:00 (local time) at 22:30 aprox. I'll uplpad the camera mod with power button as shoot.
P.s
Don't understand ypur bootloops panda... i'm sure your right with yours comps/decomps
From I9105P hipervitaminated
klurosu said:
I rwturn home 'bout 22:00 (local time) at 22:30 aprox. I'll uplpad the camera mod with power button as shoot.
P.s
Don't understand ypur bootloops panda... i'm sure your right with yours comps/decomps
From I9105P hipervitaminated
Click to expand...
Click to collapse
I'm sure as well
Sent from my GT-I9105P using xda app-developers app
Good night buddys!
panda00 and me are proud to present:
I9105P Camera MOD (power button shutter)
The mod works fine, the camera works fine.
The only mod is... power button as shutter (you must press long time button power to take pic.. the shutdown menu appears but the pic saved is ok)
I can upload Camera focus sound disabled, flash in low battery state & Shutter Sound On/Off" option in Camera Menu
klurosu said:
Good night buddys!
panda00 and me are proud to present:
I9105P Camera MOD (power button shutter)
The mod works fine, the camera works fine.
The only mod is... power button as shutter (you must press long time button power to take pic.. the shutdown menu appears but the pic saved is ok)
I can upload Camera focus sound disabled, flash in low battery state & Shutter Sound On/Off" option in Camera Menu
greetings from spain
Click to expand...
Click to collapse
I basically did nothing here. I'm going to post a tutorial though... full thanks n credit to klurosu!
Sent from my GT-I9105P using xda app-developers app
panda00 said:
I basically did nothing here. I'm going to post a tutorial though... full thanks n credit to klurosu!
Sent from my GT-I9105P using xda app-developers app
Click to expand...
Click to collapse
Don't be modest man.. your ideas and support makes the diference.
New guide thanks to @klurosu
Hi, do this camera mod works with CM10.1 too? Thanks

[Q] Wake device with another button!

Hi my friends!
Anybody know how to wake the Xperia L with another button than the power one? The power button is very weak, and i prefer to unlock it with another. What files must be edited? I know some keylayout related files are in system/usr/keylayout, but i don't know what to edit.
Thanks in advance, and sorry for my english!
Use Auto Screen On frm google play. Works through proximity sensor.
Sent from my C2104 using xda app-developers app
I know about that app, but is there a way to get the feature by editing the layout?
Escrito desde mi Xperia L y weá
Bro... android.policy.jar is the file you need to edit (com\android\internal\policy\impl\PhoneWindowManager.smali)!
All key events are intercepted into interceptKeyBeforeDispatching method. There you will find a switch function that checks all key codes events and do the job. Power key related codes are into 1a hex switch and under its "case" statement sswitch_1e3). See google docs under KEYCODE_POWER
Red is KEYCODE_POWER switch (1a) pointing to its case sswitch_1e3)
Code:
.line 3775
nop
:sswitch_data_338
.sparse-switch
0x5 -> :sswitch_71
0x6 -> :sswitch_199
0x18 -> :sswitch_aa
0x19 -> :sswitch_aa
[COLOR="red"]0x1a -> :sswitch_1e3[/COLOR]
0x1b -> :sswitch_2dd
0x4f -> :sswitch_284
0x55 -> :sswitch_276
0x56 -> :sswitch_284
0x57 -> :sswitch_284
0x58 -> :sswitch_284
0x59 -> :sswitch_284
0x5a -> :sswitch_284
0x5b -> :sswitch_284
0x7e -> :sswitch_276
0x7f -> :sswitch_276
0x82 -> :sswitch_284
0xa4 -> :sswitch_aa
0x400 -> :sswitch_2bd
0x401 -> :sswitch_32a
.end sparse-switch
.end method
All you need to do is to remap related code with key code you want!! It´s not so easy, but totally possible!!
serajr said:
Bro... android.policy.jar is the file you need to edit (com\android\internal\policy\impl\PhoneWindowManager.smali)!
All key events are intercepted into interceptKeyBeforeDispatching method. There you will find a switch function that checks all key codes events and do the job. Power key related codes are into 1a hex switch and under its "case" statement sswitch_1e3). See google docs under KEYCODE_POWER
Red is KEYCODE_POWER switch (1a) pointing to its case sswitch_1e3)
Code:
.line 3775
nop
:sswitch_data_338
.sparse-switch
0x5 -> :sswitch_71
0x6 -> :sswitch_199
0x18 -> :sswitch_aa
0x19 -> :sswitch_aa
[COLOR="red"]0x1a -> :sswitch_1e3[/COLOR]
0x1b -> :sswitch_2dd
0x4f -> :sswitch_284
0x55 -> :sswitch_276
0x56 -> :sswitch_284
0x57 -> :sswitch_284
0x58 -> :sswitch_284
0x59 -> :sswitch_284
0x5a -> :sswitch_284
0x5b -> :sswitch_284
0x7e -> :sswitch_276
0x7f -> :sswitch_276
0x82 -> :sswitch_284
0xa4 -> :sswitch_aa
0x400 -> :sswitch_2bd
0x401 -> :sswitch_32a
.end sparse-switch
.end method
All you need to do is to remap related code with key code you want!! It´s not so easy, but totally possible!!
Click to expand...
Click to collapse
Thanks my friend, i'll take a look!
Escrito desde mi Xperia L y weá

[GUIDE][NEWBIE] Disable Signature Check

FAQ's
[*]Why Disable Signature?
- So that the rom will recognize the app that you mod
- So that you will not do the extraction method
- So that your life will be easy
Requirements:
Apktool(PC or Mobile) 1.5.2 or 2.0
Rootexplorer(Mobile)
Text Editor
Instructions:
- Decompile services.jar
- Go to > smali > com > android > server > pm > PackageManagerService
- Search this code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/SignatureI
- Select the whole method(.method to .end method of the given method) and replace it with this code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/SignatureI
.locals 7
const-string p0, "DSA:"
const-string p1, "Skip signatures check"
invoke-static {p0, p1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/StringI
const/4 v6, 0x0
return v6
.end method
Note: Make sure there is a space between .end method and .method
- Recompile > Sign > Push or Flash
#WeAreTeamPussy
Credits:
Bang Bangger Files
Material Modding Team
Underground
MAAaD
MAAaDR
Android Pie compatible?
Will this method work on Pie?

Mod - Guide - Allow Flash on camera until the battery dies

hi help mod complate ?
mod apk download work ?
camera
https://yadi.sk/d/NSYonitK37DtU9
http://www.esp-desarrolladores.com/showthread.php?t=4456&page=317&p=140387#post140387
Mod - Guide - Allow Flash on camera until the battery dies
As I have mentioned this morning this mod is bull**** if we have the apk samsungcamera6.apk deodexada camera.
- Decompilamos
- We publish com / sec / android / app / camera / Camera.smali
and within the protected .Method onCreate (Landroid / os / Bundle V locate this string "config_lowBatteryWarningLevel" ...
and add the line in blue following
Code:
...
const-string v21, "config_lowBatteryWarningLevel"
Const-string v22, "integer"
Const-string v23, "android"
Invoke-virtual / range {v20 .. v23}, Landroid / content / res / Resources; -> getIdentifier (Ljava / lang / String; Ljava / lang / String; Ljava / lang / String;
Move-result v20
Invoke-virtual / range {v19 .. v20}, Landroid / content / res / Resources; -> getInteger (I) I
Move-result v19
Move / from16 v0, v19
Move-object / from16 v1, p0
Const v0, 0x0 #grxgrx
Iput v0, v1, Lcom / sec / android / app / camera / Camera; -> mLowBatteryWarningLevel: I
...
We will have to adapt that line in the next versions if it changes. Notice that the value is read from the integer that commented on the framework-res and in this case is saved in v19, whose value is copied to v0 and hence the subject is put to v0 .. ná a chorradilla but I like it More carry the camera. Do not jorobéis me that is not attacked by the bulbous off camera flash 15% ... Finally, and I will take the systemui to remove this limit also exists
and ready chicken. We already have flash until the battery runs out.
Tested and working.

Categories

Resources