I have a Nook Simple Touch, BNRV300, and I have successfully modified uRamdisk to gain root shell access with ADB over USB (Thanks Renate!). I am currently on firmware version 1.2.1.
I know this may seem like heresy to some here, but I really do not want or need to root my NST and add a number of apps I won't use anyway. I have a fully rooted Nexus 7 for that sort of thing.
All I would like to be able to do is turn off the need to swipe to unlock when returning from sleep, and modify the text on the screensaver overlay.
I have discovered, by the way, that sqlite3 does not seem to be available on this NST, as when trying to use it via ADB shell, it says "sqlite3: not found".
SO, there we are... I would greatly appreciate any assistance offered.
MildBill
P.S. I have tried Nook Manager, and while it did what I wanted, there were many things added that I just have no need for. And, battery drain seemed to double.So, it had to go.
Regarding SQLite3.
Since the guts of it (libsqlite.so) is already in the Nook, you only need the command line executable (sqlite3).
It's here: http://forum.xda-developers.com/showthread.php?p=50958855#post50958855
Unzip it, stick it in /system/bin, chmod 755 it.
Renate NST said:
Regarding SQLite3.
Since the guts of it (libsqlite.so) is already in the Nook, you only need the command line executable (sqlite3).
It's here: http://forum.xda-developers.com/showthread.php?p=50958855#post50958855
Unzip it, stick it in /system/bin, chmod 755 it.
Click to expand...
Click to collapse
Ahh, once again, thank you Renate. Now if I can get some idea on my main questions...
There are no simple questions here. Even the answers are complicated.
Many people have created solutions and packed them into these "manager" things.
I finally got around to doing my own minimal one.
It's packaged up in nook121patch.zip (in the signature).
Code:
C:\>adb pull /system/framework/android.policy.jar
C:\>apktool d android.policy.jar \AP
C:\>mergesmali /v C:\AP\smali C:\Nook121Patch\KeyguardViewMediator.smali
C:\>apktool b C:\AP android.policy.jar
C:\>adb shell stop
C:\>adb mount -o rw,remount /dev/block/mmcblk0p5 /system
C:\>adb push android.policy.jar /system/framework/
C:\>adb shell chmod 644 /system/framework/android.policy.jar
C:\>adb shell reboot
Renate NST said:
There are no simple questions here. Even the answers are complicated.
Many people have created solutions and packed them into these "manager" things.
I finally got around to doing my own minimal one.
It's packaged up in nook121patch.zip (in the signature).
Click to expand...
Click to collapse
Well Renate, I hate to complicate your answer any more than necessary, but...
On the Temblast page that clicking on your signature takes me to, I do see mergesmali, one of the two tools I will need based on the instructions you gave. I do not see nook121patch.zip, nor apktool, however. Where can I find these?
Also, can you tell me something about what this will do for me?
I hate to be such a noob, I have just enough knowledge to be dangerous. Thanks again for all your help, sorry I have to keep asking for more.
MildBill
Well, I wasn't that clear.
mergesmali is in the signature, nook121patch.zip is on the mergesmali project page too.
Apktool is detailed and linked here: http://forum.xda-developers.com/wiki/Apktool
There are many patches in the nook121patch.zip
You can apply them selectively.
.jar is easy, they don't need signing.
.apk is trickier they must be signed.
System .apk is even trickier, they must be signed with the system signature.
The KeyguardViewMediator.smali will make that your Nook just opens with a push of the power button and no swipe.
Renate NST said:
Well, I wasn't that clear.
mergesmali is in the signature, nook121patch.zip is on the mergesmali project page too.
Apktool is detailed and linked here: http://forum.xda-developers.com/wiki/Apktool
Click to expand...
Click to collapse
Ahh! Well, my bad, I should have tried harder. And, yet again, thanks. Nook users owe you much, Renate!
MildBill
Renate NST said:
Code:
C:\>adb pull /system/framework/android.policy.jar
Click to expand...
Click to collapse
OK so far, and (I think) I have apktool properly installed, then realized I also needed to install the Java Development Kit as well to use it, which I managed to do. But, when I try to do
Code:
C:\>apktool d android.policy.jar \AP
I get
Code:
Input file (\AP) was not found or was not readable.
as a response.
So, I guess I need to return to the magic well of your knowledge for further assistance and/or instruction.
To which I can only add...
HELP!
EDIT: By the way, I am using an adb.exe implementation from another root kit I have installed, not the standard installation from the SDK. Is this perhaps part of my problem?
Well, something goofy is going on there.
Type just apktool and get the usage and version.
\AP in this case is the destination directory.
It should not already exist or else you get a warning.
Maybe the input file (the jar) can't be found, but the error message is wrong?
Code:
C:\>apktool
Apktool v1.5.2 - a tool for reengineering Android apk files
Copyright 2010 Ryszard Wi?niewski <[email protected]>
with smali v1.4.1, and baksmali v1.4.1
Code:
C:\>apktool d C:\nook121\system\framework\android.policy.jar \AP
I: Baksmaling...
I: Copying assets and libs...
Code:
C:\>apktool d C:\boguspath \BogusDir
Input file (C:\boguspath) was not found or was not readable.
Renate NST said:
Well, something goofy is going on there.
Type just apktool and get the usage and version.
Click to expand...
Click to collapse
Well, there ya go... I got apktool v2.0.0b9.
I can get 1.5.2, but will it work with Java 7? Oh well, live and learn I guess...
MildBill
Oh, well, then the 2.0 probably uses different args.
"apktool" by itself will tell you the order of arguments.
To run anything on the desktop the Java 7 runtime environment is fine.
To compile an Android application you have to use Java 6.0 SDK.
Renate NST said:
Oh, well, then the 2.0 probably uses different args.
"apktool" by itself will tell you the order of arguments.
To run anything on the desktop the Java 7 runtime environment is fine.
To compile an Android application you have to use Java 6.0 SDK.
Click to expand...
Click to collapse
Well then, since it appears from the changes that 2.0 requires the Java 7 SDK, I guess I'll uninstall it all and get 1.5.2 and Java 6.
I'm running desktop applications:
Code:
C:\>java.exe -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)
I'm compiling Android applications with:
Code:
C:\>javac.exe -version
javac 1.6.0_38-ea
apktool runs under the JRE, version 1.7 is fine.
OK, finally got around to completing the instructions as posted, and except for having to add the command 'shell' to the mount statement, everything worked fine. And, it accomplishes exactly what I was after.
Next I may look into trying your library and reader apps.
Thanks again!
MildBill
P.S. You might consider rewriting the readme file included in nook121patch.zip to better describe what each patch does.
The readme is admittedly very old.
That's because I forgot that it's even there!
Each of the individual smali files has comments at the head saying what it does.
I'll make something to compile the individual comments into a single readme.
I can also report, at this point, that unlike an other method I have tried to accomplish this simple task, this one does NOT run thru battery life like it was going out of style.
The next most popular option, NookManager, which uses the NookModManager to do this fix, uses an average of 10% battery life every day, even when in in sleep mode the whole time. Turning the option off (I.E. reinstating the swipe to unlock) again reduces battery drain to a more normal point.
But, the fix by Renate seems to use nomorebattery than the stock reader, whether reading, sleeping, with WiFi on or off. I like it!
Once again, Renate, thank you very much for this, and for all you have done for the Nook community.
MildBill
Related
Debian for Desire.
If you are able to try this on another android device, please do as I will be very interested in the results.
Download
http://www.multiupload.com/79TSI1AAF9
You will need.
-Root access.
-Busybox (included in most custom roms)
-1.4gig free on SDCARD
-VNC Client (ie. AndroidVNC)
-Terminal Emulator (ie. ConnectBot)
-7zip
Instructions
-Extract the file deSIREbian.7z on your PC using 7zip.
-Copy the contents (debian.img and deboot) to root directory of SDCARD.
-On your phone in terminal emulator type
su
sh /sdcard/deboot
Click to expand...
Click to collapse
You should get a blank screen showing "localhost:/#" after a couple of seconds.
-On your phone in your VNC client log in using these details
Password - password
Port - 5901
Click to expand...
Click to collapse
Nickname and Address are not needed, call it what you want though.
Changing the colour to 24bit and enabling local mouse pointer and full screen bit map are not neccesary but reccomended.
-Thats it.
Notes.
-You can log in via ssh, (gives a much better terminal, ie works properly with aptitude). Use [email protected] and password "toor"
-The version of Debian is Armel Lenny, installed using debootstrap.
-It is just the base package with LXDE on top, you only get a desktop, a file browser, an internet browser, and a pic viewer.
-If you want more packages there's tonnes of room on the image. eg apt-get install openoffice.org or apt-get install abiword or apt-get install any flipping thing u want
-You can access the SDCARD from Debian at "root/sdcard" (read-write)
-You can access Debian filesystem from Android (When Debian is running) at "sdcard/debian" (read only)
-debian.img is mounted at "sdcard/debian" using "dev/block/loop5"
-So far the only rom i have come accross that this dont work with is one of the cyanogen nightlies from last week. apart from that, working on opendesire, cyanogen, defrost, leedroid, official 2.2 with busybox...
Issues.
Debian cannot be shut down. You need to reboot the phone to do this. (You can kill the VNC server with "vncserver -kill :1" there is an icon on the festoons to do this.)
Update log.
deSIREbain.
-First release.
deSIREbain2
Fixed
-Loading a second terminal no longer breaks vnc.
-You no longer need to create the folder debian on sdcard.
Added
-ssh server (login with root and toor)
Removed.
-The image has been downsized from 2 gig to 1.4
Hey,
thank you for your work, i will test it so far and will tell you the results
got this error:
Code:
# su
su
# sh /sdcard/deboot
sh /sdcard/deboot
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mount: mounting /sdcard on /sdcard/debian/root/sdcard failed: No such file or di
rectory
net.ipv4.ip_forward = 1
chroot: can't change root directory to /sdcard/debian: No such file or directory
#
If you have the same problems try out
su
mkdir /sdcard/debian
losetup /dev/block/loop3 /sdcard/debian.img
mount -t ext2 /dev/block/loop3 /sdcard/debian
ls /sdcard/debian
thx to mercianary for help
greetings
I found this guide quite helpful at getting a bootstrapped Debian setup running.
http://www.saurik.com/id/10
I didn't need to insert the ext2 module as it's already loaded for me, I guess G1s didn't have that convenience back then.
blackstoneuser5 said:
I found this guide quite helpful at getting a bootstrapped Debian setup running.
www . saurik.com/id/10
I didn't need to insert the ext2 module as it's already loaded for me, I guess G1s didn't have that convenience back then.
Click to expand...
Click to collapse
I used parts of this for reference too. Its a great guide, explains things really well.
i've just updated this. link is in the first post.
Fixed
-Loading a second terminal no longer breaks vnc.
-You no longer need to create the folder debian on sdcard.
Added
-ssh server (login with root and toor)
Removed.
-The image has been downsized from 2 gig to 1.4
debian for desire--help please
hi
I spent much time for searching debian or ubuntu for desire, but nothin worked
know i found this and i have download everything and start to install over the terminal
but the " sh /sdcard/deboot" is not workin to
there's only this answer:
# su
su
# sh /sdcard/deboot
sh /sdcard/deboot
[: not found
losetup: not found
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
busybox: not found
sysctl: not found
chroot: not found
may somebody help me?
i really want to have it on the desire
thanks
It looks like you had not installed busybox
Which ROM do you use ?
oh i'm sorry
i'm a newbie and don't really know what a rom is
but i had problems with busybox and there was a somebody who said i can get the app titanium and let it install the busybox
could you please show me a tut how to install busybox
maybe a german tut
thanks
Getting error at: sh /sdcard/deboot
line 5: syntax error near unexpected token `else'
Rosi1337 said:
Getting error at: sh /sdcard/deboot
line 5: syntax error near unexpected token `else'
Click to expand...
Click to collapse
dont know why that happened.. works on mine. syntax looks ok to me.
try with this one (attatched), it's the same but without the bit that's not working for you.
what rom are you using, i shall try to replicate the error so I can try to fix properly.
thepuechen said:
could you please show me a tut how to install busybox
maybe a german tut
thanks
Click to expand...
Click to collapse
There should be a guide on installing busybox somewhere if you want to search for it, i know i remember seeing one a while ago.
Too be honest, your better off just flashing a rom that includes busybox, it would be MUCH easier.
have a look here and see what takes your fancy, I would recomend defrost, because it is stable and easy to overclock.
Thanks mercianary,
It works fine!,
I use customised DeFroST_0.9b_uvonly with USB-host patch.
By the way I would like to add more options to kernel line.
Where can I find like a menu.lst file ? or How to add it to kernel line.
There is no /dev/graphics/* in running Debian console.
I would like to use FrameBuffer on running Debian.
thanks,
Android VNC won't connect Trying to get a handshake, but then says that VNC connection failed
please paste at that time log
jacobtc said:
Android VNC won't connect Trying to get a handshake, but then says that VNC connection failed
Click to expand...
Click to collapse
Please paste at that time log.
Maybe vnc server does not running.
tknv said:
Thanks mercianary,
It works fine!,
I use customised DeFroST_0.9b_uvonly with USB-host patch.
By the way I would like to add more options to kernel line.
Where can I find like a menu.lst file ? or How to add it to kernel line.
There is no /dev/graphics/* in running Debian console.
I would like to use FrameBuffer on running Debian.
thanks,
Click to expand...
Click to collapse
You should understand that this is not a really booted native linux. Instead you are working in a chroot environment. So there is no kernel running that can get parameters. Only the the stock kernel of your DeFroST. Also there is no FrameBuffer as the graphic hardware ist not accessible. Instead this approach uses a vnc-server to which you can connect via a local viewer.
The advantage of this approach is clear:
- run almost any linux package available in the debian repository
- use your phone as before with the nice android
The disadvantage:
- no graphic output, so no 3D-games (which are rare under linux on the arm platform ;-)
- you can crash your android by eating up to much ram (not such a problem - it restarts on its own and if not you just have to reboot)
Thread is dead?
It seems this thread is dead. The problems many users seem to have come from a dirty setup. The image is broken in many terms:
- wrong file permissions on important binaries, like su
- wrong file permissions on many device files under /dev, so the ttys are only accessible by root
- wrong permissions on other places so there are always errors when installing additonal software (e.g. with the man pages)
- wrong setup that uses the root user for the desktop - instead an unprivileged user should be used
- missing packages for timezones and locales so the time is only right, if you are in a UTC region and console programs having trouble displaying anything else then plain english
I can not recommend using this setup image. It is better to use one of the instructions available online to get a clean setup.
Su doesn't work because your allready root.
Getting anything but root to work would be a real pain.
As you said its a chroot environment, its never going to be perfect.
The image was made using debootstrap just like all the other 'clean' ones.
Yep, it is broken as hell, but it works for what most people would need it for...make,gcc,python,a proper web browser,torrents, and some emergency word processing on the train to work.
The problem most people have is not being able to mount the image, this is due to fro-yo a2sd taking up all the loop devices.
Just thought I'd add my 2 cents.
I tried this on a MIUI rom and the scripy didnt do anything - ie i ran it using:
"# sh /sdcard/deboot"
.....and all it said was:
"#"
I entered all the lines in the shell script but the last one said it failed to launch VLC and no commands registered property (not even ls)
So i tried it on Defrost 5.1, and the script still didn't work.
But when i entered everything manually, it did work. Not too sure about the green theme though.
But thanks alot! Saves me spending a few hours trying to coax a working debootstrap out of my computer.
Thanks!
Josh.
mercianary said:
Su doesn't work because your allready root.
Click to expand...
Click to collapse
Nope. Actually su works only for root. It's missing the setuid root flag like all other binaries that should have it set.
mercianary said:
Getting anything but root to work would be a real pain.
Click to expand...
Click to collapse
Nope. I am always working as a normal, unprivileged user in my chroot. You just have to be in the proper groups. No need to work as root. Android works also with an unprivileged user.
mercianary said:
As you said its a chroot environment, its never going to be perfect.
The image was made using debootstrap just like all the other 'clean' ones.
Yep, it is broken as hell, but it works for what most people would need it for...make,gcc,python,a proper web browser,torrents, and some emergency word processing on the train to work.
Click to expand...
Click to collapse
This is what I do not understand. There is no need that it is broken, as mine works without any errors. So I think something went wrong in creating yours. For sure a chroot is no running OS but you can server almost any service with it and run anything you want (if your ram does not get exhausted ;-).
mercianary said:
The problem most people have is not being able to mount the image, this is due to fro-yo a2sd taking up all the loop devices.
Click to expand...
Click to collapse
Yes. Everyone with a good rom should have a2sd+ (aka the old a2sd) which saves more space than the froyo one and leaves your loop devices for you.
jo
I wonder if other people are having these issues, story follows.
I was trying to install the updated ADW.launcher via the adb install command and was getting errors such as "/sbin/sh pm not found". This led to an investigation and it turns out that all the standard applications used to install stuff under android are in /system/bin BUT... The path in the CM6 rom does not have /system/bin in the PATH variable. The only path element as far as I can tell is /sbin. So the solution I came up with was to copy over all the tools from /system/bin to /sbin and this worked.
So here is the real question. How do I change the path on the android device? I have already tried export PATH=$PATH:/system/bin but this does not stick after I close the adb shell.
Update: oh great when you reboot the phone all the copied tools disappear and you have to do it all over again to install another file. Did not expect that one. This makes my need to change the path even more urgent.
Update2: I found it easier to just push the new file over top of the old one in /system/app. This will work for system apps and if I need to install other apps I can just load them from the sdcard.
Is there a reason you are not installing it from market? ADW is the default launcher in CM6, so the one from market is not the same, but they can coexist.
so the one from market is not the same, but they can coexist.
Click to expand...
Click to collapse
Yea I was not really sure about that so I felt it was safer to download the one for CM6. If that works I will do that in the future. I ended up just doing a push over the older version in /system/app, this worked fine.
Is there a reason this rom does not have /system/bin in its path? Is it to avoid toolbox?
anika200 said:
Yea I was not really sure about that so I felt it was safer to download the one for CM6. If that works I will do that in the future. I ended up just doing a push over the older version in /system/app, this worked fine.
Is there a reason this rom does not have /system/bin in its path? Is it to avoid toolbox?
Click to expand...
Click to collapse
It is in the path.
# echo $PATH
/sbin:/system/sbin:/system/bin:/system/xbin
#
Can you help me to change the path? Mine is only /sbin for some reason.
Normal export command did not work for me. Thanks
Maybe its baked into the boot.img? What about the init scripts? Any clues where to start? Maybe I will just flash on a new nightly, would that over write the existing path info?
Ok, I found some clues. A document on the android init scripts describes the path settings. I will poke around in there and see what I can muck up. http://www.netmite.com/android/mydroid/1.6/system/core/init/readme.txt
Sent from my Liberty using XDA App
Answered my own post.
To change the path you need to edit init.rc and add the correct path.
For some reason the nightly I was using had the wrong path in there and would not let me use adb install correctly. I would get an error back "/sbin pm not found". The adb installer was looking for a tiny program (a shell script really) named "pm" but it could not find it because pm is located in /system/bin which was not in the search path. Probably would have caused other problems too.
On a side note, why could I not get an answer to this simple question on a developement thread. Seems like rom creators/moders would know this second hand. Not complaining just makes me wonder.
Sounds a lot like a complaint to me.
I've been busy working on issues that are not isolated to a bad nightly, such as why we can't read telnos and contacts from the sim card.
/system/bin/sysinit gets pulled in from the cm6 repository, so things on nightlies are very fluid - I never know what to expect. Looking at my build, there is no way I could answer your question in any definitive way that would explain the discrepancy. Since I could not verify the problem, I deemed it a non-issue and moved on.
That did sound like a complaint, sorry. It was not really directed at you as I assume there is more than one developer on this site. I got it solved no problems. Maybe this will help someone else down the road. I have seen a few of these posts around and never saw a concrete answer.
I am surprised the phone ran so well with the path mangled so bad. I am also a little surprised that init.rc gets touched at all on a nightly cycle. One of those things I guess.
anika200 said:
I am also a little surprised that init.rc gets touched at all on a nightly cycle. One of those things I guess.
Click to expand...
Click to collapse
I was a little surprised as well.
[UPDATE]
BusyBox 1.19.2
Bash 4.2
Midnight Commander 4.8
TMUX 1.5 - That's right, full terminal multiplexer..
Vim 7.3
Terminal IDE ASCII Soft keyboard first round bug fixes complete.
It's the addition of TMUX and MC that really excites..
--------------------------
Well,
As the only people I know who might even be interested in this, I would like to announce the release of Terminal IDE v1.0.
A complete Java / Android Development Environment that runs on the device itself, with a nice telnetd / sshd feature.
For Android. Of course... Eat this you IPhone Hounds..
Woo HOO!!
The application is available on Android Market.
https://market.android.com/details?id=com.spartacusrex.spartacuside
As what I can only describe as 'dark days' finally draw to an end, I am very pleased with this first draft.
PLEASE give it a go, log in over telnet for a smoother ride, and let me know how it goes..
DO THE TUTORIAL! Does it work ?!
I have released the whole project GPLv2! Yeah, Who Knew!?
http://code.google.com/p/terminal-ide/
BOOOOOM!
Spartacus
a link to the app in the market would be usefull.
Interesting. Was just wondering about coding on my tablet.
Pretty freakin sweet
Thanks for putting this out!
Awesome
The full keyboard alone makes it worth downloading, but the IDE as well - wow!
this is best bro.
I randomly found this last night while looking for a decent mobile IDE for my tablet. I was looking for a simple text editor with syntax highlighting and you've taken that extra step to include other tools for ssh, telnet and compilers. Much appreciated.
One question, how do you start the ssh server? sshd doesn't seem to do it. I would like to scp files to my device from my desktop in order to work on my commute.
Thanks
The sshd app is actually called Dropbear.
You also have Dropbearkey.
You use Dropbearkey to generate the sshd certificates you need.
I really need to add a tutorial on setting the sshd keys up
For now Google has a couple of articles on it.
For file transfers you also have busybox FTP but I admit not terribley secure..
Allthough SSH is provided, and I wonder whether an SSH pipe can be created..?
And lastly you can just copy the files over to your sdcard via USB..
Will look into it & add tutorials asap.
Ok. So I now have SSHD working..
But there is a slight issue.. basically when you log in you have to start bash manually.. unless you have the file /etc/shell with the correct shell to use.. Which requires a rooted phone.
Since Terminal IDE is for non-ROOT users, I will have to recompile the code to allow a shell to be specified on the command line.. Soon..
FOR NOW - This is how to connect to the phone via SSH (There are other ways using public keys but this is one way)
So - Once in Terminal IDE
2) You need to create a couple of server ssh keys
Start in $HOME
Code:
cd ~
Create folder
Code:
mkdir .ssh
Give it some secure permissions
Code:
chmod 700 .ssh
Get in there
Code:
cd .ssh
Now create the keys
Code:
dropbearkey -t dss -f dropbear_dss_host_key
dropbearkey -t rsa -f dropbear_rsa_host_key
ok - That's almost it. Just need to start dropbear with the correct parameters now. [Probably want to keep this in a script]
Back HOME
Code:
cd ~
You need to know the UID of your app, which is different per phone - use 'id'
Code:
id
That will tell you your user ID / Group ID. Let's say its 10058.
Now to start DropBear
Code:
dropbear -A -N username -U 10058 -G 10058 -C password -d ~/.ssh/dropbear_dss_host_key -r ~/.ssh/dropbear_rsa_host_key -F -E -p 8090 -P PidFile
This will start it running in the foreground with password set to 'password' on port 8090.
Then you can connect, like telnet, and simply use 'password' for the password.
Now for the issue. It will start a simple shell session in / with no ENVIRONMENT variables or anything..
I'll fix it permanently in a future release, but for now it can be fixed with these 2 commands.
cd into your home dir - Check this is correct on your device
Code:
cd /data/data/com.spartacusrex.spartacuside/files
And start bash with an init file Terminal IDE auto-magically creates..
Code:
./system/bin/bash --init-file ./.init
Everything should now be setup as usual.
Good luck..
Very awesome and thank you sir. Works like a charm.
One thing to clarify for those "braving" this (not that it's all that insane to try)... the '-N' is setting the username (in the case of the example, setting it to 'username').
Also, it gives a permission denied for scp, I'm assuming since it doesn't init/run the shell. Should be fine since FTP is included. Haven't tried this option yet. Not too worried about security at the moment, since I'll only run it on a private network.
May I make a (maybe) small feature request? Is it possible to include a "keep screen awake" option in the options menu? I have my Xoom config'd to turn off the wifi when the screen is off for power saving (can go ~4 days on 1 charge), so it will kill my connections if I let this happen. I know not everyone has this config set, but it'd be a nice option.
NOW, if I wasn't lazy, I could probably add this myself and build since I've dl'd the source. But, lazy and working on a few projects already.
Again, much thanks.
And as if by magic..
Funnily enough I was having the exact same issue last night while using wget to transfer a big file to my device..
NEW VERSION UPLOADED v1.13
Now has 3 non-exclusive lock types available in the options :
- CPU Lock
- SCREEN Lock
- WIFI Lock
Set them as you wish...
Saw that this morning when I was on the bus (Thursday morning here in Hong Kong). Very awesome and much appreciated.
As well, thanks for open-sourcing it. +1 for you sir!
Very cool stuff
Thanks for creating this.
Great app! However I can't compile .java files. I always get an error that it can't unzip a file in /android.policy.jar. Any idea?
Sent from my GT-I9100 using XDA App
Do you think its possible to also support compiling C sources directly in your phone
I've been searching for this ever since I got an android.
THANK YOU.
Says that it's incompatible with my OG Droid. Any idea why?
shpen said:
Says that it's incompatible with my OG Droid. Any idea why?
Click to expand...
Click to collapse
Most likely seems to be due to the ROM you are using and/or the market version
can u post the build.prop here?
/system/build.prop
also, try going back to market 2.x, 3.x market(s) do loads of checks
Does anybody know why I can't compile java files? I always get the following error:
Error reading /system/framework/android_policy.jar cannot read zip file.
Any ideas? Could anyone upload there android_policy.jar because that might cause the error.
Sent from my GT-I9100 using XDA App
Hi Schindler33.
Can I ask, have you followed the tutorials, say the first helloworld example TO THE LETTER?
Does the helloworld example work?
The parameters have to be correct, and as always exact, and the BOOTCLASSPATH variable must be set.
If so, is it a custom ROM?
Does that policy jar file exist and is it readable by non root users?
As much info as possible good..
Hello all. I have written a guide to setting up & using Android ADB, & building Android, with Fedora KDE. Almost every guide that I've ever seen for setting up ADB, & a build environment for building Android, is always written for Ubuntu, & ONLY Ubuntu. But I choose to work with Fedora KDE. Why Fedora with KDE??? Because I hate Ubuntu. !!!HATE!!! I also can't stand gnome 3.X. I'm sure I'm not the only one who feels this way, so that's why I'm writing this guide. I've tried different linux distros, & I've found Fedora to be the best of all. It is my favorite now. They also seem to be one of the few distros that stays on top of the linux kernel updates. As of 03/20/13, they're already on kernel 3.8.3!!! Other distros stay way behind. Also, with KDE, you can keep the "windoze" traditional desktop look & feel, especially when you use the "folder view" activity. It's great!!! Well, let's get started.
!!!WARNING!!! Before anything else, I will mention this right now. The Dolphin file manager can destroy your Android build with hidden ".directory" files. Please keep this in mind. I will explain this at the end of the guide.
INSTALL JDK6
-I guess I'll mention this 1st, since this can actually be one of the most painful & confusing parts of all. You'll need to install the java jdk6. As far as I know, Android stuff won't work with the newer jdk7. You can find it on oracle's page here:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
-Scroll down & you'll see it. Get the "rpm.bin" version. If your working with 64bit, it should look like this:
jdk-6u43-linux-x64-rpm.bin
-Someone by the name of JR already made a very good guide on how to do this. It is what I followed, & you should too. You can find it here:
http://www.if-not-true-then-false.c...java-jdk-jre-6-on-fedora-centos-red-hat-rhel/
NOTE: When following this guide, be sure to go through only steps 3a & 4a when you reach them. Steps 3b & 4b are for the "non-jdk" jre.
NOTE: The "alternatives" listed in step 4 seems to be some kind of program that creates symlinks for whatever you want, & labels them. When you install, or create the symlinks, you can then use "alternatives" to switch back & forth between the different programs that you make the symlinks for. For example, you can make links for java in jdk6 & jdk7, & then switch to either one or the other, as you please. That way, you can have them both installed, while using only one at a time. You can type "alternatives --config java" to switch, or whatever name you used for the link. For help, type "alternatives --help".
INSTALL SDK
-You can follow these:
http://developer.android.com/sdk/index.html
http://fedoraproject.org/wiki/HOWTO_Setup_Android_Development
SETTING UP ADB
-Download the sdk & unpack it somewhere in your home directory. For example, I like to put mine in "~/Android-Development/sdk" (the ~ symbol is short for your Home folder).
-cd to your sdk tools location. For example, from my Home folder, I would type this:
Code:
$ cd Android-Development/sdk/tools
-NOTE: DON'T TYPE THE DOLLAR SIGN!!! I put it there because that's what you see in the terminal. It's only there for reference.
-NOTE: At any time, you can type "ls", or "ls -l" to see everything in the folder you're currently in.
-Now, execute the android program.
Code:
$ ./android
-Install Android SDK Tools & Platform-tools.
-Install 32bit packages. Since Android is a 32bit OS, you must install the 32bit packages regardless if whether your computer is 64bit or not.
Code:
$ sudo yum install glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686
NOTE: In order to install packages with yum, you must do it as su. You can either type sudo before the command, or you can just type "su" & enter your password to become superuser. If you're new to the command line, it's probably better to use "sudo" instead, that way you won't stay logged in as superuser & potentially mess things up.
-Now, it's time to install the udev rules. Basically, they are the rules that govern whatever device you plug in with USB. You can find all the info on this page:
http://developer.android.com/tools/device.html
-Create an empty file named 51-android.rules to write in. We will create it in /etc/udev/rules.d/
Code:
$ sudo touch /etc/udev/rules.d/51-android.rules
NOTE: "Touch" is a linux command that you can use to create a new, empty file. To see more info on it, type "touch --help", or "man touch" to see the manual page for it. Of course, you can always google it, & anything else as well. Google "linux commands touch".
NOTE: Since this file is in the root user's directories, you will need to enter commands as superuser, or else it won't save. Either type "sudo" before the command, or, if you're comfortable with the command line, log in as superuser by typing "su" & entering your password.
-Now, you can use any text editor to write inside that file you just created. I like to use nano from the command line, so let's use that. ("nano --help", "man nano", google "linux commands nano")
Code:
$ sudo nano /etc/udev/rules.d/51-android.rules
NOTE: In linux, you can copy & paste without even "right-clicking" & selecting copy or paste from the menu. Instead, you can just highlight some text, & go somewhere else & press the mouse middle button to paste it. Highlighting text will automatically copy it, & pressing the mouse middle button will automatically paste whatever you highlighted. No need for "right-clicking" anything. You can do this for the next step.
-Now, from the webpage listed above, just copy & paste the lines with the USB Vendor IDs that you want to use. For example, for Asus, HTC, & Samsung, write these:
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
-Save & exit the file.
NOTE: In nano, you can always see important commands at the bottom of the screen. For example, to exit, you hold in the "control" button & press "x".
-Now, check the permissions of the file & make sure everyone can read it.
Code:
$ ls -l /etc/udev/rules.d/
-You should see something like this:
Code:
$ -rw-r--r--. 1 root root 639 Feb 5 14:08 51-android.rules
NOTE: The 1st line indicates whether it's a directory or not. The next 3 lines indicate Read, Write, & eXecute permissions for the user. The next 3 lines indicate Read, Write, & eXecute permissions for the group. The last 3 lines indicate Read, Write, & eXecute permissions for others. The 1st "root" means that root is the user. Root owns that file. The 2nd "root" means that the file belongs to the group root.
-If for some reason you don't see the "r" letters (meaning that it's readable) to the left of the file name, then just change the permissions. Add "read" permissions for all.
Code:
$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
-Finally, if you didn't do it earlier, now's a good time to do this. Make sure the ADB folders are in your global PATH. This is so that you can use the ADB commands anywhere in the system, no matter what folder you're currently in.
-Return to your home folder.
Code:
$ cd
NOTE: In the linux command line, simply typing "cd" & pressing enter will bring you right back to your Home folder.
-There's a hidden file called ".bash_profile" in your home folder. You can see it if you LIST ALL:
Code:
$ ls -a
-Your global PATH is defined in there. Let's edit it to add the ADB folders.
Code:
$ nano .bash_profile
-You'll see that there's already one line in there with 2 entries that look like this:
Code:
PATH=$PATH:$HOME/.local/bin:$HOME/bin
You can use that as your example as to what the format should look like. The line begins with
Code:
PATH=$PATH:
Then there are 2 entries, with each entry separated by a colon. Each entry must be separated by a colon and NO space.
Code:
$HOME/.local/bin
is one entry, &
Code:
$HOME/bin
is the other entry. Now, we want to add our 2 ADB folders to the list. You can either add each path to your folder separated by a colon & no space, like the example, or you can start your own line. I always like to start my own line underneath that one. So, for example, here's what my new line looks like:
Code:
PATH=$PATH:$HOME/Android-Development/sdk/platform-tools:$HOME/Android-Development/sdk/tools
-Everyone likes to use different folder names. Remember to use the proper path of where you put your folders in.
-Save & exit the file. That's it. Now, reboot your computer, plug in your android device, & test it out. You should be able to type "adb devices" from any folder, & the computer should be able to see it now.
INITIALIZING YOUR BUILD ENVIRONMENT
-For me, this was the hardest part of the whole process, as there wasn't a lot of help on how to do this for Fedora with KDE. Whatever few guides for Fedora I found out there were usually missing something here & there. My goal is to change that & help everyone. I've gone through this multiple times now, including multiple reinstalls of Fedora 18 from scratch.
-You'll need to install lots of drivers & libraries.
NOTE: Use Apper, the software management program, to look up drivers & libs. Apper will show you many different files that have the name that you typed in, whereas yum won't. Personally, I like to look things up with Apper so I can get lots of hits, & then actually download them by typing them in manually with yum. Yum shows you what it's actually doing behind the scenes while it's downloading things, whereas Apper doesn't. If yum gets stuck & hangs, you can actually see what's going on, whereas Apper won't show you anything & will just leave you wondering what's going on.
NOTE: I have found it to be a good idea to always look for the development (-devel) version of anything that you have to install. Not everything has a development version, but some do. For example, if you look up "flex" in Apper, you'll see that there's also a "flex-devel". Be sure to download them both.
-Here is what I went by:
http://fedoraproject.org/wiki/HOWTO_Setup_Android_Development
http://source.android.com/source/initializing.html
http://wiki.cyanogenmod.org/w/Main_Page
http://wiki.cyanogenmod.org/w/Build_for_maguro
-I used the lists on the fedora page, & I also used the lists of required packages for Ubuntu 10.04 & 12.04. I chose to try a build for Samsung Galaxy Nexus, since that's what I have. While going through the Ubuntu lists, you must keep in mind that some of these packages don't exist for Fedora, & many others do exist with slightly different names. It is best to spend some time & look them up 1 at a time using Apper. For example, typing "libxml2-utils" into Apper shows nothing, but typing in "libxml2" shows results. Finally, whatever you still can't find, you must google search it. For example, google search = "fedora libxml2-utils" You'll get clues & answers from what other people have already found about them. I mainly used the Ubuntu lists of necessary libs to download. So, without further ado, here's everything that I did that works for me...
Code:
$ sudo yum install git gnupg gnupg2 flex flex-devel bison bison-devel gperf gcc gcc-c++ make automake kernel-devel zip curl zlib zlib-devel glibc glibc-devel ncurses ncurses-devel xulrunner xulrunner-devel libX11 libX11-common libX11-devel xorg-x11-proto-devel readline readline-devel mesa-libGL mesa-libGL-devel mesa-libGLU
NOTE: You won't need mingw32 & tofrodos.
Code:
$ sudo yum install python-markdown libxml2 libxml2-devel libxslt libxslt-devel perl perl-devel perl-Switch SDL SDL-devel wxGTK wxGTK-devel squashfs-tools pngcrush schedtool
NOTE: If you installed Fedora with the options for development programs, than some of these will be installed already. This list may be a slight bit of overkill, but I purposely wrote down everything anyway, so that way nobody misses anything. I went through hell when figuring this out, so it's better to be safe than sorry.
NOTE: If you've been doing everything logged in as superuser, be sure to exit su when you're not installing things anymore. If you create directories as root user, you won't have permissions to access them under your own name, unless you manually change the permissions. Other permissions issues can arise too.
-After all this, it's just a matter of installing the directories & repo, & following the remaining directions on the CyanogenMod Wiki build guide page. I wanted to sync up with the Jellybean branch, so as an example, I set my directories up like this:
Code:
mkdir Android-Development/Builds/bin
mkdir Android-Development/Builds/CM10.1_Jellybean
-Whenever I download the repo command, I do it like this:
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/Android-Development/Builds/bin/repo
-You'll need to add this to your global PATH as well, so be sure to do that, then log out & back in again, or reboot to make it active. Do that, & then continue.
-Then, I go inside the CM10.1_Jellybean folder to do the repo init. (Get ready for repo sync. That takes hours!!!)
-That's pretty much it. : ) Be sure to read through the sites & all their instructions & guides to help you understand everything.
!!!WARNING!!! Here is what I mentioned all the way at the beginning. Please don't forget the most important thing of all: those damn hidden ".directory" files. Any time you change the folder views in Dolphin File Manager, it places a hidden ".directory" file in that folder. THESE HIDDEN FILES WILL DESTROY YOUR BUILD!!! I went through hell with this, trying to figure out what was going on. I always set up the Android folders to show in "details" view mode, so that they're easier to see. Every time I tried to build, it would build for 5 or 10 minutes, & then fail, citing errors in java. I eventually realized that the ".directory" files were the cause of all the problems.
If you change the folder views, you need to get rid of those hidden ".directory" files. You'll have to do it in terminal. A good way to do it is by using the "find" command to find them all, & then pipe the output of that into the "rm" command to remove (delete) them all. ("find --help", "man find", google "linux commands find")
The "find" command can find whatever you're looking for in the current directory, & in all of its sub-directories as well. With the "rm" command, you can also use the "v" option. "V" stands for "verbose". It will show you everything that is being done, as it's being done. As an example, here's how I do it on my computer:
Code:
$ cd ~/Android-Development/Builds/CM10.1_Jellybean
$ find -name .directory -exec rm -v '{}' \;
That will find all of the ".directory" files & delete them all. It works pretty fast too. With the "v" option, it will show you what's going, while it's happening, as well. So, if you're like me & think that it's much easier to see huge lists of folders in "details" view mode, feel free to set it for the current directory & all sub-directories as well. However, DON'T FORGET TO DELETE all of the ".directory" files before you start building, or your build WILL FAIL!!!
Well, as you can see, you can customize some things to your liking. There's plenty of learning involved, so be ready to spend lots of time with everything. Good luck, & have fun!!!
Now, I'd like to add a personal note. After all this, I'm able to build Android from source with no problem now. However, I tried porting CyanogenMod & building ClockworkMod recovery for some Ainol Tab that I have. Long story short, in the end, it didn't work. I learned about having to build your own device tree, & I found myself completely lost in a sea of xml & java that I didn't understand at all. That's when I realized how much I don't know. It's also when I quickly realized the good advice of cyanogen himself...
http://forum.xda-developers.com/showthread.php?t=667298
"... Here's my advice for those looking to make their own Android ROMs.. Stop. Write an app or two first, learn how the system works from a developer standpoint. Learn some Java. ..."
His advice is dead on accurate. Now I know why he says the things he said. I have no previous experience with java, or any other programming language. In trying to do these things, I found myself completely lost in code that I didn't understand at all. How can I possibly mess around with entire ROMs when I don't even know what's going on under the hood???
Since then, I've been concentrating most of my spare time learning java. It's a bit overwhelming to say the least, but I am getting it now. Recently, I took a peek back at all the code that confused me before, & I'm actually starting to understand it all now. I'm no longer lost. Studying java (& xml) is actually working, & quite well too. I can personally confirm cyanogen's advice to be spot on, & well worth listening to.
So, in conclusion, if you're wanting to get into messing around with ROMs & stuff, but you have no programming experience, I think it would be best to take cyanogen's advice & start at the higher levels first. Learn some java (& xml), & learn to build a simple app or two for Android. You'll better learn how the system works that way. That's what I'm doing now, & it's really working for me. Doing this should help you out with ROMs, & app development too. Well, I hope this is helpful to everybody looking to get into all this stuff. Good luck, & have fun!!!
Glad I'm not the only Fedora user building android around here. I admit, I'm no good at java, but I have really only been focusing on kernel stuff for my device. Good luck to anyone using this.
XirXes said:
Glad I'm not the only Fedora user building android around here. I admit, I'm no good at java, but I have really only been focusing on kernel stuff for my device. Good luck to anyone using this.
Click to expand...
Click to collapse
I guess different people will have different experiences depending on what kind of knowledge they have. For me, I ran into trouble when I tried to port CyanogenMod to a different device on my own. I found that my knowledge was not quite up to par. Studying java is helping me in regards to both ROM development, & app development as well. It's just what I need because I also want to make games.
Very nice guide. I can tell you spent a lot of time putting this together. thank you!
I already had a mostly working Android SDK, and was successfully building kernels for my Ainol Elf2. However, I was never able to build the Elf2 ported version (by Christian Troy) of Cyanogen 10. Perhaps after starting over with my Java installs, this will work now. I have had the Android SDK installed for quite some time, but after v4.2, it would no longer update itself. Now it does.
Not that I want to use 4.2 on my Elf2. I hate they dropped Bluez and now USB Bluetooth dongles no longer work. That is a show stopper for my Elf2. However, my newly purchased Samsung GS3 might benefit nicely. I plan on starting to build a new kernel for this tonight.
BTW, I am still on Fedora 14 32bit, because I also hate Gnome 3 and the latest KDE's as well. My F14 is still kicking along just fine, with updates manually compiled by me.
Nice Job!
Thanks for sharing!! Good job!!
lexridge said:
Very nice guide. I can tell you spent a lot of time putting this together. thank you!
I already had a mostly working Android SDK, and was successfully building kernels for my Ainol Elf2. However, I was never able to build the Elf2 ported version (by Christian Troy) of Cyanogen 10. Perhaps after starting over with my Java installs, this will work now. I have had the Android SDK installed for quite some time, but after v4.2, it would no longer update itself. Now it does.
Not that I want to use 4.2 on my Elf2. I hate they dropped Bluez and now USB Bluetooth dongles no longer work. That is a show stopper for my Elf2. However, my newly purchased Samsung GS3 might benefit nicely. I plan on starting to build a new kernel for this tonight.
BTW, I am still on Fedora 14 32bit, because I also hate Gnome 3 and the latest KDE's as well. My F14 is still kicking along just fine, with updates manually compiled by me.
Nice Job!
Click to expand...
Click to collapse
Thanks!!! Yes, I did spend quite a bit of time on it. I always try to do everything as perfect as I can.
What a coincidence... It was messing around with my Ainol Novo7 Crystal tab that really pushed me into this journey of learning. I think that one & the Elfii are almost the same. That Christian Troy guy seems to be an absolute Linux master. I hope I can be as good as him someday.
I think many people should use Fedora. It may not be so easy for beginners, but the more people that help by writing helpful guides for different things, the easier it will be to transition to. It's really great. I even run it on my little Acer Aspire One A522 netbook with no problems.
Sent from my Galaxy Nexus using xda premium
PotatotreeSoft said:
Thanks for sharing!! Good job!!
Click to expand...
Click to collapse
Thank you!!! I hope it helps many people.
Sent from my Galaxy Nexus using xda premium
Thanks for "going the extra mile" (x10!) and taking the time to lay out such a well-organized procedure. Describing potential pitfalls is quite valuable as well. Sharing learning experiences helps everyone. And good luck with Java.
!!!WARNING!!! Here is what I mentioned all the way at the beginning. Please don't forget the most important thing of all: those damn hidden ".directory" files. Any time you change the folder views in Dolphin File Manager, it places a hidden ".directory" file in that folder. THESE HIDDEN FILES WILL DESTROY YOUR BUILD!!! I went through hell with this, trying to figure out what was going on. I always set up the Android folders to show in "details" view mode, so that they're easier to see. Every time I tried to build, it would build for 5 or 10 minutes, & then fail, citing errors in java. I eventually realized that the ".directory" files were the cause of all the problems.
Click to expand...
Click to collapse
You can disable this via:
Menu: Settings > Configure Dolphin > General > Behaviour and set it to common view for all folders. Found here
hi, im stuck ins this step
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/Android-Development/Builds/bin/repo
how can i make this work??
what im missing??
sorry and thanks
plmosqueda said:
hi, im stuck ins this step
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/Android-Development/Builds/bin/repo
how can i make this work??
what im missing??
sorry and thanks
Click to expand...
Click to collapse
Oh, hello. Sorry, I've been away for a very long time. It's cause I'm so busy trying to fix my screwed up life.
Were you still having trouble with this??? Does anything happen at all when you type the command??? I haven't done this in quite a long time now, but if I remember right, I think that this command looks like it doesn't do anything, but it really does. Be sure to check your folders for the repo command afterwards. Curl is a program you can use for downloading things. As long as you have it installed, it should at least tell you something when you type it in. By the way, nice Gameboy.
3ndymion218 said:
Oh, hello. Sorry, I've been away for a very long time. It's cause I'm so busy trying to fix my screwed up life.
Were you still having trouble with this??? Does anything happen at all when you type the command??? I haven't done this in quite a long time now, but if I remember right, I think that this command looks like it doesn't do anything, but it really does. Be sure to check your folders for the repo command afterwards. Curl is a program you can use for downloading things. As long as you have it installed, it should at least tell you something when you type it in. By the way, nice Gameboy.
Click to expand...
Click to collapse
Done XD, i was having ṕroblems with the global path. Well in now in Arch. All works fine, im trying to make a custon recovery for alcatel Ot 983
A bit late to the party but just found this great guide , too bad I didnt find it one year ago It took me almost a full day to figure all this out using Eclipse Kepler to dl the sdk and Nano to write new rules (had to find the rules...) ...
But all in all once you have done it one time seems to me the process is more straitfoward than with a comparable ubuntu system
this well written guide deserves more publicity!
Thanks!
Forgive me if I have a gross misunderstanding about the hardware in the NST, but in my eyes it should be possible for the Nook to sleep but retain the screen, perhaps with a small banner indicating it's in sleep state and you need to press the 'n' to wake. It just seems silly having the benefit of an e-ink display only for the screensaver to kick it when it sleeps. If it didn't do this, I could (for example) leave a map open in OsmAnd and refer to it still while the Nook is sleeping. The only 'solutions' to this I've found involved plain and simply keeping the Nook awake! A hack I can think of would be to somehow bodge something together to take a screenshot just before the nook sleeps and set it as the screensaver image. Seems silly though... I've had a search around and can't find anything related to this specifically, more either people wanting to keep the nook awake or disable the slide to unlock.
Any thoughts welcome!
I had the exact same thought,
so I'm making an app that takes a screenshot every 1:50 minutes and saves it at a screensaver,
to be displayed when the nook goes to sleep.
hopefully it will be ready this weekend so stay tuned
It should be be simple enough.
Modify /system/framework/android.policy.jar
The class is com.android.internal.policy.impl.LockScreen
What puts up the "screensaver" is updateBackgroundImage()
The layout is in /system/framework/framework-res.apk,
res/layout/keyguard_screen_gossamer_unlock.xml
I'm not sure if changing the layout to transparent and not updating the image should be enough.
Renate NST said:
It should be be simple enough.
Modify /system/framework/android.policy.jar
The class is com.android.internal.policy.impl.LockScreen
What puts up the "screensaver" is updateBackgroundImage()
The layout is in /system/framework/framework-res.apk,
res/layout/keyguard_screen_gossamer_unlock.xml
I'm not sure if changing the layout to transparent and not updating the image should be enough.
Click to expand...
Click to collapse
Oh I wish you would have said that two days ago...
It seems a far better solution than my app, maybe I'll try playing with that later.
I tried replacing updateBackgroundImage()
with a stub, but the screensaver still comes up as usual,
Only difference is the "slide to unlock" screen now has black background, so that's what this function is doing.
Time for plan B (or C, really):
If I were to modify framework-res.apk as you suggest, Will I need to resign the whole system, as here?
Update -
The function that sets the screensaver is createScreensaver(), in class com.android.server.PowerManagerService, found in /system/framework/services.jar
I modified it to make the screensaver invisible, but unfortunately it also means there's no indication that the nook sleeps.
Anyway, it's better than constantly taking screenshots, so I'll stick with that.
nivieru said:
Update -
The function that sets the screensaver is createScreensaver(), in class com.android.server.PowerManagerService, found in /system/framework/services.jar
I modified it to make the screensaver invisible, but unfortunately it also means there's no indication that the nook sleeps.
Anyway, it's better than constantly taking screenshots, so I'll stick with that.
Click to expand...
Click to collapse
How did you do that? I'm using the screenshot sreensaver app for that and I find it very useful. But the above mentioned way seems to be less power consuming. Could you explain it for somebody with very little knowledge about manipulating apk, though I know how to manipulate apk with xdaAutotool.
I don't know xdaAutotool, I use apktool but you can probably use whatever tool you like.
First you need a patched /system/framework/services.jar
the one I attached here is for firmware 1.2.1 rooted with NookManager, so it also includes the NookManager patches.
if this is your setup as well, skip to 4
if you run a different firmware or don't want the NookManager patches you will need to patch it yourself
patching /system/framework/services.jar - some vauge instructions:
you will need apktool (or XdaAutotool or whatever) and the android-sdk.
1) use apktool to decompile services.jar
2) modify createScreensaver() in file smali/com/android/server/PowerManagerService.smali according to the attached patch-services.txt
notice - this patch is for firmware 1.2.1 with NookManager patches, it might not be ready for use with other versions - not only the line numbers, also the register v6 might not be a good choice if it is used later in the code without being assigned a new value first.
3) recompile with apktool.
replacing services.jar with patched version - complete instructions:
4) making a full backup before messing with the system is good practice, although the nook is notoriously hard to brick.
you could use NookManager to do the backup.
5) connect to your device with adb
6) apply these commands:
Code:
adb push pathced-services.jar /media
adb shell stop
adb shell mount -o remount,rw /dev/block/mmcblk0p5 /system
adb shell cp /system/framework/services.jar /system/framework/services.jar.backup
adb shell cp /media/pathced-services.jar /system/framework/services.jar
adb shell chmod 644 /system/framework/services.jar
adb shell reboot
7) relax, first boot takes a few minutes, this is normal.
with this patch the screensaver is invisible, so there is no indication at all that the device is asleep.
also, there's no magic button to change behavior - if you want to the screensaver back you need to replace services.jar with original version
Thanks for that extensive description. I'll try the next days to implement it in my system which differs from yours, since I'm using the custom rom from pinguy1982.
Got it.
I compared your PowerManagerService.smali with the one in my services.jar and made the changes.
Recompiled the services.jar.
Exchanged the original classes.dex with the new compiled classes.dex in 7zip.
Signed the jar file.
Had a lot of problems with adb, which didn't recognize my device.
Lost my temper, packed it into a ZIP-file and replaced it via CWM.
Everything is working now. Thanks!
nhedgehog said:
Got it.
I compared your PowerManagerService.smali with the one in my services.jar and made the changes.
Recompiled the services.jar.
Exchanged the original classes.dex with the new compiled classes.dex in 7zip.
Signed the jar file.
Had a lot of problems with adb, which didn't recognize my device.
Lost my temper, packed it into a ZIP-file and replaced it via CWM.
Everything is working now. Thanks!
Click to expand...
Click to collapse
Hi @nhedgehog
I also use the custom rom from pinguy1982.
Can you share your zip file to flash with CWM
Thanks
tebra said:
Hi @nhedgehog
I also use the custom rom from pinguy1982.
Can you share your zip file to flash with CWM
Click to expand...
Click to collapse
Here you are:
Patch (nivieru's method) via ZIP, tested only with modded ROM from pinguy1982 and installed Nooter-Part1.zip. Install via CWM, to be safe make a backup before you do the patch.
Services-org.zip=original services.jar
Services-patch.zip=patched services.jar
Hi everyone!
I've patched the jar and now enjoy the last image in sleep mode. But, I'd like to wake app the Nook every few hours, update the page in dolphin and go back sleep. Page in dolphin has a meta refresh. But I can't wake up the Nook on interval. Is it impossible or I missing smth very important on this topic?
If anybody has some experience on topic, please comment.
Update, my solution:
Re-signed the system with personal cert and implemented an app instead of dolphin+web page.
App wakes up every few hours, updates view and throws device to deep sleep. Hope to get an uptime up to 10-15 days.
nivieru said:
I
replacing services.jar with patched version - complete instructions:
4) making a full backup before messing with the system is good practice, although the nook is notoriously hard to brick.
you could use NookManager to do the backup.
5) connect to your device with adb
6) apply these commands:
Code:
adb push pathced-services.jar /media
adb shell stop
adb shell mount -o remount,rw /dev/block/mmcblk0p5 /system
adb shell cp /system/framework/services.jar /system/framework/services.jar.backup
adb shell cp /media/pathced-services.jar /system/framework/services.jar
adb shell chmod 644 /system/framework/services.jar
adb shell reboot
7) relax, first boot takes a few minutes, this is normal.
with this patch the screensaver is invisible, so there is no indication at all that the device is asleep.
also, there's no magic button to change behavior - if you want to the screensaver back you need to replace services.jar with original version
Click to expand...
Click to collapse
I've done exactly as described in points 4-7 on NST firmware 1.2.1 , rooted with Nook Manager.
I used Root explorer for replacement and rename of patched-services.jar.
After rebooting of NST, it works as intended - the screensaver is unseen, but it appears other problem.
When i click at random .apk, nothing happens, only the screen is flickering once and that's all.
I cannot install apk-s, nor uninstall them....? WTF ?
Someone with explanation...?
gsms said:
I've done exactly as described in points 4-7 on NST firmware 1.2.1 , rooted with Nook Manager.
I used Root explorer for replacement and rename of patched-services.jar.
After rebooting of NST, it works as intended - the screensaver is unseen, but it appears other problem.
When i click at random .apk, nothing happens, only the screen is flickering once and that's all.
I cannot install apk-s, nor uninstall them....? WTF ?
Someone with explanation...?
Click to expand...
Click to collapse
Replacing services.jar while the android system is running can cause problems, that's why I suggest doing it through adb after issuing the "stop" command, which stops android while leaving the underlying linux (with adb) running.
You should try that and see if it helps.
I will try, but before that another question from me.
Is there a chance the file "patched-services.jar" to be remade as .zip file and installed thru CWM.
If this can be done, i will be glad somebody to share the .zip file, because i think it is more comfortable for installation than using adb shell....
thanks
P.S. Adb don't work correctly for me, so the only available option is obviously flashable .zip file...
...
Has anyone tried this with FW 1.2.2 yet?
jptiger said:
Has anyone tried this with FW 1.2.2 yet?
Click to expand...
Click to collapse
If the original services.jar was patched, it will break NTMM since that relies on patches. But if you can discern what the additional patches are you could patch the 1.2.2 file used in NookManager.
Edit: but if you just want to see how it might work, you can probably use the 1.2.1 jar without any problems. When I first started working on the update to NookManager I used the original 1.2.0 jars that were provided with FW 1.2.2 and saw no evidence of problems. A diff showed very minor changes. Depending on how extensive the patching is for this mod, it might be easier--if you still want the use of NTMM--to patch the file in post #8 for NTMM since the patches are well documented on github. Otherwise you have a lot of diffs to look at and sort out.