Related
Hi,
I'm starting this thread to see if we can combine our knowledge to re-enable two missing options in the stock camera app (in 2.2+ Android) : flash light and zoom.
Personally, my main goal is flash - I don't care about zoom, but it would be better to make everything working back just for fun
(Please note I'm using Wolf's CM6 latest, including this thread fix)
I noticed the stock camera Manifest is missing the permission :
Code:
<uses-permission android:name="android.permission.FLASHLIGHT" />
Please note there's also missing the GSM/Wifi location, in case you wanna use photo location tagging without GPS :
Code:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Using Vignette, looking nice working with LED, I try to find out how Vignette calls the LED - and compare with stock camera app, not detecting there's flashlight.
Do you have ideas, investigations, etc etc ? Idea of the thread is to share knowledge to finally make the stock app working as it should be
Hope this thread won't be useless
The most interesting files look to be these ones :
Camera.apk\smali\com\android\camera\
- BaseCamera.smali
- BaseCamera$ZoomListener.smali
- BaseCamera$ZoomGestureListener.smali
- Camera.smali
- CameraSettings.smali
There are some others I didn't put here.
CameraSettings.smali looks to be the most important file, as it defines capabilities, using getSupportedFlashModes() for light and isZoomSupported() for main zoom support.
hope this helps to gain some time.
EDIT : capabilites for LED are checked using Landroid/hardware/Camera$Parameters
(\smali\com\android\camera\CameraSettings.smali, line 1226)
EDIT 2 : Logcat returns the camera doesn't even attempt to invoke flashlight or zoom from Camera$Parameters, so it may mean the bug comes from android.hardware.camera.Parameters...
Anyone to help ? I'm not noob, but I'm not real dev
Just before we move on,
I got something you might need to consider. As far as we know there should be 2 type of zoom; analog one (optical, hardware zoom), and logical one (crop)
I don't think x10 is capable for optical one, and I don't know about the other phone.
If another phone is doing the same thing as x10 (S/W cropping) with stock camera.
> then (1) you are fixing the hardware cropping (crop the pix at hardware layer).. which might not possible.
> or (2) finding the way to relocation from hardware cropping to software cropping (just like vignette)
If the other phone using stock cam to control optical zoom
> then (3) you basicly can't fix it.
(3) doesn't make sense for me, kernel should be able to tell whether the camera has optical zoom or not, the software only decide which method is to be used for zooming.
(1) is possible but still doesn't make sense for me.
So I guess (2) got potential one, we'll just need to bypass some setting and force the s/w to use cropping method.
I'm not linux fan, but i'm camera fan, hope it help at least a little.
Sorry if i'm wrong.
hey mate,
A workaround can be the way that stock 2.1 camera cals the led flashlight.
In that app, the flashlight wasnt a true flashlight, it was a lantern than u can turn on of off.
so, this app can make it:
http://forum.xda-developers.com/attachment.php?attachmentid=600562&d=1305770576
So, can we route the program led call to camera, the exactly same way that SE does in stock 2.1
Just an idea.
@Cebees : lmao noone will be able to make optical zoom to work as there's no optical zoom at all
I was talking of numeric (crappy) zoom, just like on the stock 2.1 ; as I said I don't really care (I never use it, sooooo crappy) but if we can implement it back, it might be useful/nice for people who need it.
@pedrocel85 : that's a good idea, I was thinking about this when checking the files. It looks Vignette calls the LED in a weird way also, not a way the stock camera looks to like
PS : thanks for link, bored to get x10 torch from Market
In TorchX10, LED looks invokated like this :
(in FlashDevice.smali, l.9)
Code:
.field private static final DEVICE:Ljava/lang/String; = "/sys/class/leds/lv5219lg:fled/brightness"
In CameraSettings.smali (l. 1226) :
Code:
invoke-virtual/range {v30 .. v30}, Landroid/hardware/Camera$Parameters;->getSupportedFlashModes()Ljava/util/List;
"/sys/class/leds/lv5219lg:fled/brightness" refers to what we need to reach : that's the "real" LED torch enabler...
Hasn't flash been covered? http://forum.xda-developers.com/showthread.php?t=1081496
And zoom is pointless. I'd rather see someone remove the interface from camera.apk all together.
Sent from my X10i using XDA Premium App
kxhawkins said:
Hasn't flash been covered? http://forum.xda-developers.com/showthread.php?t=1081496
And zoom is pointless. I'd rather see someone remove the interface from camera.apk all together.
Sent from my X10i using XDA Premium App
Click to expand...
Click to collapse
I've stated the link in my first post. Problem is the torch won't work in stock app with this fix.
To remove almost all graphics and that ugly border, you can decompile the APK and edit xml/png
Perceval from Hyrule said:
I've stated the link in my first post. Problem is the torch won't work in stock app with this fix.
To remove almost all graphics and that ugly border, you can decompile the APK and edit xml/png
Click to expand...
Click to collapse
Percy,
Cant u code the correct way to route the lantern command in camera.apk?
I cant code at all, but i can help in png and xml editing
I'm just like you Pedro, I'm not a dev but I can work on xml/png
The trouble may not come from camera.apk but from driver.
Logcat returns nothing about zoom or flash, so trouble might come from android.hardware.Camera.Parameters.
I guess Camera.Parameters.getSupportedFlashModes() returns 0, just like Camera.Parameters.isZoomSupported().
Sooooooo my main trouble is to know where the hell is this Camera.Parameters file ! I've reseted a long time ago my Linux so I've no more Android sources.
Can someone tell me where is the file ? For help, it's Landroid/hardware/Camera$Parameters.
My logcat returns this, you should get the same - note there's no flash, and no zoom.
Code:
D/CameraSettings( 3055): [antibanding-values=off,50hz,60hz,auto, antibanding=off, auto-exposure-valu
es=frame-average,center-weighted,spot-metering, auto-exposure=frame-average, effect-values=none,mono
,negative,sepia,posterize, effect=none, exposure-compensation=0, focus-mode-values=auto,macro,infini
ty, focus-mode=auto, jpeg-quality=100, jpeg-thumbnail-height=120, jpeg-thumbnail-quality=100, jpeg-t
humbnail-width=160, picture-format-values=jpeg, picture-format=jpeg, picture-size-values=640x480,163
2x1224,1920x1080,3264x1836,3264x2448, picture-size=3264x2448, preview-format-values=yuv420sp, previe
w-format=yuv420sp, preview-frame-rate-values=7,10,12,15,24,30, preview-frame-rate=30, preview-size-v
alues=320x240,640x480,800x480,848x480,854x480,864x480,1280x720, preview-size=640x480, scene-mode-val
ues=auto,portrait,landscape,night,night-portrait,beach,snow,sports,party, scene-mode=auto, whitebala
nce-values=auto,incandescent,fluorescent,daylight,cloudy-daylight, whitebalance=auto]
If you don't want to run logcat from computer, the app XZing test will return you parameters right from your device
Important reference about Flash mode here !
Perceval from Hyrule said:
Hi,
I'm starting this thread to see if we can combine our knowledge to re-enable two missing options in the stock camera app (in 2.2+ Android) : flash light and zoom.
Personally, my main goal is flash - I don't care about zoom, but it would be better to make everything working back just for fun
(Please note I'm using Wolf's CM6 latest, including this thread fix)
I noticed the stock camera Manifest is missing the permission :
Code:
<uses-permission android:name="android.permission.FLASHLIGHT" />
Please note there's also missing the GSM/Wifi location, in case you wanna use photo location tagging without GPS :
Code:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Using Vignette, looking nice working with LED, I try to find out how Vignette calls the LED - and compare with stock camera app, not detecting there's flashlight.
Do you have ideas, investigations, etc etc ? Idea of the thread is to share knowledge to finally make the stock app working as it should be
Hope this thread won't be useless
Click to expand...
Click to collapse
Zoom is possible via an app called Camera Zoom FX...try getting the necessery files from this app
hi would it be possible to implement the exposure value in the 2.2 camera?
I found it more important than zoom or flash! as we can get good pictures with exposure compensation than with the flash in X10!
In the SemcCamera, the exposure related settings are available in
BaseController.smali
but I couldn't find any such file in the 2.2 camera! any lights on this please?
actually there is a method called setEV is there in
BaseController.smali
Code:
method public setEv(Ljava/lang/String;)V
.registers 5
.parameter "value"
.prologue
.line 520
const-string v0, "BaseController"
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "setEv("
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
const-string v2, ")"
invoke-virtual {v1, v2}, 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
invoke-static {v0, v1}, Lcom/sonyericsson/android/camera/util/CameraLogger;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 521
iget-object v0, p0, Lcom/sonyericsson/android/camera/BaseController;->mCameraDevice:Lcom/sonyericsson/android/camera/CameraDevice;
const-string v1, "exposure-compensation"
invoke-virtual {v0, v1, p1}, Lcom/sonyericsson/android/camera/CameraDevice;->setParametersSafe(Ljava/lang/String;Ljava/lang/String;)V
.line 522
return-void
.end method
Here are original sources for camera.apk, directly coming from latest AOSP
It will be easier to find interesting stuff regarding all our needs : exposure, flash, zoom, etc etc.
But do not forget these files need to be compiled
Port the Horizontal app switcher MOD for Galaxy Nexus to CM9 for the Touchpad? The thread has source info & it'd be consistent with WebOS...
+1
Damn, that's sexy. Reminds me of when I had ProSwitcher on my iphone before IOS4 dropped. I've always been a fan of the cards in multitasking. One of the WebOS features I do enjoy.
+2 what ^said.
Sent from my HP Touchpad running CM9
dam, if only i didnt have exams this month i would try porting it.
i was trying to port it earlier but apkmultitool doesnt seem to work properly with ics apks
thesparky007 said:
i was trying to port it earlier but apkmultitool doesnt seem to work properly with ics apks
Click to expand...
Click to collapse
You've got to use the latest apktool and replace aapt.exe with this file.
I've started porting it but ran into some problems to do with the DPI/screen resolution difference.
Thumbnails are very small/low-res and won't fill the screen properly. I am planning on playing around with it some more tomorrow.
~reserved~
Well I got it working pretty good (in landscape). It just looks bad due to the low res thumbnails, and even worse if I make the thumbnails as large as WebOS. Also, performance is a bit on the slow side.
I think I might have found the file that controls the thumbnail size but I'm not really sure what to change.. The file is /smali/com/android/systemui/recent/RecentTasksLoader.smali and here are the lines in question:
Code:
invoke-virtual {v6, v8}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v7
.line 90
.local v7, width:I
const v8, 0x1050001
invoke-virtual {v6, v8}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v4
.line 91
.local v4, height:I
const v8, 0x7f0200f5
Here is what it currently looks like:
If anyone wants to give it a go or try to help fix the thumbnails/portrait issues shoot me a PM and I'll send the APK.
Hi there, I do own a lot of gameloft games, and already ported lots of them to atrix editing the apk in apk manager. However, some of the games cannot go in fullscreen, and I do know that is possible to change the scripts of the decompiled gameloft.apk to be 960x540 native resolution. I already read lots and lots of tutorials and all point to the same way:
Put the apk in apk manager
decompile
open projetcs\game\smali\......\ml\GameRenderer.smali with notepad
edit it
compile back
sign and install
However, they dont really explian what i should edit it and how, the best I did find was this:
http://www.galaxy-ace.in/2011/08/how-to-port-android-hd-games-to-hvga.html
But there is no line:
const/4 v1, 0x1
or
const/2 v2, 0x1
And when there is, there is only the cont/4 vX
Can anyone explain to me how can i really do it?
Recently Im trying to get Eternal Legacy 1.0.8 in full screen on my atrix (did bought to my sgs), the game works fine with PVRT textures, however it goes on 480X800 on my atrix 540x960, leaving some black borders.
However when I open the GameRenderer.smali Look what I found:
.method public onSurfaceCreated(Ljavax/microedition/khronos/opengles/GL10;Ljavax/microedition/khronos/egl/EGLConfigV
.locals 3
const/4 v2, 0x1
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
const-string v1, "onSurfaceCreated"
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/StringV
sget-object v0, Lcom/gameloft/android/TBFV/GloftELHP/ML/GameRenderer;->a:Landroid/content/Context;
check-cast v0, Landroid/app/Activity;
invoke-virtual {v0}, Landroid/app/Activity;->getWindowManager()Landroid/view/WindowManager;
move-result-object v0
invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;
move-result-object v0
invoke-virtual {v0}, Landroid/view/Display;->getWidth()I
invoke-virtual {v0}, Landroid/view/Display;->getHeight()I
invoke-direct {p0}, Lcom/gameloft/android/TBFV/GloftELHP/ML/GameRenderer;->nativeGetJNIEnv()V
invoke-static {}, Lcom/gameloft/android/TBFV/GloftELHP/ML/GLResLoader;->a()V
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
const-string v1, "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/StringV
invoke-static {}, Lcom/gameloft/android/TBFV/GloftELHP/ML/GLMediaPlayer;->a()V
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
const-string v1, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/StringV
invoke-static {v2}, Lcom/gameloft/android/TBFV/GloftELHP/ML/GameRenderer;->nativeInit(I)V
invoke-static {v2}, Lcom/gameloft/android/TBFV/GloftELHP/ML/EternalLegacy;->nativeInit(I)V
return-void
.end method
Im lost
please help
same problem as op
I am having the same issue with the same game has anyone found a fix for this? I have a razr and the game only uses like half the screen which can get really annoying.
solution
I don't know if this will work for anyone else but, I was able to modify the AndroidManifest.xml to fix the resolution.
I edited the following line
<supports-screens android:anyDensity="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="false" android:resizeable="false" />
Click to expand...
Click to collapse
so the smallScreens=false and the largeScreens=true
star battalion qHD
Have someone modded star battalion to work with qHD resolution?
MIne not even working!
My games are not even working ...
Dont know why I had nfshp(Eagames) it worked 1 time after that problems..
And others not even working, like Asphalt6 just closes after video >>
Help!
1. The problem, that it appears every minute until conditions are changes over navigation program.
I'd like to disable the message only, but not an action (switching off charging)
2. I've low memory issues especially when using custom ROM's with batt%, 15 toggles and extended power menu. The ROM's, according description have memory tweaks, but I cant find what is tweaked.
Somebody can help ?
Something wrong with picture upload:
The message:
Title: Info
Text: Charging paused. Battery temperature too high
Button: (OK)
After OK it appears again in short time. I'd like to prevent it.
I've only had my S3 for about a week and already annoyed to hell by this pop-up, especially considering how easy it is to get the battery to overheat in a car holder driving under Israeli scorching sun.
I am currently working on disabling this pop-up using a nasty hack. Just found it's location and tried to kill it off... also killing the low battery warning (the usual one, mentioning 15% remaining), simply because it happened to be right next to it. I'll report the results after a few days of driving and post the patching instructions under the dev thread, if successful.
For those technically inclined, here we go... the "PowerUI.smali" is a part of SystemUI.apk... if you don't understand what the hell this cryptic stuff is just ignore this part of the message.
Code:
*** PowerUI.smali.old Thu Aug 02 00:45:43 2012
--- PowerUI.smali.new Thu Aug 02 03:14:13 2012
***************
*** 1734,1743 ****
--- 1734,1745 ----
iget-object v13, v0, Lcom/android/systemui/power/PowerUI;->mBatteryLevelTextView:Landroid/widget/TextView;
if-nez v13, :cond_0
+ return-void
+
const-string v13, "showing"
:goto_0
invoke-virtual {v15, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
***************
*** 2203,2212 ****
--- 2205,2216 ----
iget v6, p0, Lcom/android/systemui/power/PowerUI;->mBatteryHealth:I
if-ne v5, v6, :cond_0
+ return-void
+
.line 467
const v2, 0x7f0800a1
.line 478
.local v2, messageId:I
EDIT: 15% warning kill confirmed
Ok, here we go - http://forum.xda-developers.com/showthread.php?t=1810772
I've also removed the full battery notification as well now, i'll update the linked thread after testing.
With Zeppelinrox tearing up the multitasking scene around these parts lately I thought this would be a cool compliment to his mod. Plus it only work if you are using his modified services.jar. Heres his thread just a note: I used ff which should be a whole lot more than 16 but but there is a limit in android of 16 which im sure can be upped aswell i just havent looked yet.
mikeyxda brought it to my attention that a few of the edits weren't needed to complete this mod. So thanks mikey for making this even easier!
New zeppelinrox edits added make this mod unlimited panels!!!
Devs, Chefs, Rom Builders, Weekend warriors, whoever fell free to use.
First decompile SystemUI.apk
Navigate to com\android\systemui\recent\FxRecentTasksLoader.smali
search for
Code:
const/16 v1, 0x10
const/16 v2, 0x20
change to
Code:
const/16 v1, 0xff
const/16 v2, 0xff
search for
Code:
.field private static final DISPLAY_TASKS:I = 0x8
change to
Code:
.field private static final DISPLAY_TASKS:I = 0x[COLOR="red"]ff[/COLOR]
then just below is
Code:
.field private static final DISPLAY_TASKS:I = 0x10
change to
Code:
.field private static final DISPLAY_TASKS:I = 0x[COLOR="red"]ff[/COLOR]
then search for
search for .method getRecentTasks()Ljava/util/ArrayList;
the next instance of
Code:
const/16 v0, 0x8
change to
Code:
const/16 v0, 0x[COLOR="red"]ff[/COLOR]
Navigate to
com\android\systemui\recent\RecentAppFxActivity.smali
search for
iput-object v2, p0, Lcom/android/systemui/recent/RecentAppFxActivity;->mContext:Landroid/content/Context;
just below this is
Code:
const/16 v0, 0x8
change to
Code:
const/16 v0, 0x[COLOR="red"]ff[/COLOR]
just below that is
iput v0, p0, Lcom/android/systemui/recent/RecentAppFxActivity;->NUM_PANEL:I
then just below that is
Code:
const/16 v0, 0x10
change to
Code:
const/16 v0, 0x[COLOR="red"]ff[/COLOR]
then search for
.method private refreshRecentTasksList(Ljava/util/ArrayListV
and the next instance of
Code:
const/16 v5, 0x8
change to
Code:
const/16 v5, 0x[COLOR="red"]ff[/COLOR]
this is probably not necessary
navigate to com\android\systemui\recent\RecentAppFxActivityTablet.smali
search for
iput-object v2, p0, Lcom/android/systemui/recent/RecentAppFxActivity;->mContext:Landroid/content/Context;
just below this is
Code:
const/16 v0, 0x8
change to
Code:
const/16 v0, 0x[COLOR="red"]ff[/COLOR]
just below that is
iput v0, p0, Lcom/android/systemui/recent/RecentAppFxActivity;->NUM_PANEL:I
then just below that is
Code:
const/16 v0, 0x10
change to
Code:
const/16 v0, 0x[COLOR="Red"]ff[/COLOR]
then search for
.method private refreshRecentTasksList(Ljava/util/ArrayListV
and the next instance of
Code:
const/16 v5, 0x8
change to
Code:
const/16 v5, 0x[COLOR="red"]ff[/COLOR]
####newly added to fix dissappearing panels####
then search for
invoke-virtual {v3, v4, v5, v7}, Lcom/android/systemui/recent/RecentAppFxActivity$FxListViewAdapter;->bindListView(Lcom/htc/fusion/fx/controls/FxListView;II)V
just above this is
Code:
const/16 v5, 0x8
change to
Code:
const/16 v5, 0x[COLOR="Red"]ff[/COLOR]
navigate to com\android\systemui\recent\RecentTaskLoader.smali
in the .method static constructor section search for
Code:
const/4 v0, 0x6
change to
Code:
const/16 v0, 0xff
then search for
Code:
const/16 v0, 0x14
change to
Code:
const/16 v0, 0xff
And thats it Enjoy!
Fixed >>>>Bugs: scrolling quickly will make panels dissappear, im looking into a fix for this
BOOM!
Swag.
I'm actually gonna use this How-To.
Sent from my EVO using xda app-developers app
Cool... I tried like crazy to find where that bugger was
Good stuff, Steal!
Mike
mikeyxda said:
Good stuff, Steal!
Mike
Click to expand...
Click to collapse
Thanks and thank you for pointing out that a few of the edits werent needed.
the op has been revised minus the unneeded edits.
good stuff....thx!
Nice work
Sent from my EVO using Tapatalk 2
Very cool
Sent via LTE from my Evo LTE s-offed by an overweight panda.
Thanks for this! Actually gonna use this
Sent from my EVO using xda premium
PuRE IVIonztah said:
Thanks for this! Actually gonna use this
Sent from my EVO using xda premium
Click to expand...
Click to collapse
good
I'll see if this can go into SOS
Sent from my EVO using xda premium
Steal you are a super smali ninja! Great work as usual.
Bad Seed Customs
Just Sick!
Awesome bro.. Thanks
Sweet! Thanks bro
Nice! Thanks
Sorry for the noob question.. but what do you mean by "decompile"? I see the systemui.apk in root explorer and have tried to edit it, but can't seem to find those lines..
Sent from my EVO using Tapatalk 2
bpcivicsi said:
Sorry for the noob question.. but what do you mean by "decompile"? I see the systemui.apk in root explorer and have tried to edit it, but can't seem to find those lines..
Sent from my EVO using Tapatalk 2
Click to expand...
Click to collapse
look here
i think i found a bug, if you have 16 apps shown and scroll through them to fast and them back to the front of the list, the first 8 apps wont show a preview. atleast that is how it was shown on my phone lol ( a few times)
bog3nator said:
i think i found a bug, if you have 16 apps shown and scroll through them to fast and them back to the front of the list, the first 8 apps wont show a preview. atleast that is how it was shown on my phone lol ( a few times)
Click to expand...
Click to collapse
yep i see that ill take a look and see what can be done.