Tried to modify .jar files to fix the NST screensaver rotation. Need help. - Nook Touch General

Hey all,
I tried to use mergesmali to modify my own android.policy.jar and services.jar using mergesmali and apktool to apply the patches that @Renate NST so gracefully provided to fix this minor issue.
In short, it was way too techie of an endeavor for me. I tried for about 5 hours, but the instructions were too tech savvy for me to understand. I was wondering if someone could patch my files for me and upload them so I can download them?
I'm running 1.2.1 rooted with NookManager.
Please forgive me Renate if I have done something by inappropriate uploading your files. Thank you to anyone willing to help.
I have attached my own android.policy.jar and services.jar to be patched. I have also provided (hopefully) all of the necessary files to patch the two .jar files.

You should be able to do this all yourself.
Did you read "readme.txt" that is packed inside nook121patch.zip?
Could you "apktool d" correctly?
apktool has changed over time, you need to:
Code:
apktool d foo.jar -o whatever
This will create the directory "whatever" and put everything in there.
Without this option, it will generate its own subdirectory named "foo".
Could you apply the patches correctly?
You can apply either a single patch or multiple patches with one line.
The "readme.txt" may have confused you because it was trying to make clear that you get to decide on each patch.
Make sure that everything went through correctly before swapping the new services.jar on your Nook!
Unzip nook121patch.zip into a directory called Nook121Patch.
Code:
apktool d services.jar -o Services
mergesmali \Services\smali Nook121Patch\LockScreen.smali
apktool b services.jar -o Services

Renate NST said:
You should be able to do this all yourself.
Did you read "readme.txt" that is packed inside nook121patch.zip?
Could you "apktool d" correctly?
apktool has changed over time, you need to:
Code:
apktool d foo.jar -o whatever
This will create the directory "whatever" and put everything in there.
Without this option, it will generate its own subdirectory named "foo".
Could you apply the patches correctly?
You can apply either a single patch or multiple patches with one line.
The "readme.txt" may have confused you because it was trying to make clear that you get to decide on each patch.
Make sure that everything went through correctly before swapping the new services.jar on your Nook!
Unzip nook121patch.zip into a directory called Nook121Patch.
Code:
apktool d services.jar -o Services
mergesmali \Services\smali Nook121Patch\LockScreen.smali
apktool b services.jar -o Services
Click to expand...
Click to collapse
Thank you so much. I thought my post died with no response. I will try this when I get some free time. Thank you again.

Related

[TUT]-PORTING-Android To The VOGUE

the title says it
after many requests here is the guide
most of this is spread around the vogue
forum here and there, i just wanted to bring it all together
goal-seeing lately we have lost some good developers, this is a shot at getting more involvement in vogue/android development
I.SETTING UP YOUR SYSTEM
1. GETTING LINUX you will need to have Linux installed on your computer(dual-boot, vm, whatever). i recommend Ubuntu karmic (9.10) because its pretty new-user friendly. It can be found at http://www.ubuntu.com/
for you windows lovers here is a guide to setting up a ubuntu VM(virtual machine (if you really didnt know ))
2. THINGS/TOOLS YOU WILL NEED download these:
original 8/8/09 ion 1.5 build HERE(we are gonna use the bin-files and the apns-conf.xml, and a few apps)
the latest rootfs.img (find it)
these android tools (included are genext2fs (android version), split_bootimg.pl, and extract_ramdisk.sh)
after downloading, extract the zip to a folder. open a terminal and cd to the dir of the tools. click applications>accesories>terminal and type:
Code:
cd ~/whatever/
sudo rm -rf /bin/genext2fs
#dont type whats after the pound signs
#type in your password
#if you havent set up a su password yet type:
sudo passwd
#then make one, next
sudo cp -r ./whatever/genext2fs /bin/
squashfs-tools (if you have ubuntu 9.10-karmic first you will have to uninstall squashfs-tools 4.0(4.0 WILL NOT NOT NOT NOT NOT WORK) that is installed during the installation of linux ): go to system>administration>synaptic package manager. type squashfs-tools in the quick search, then right click and click mark for complete removal. then hit apply. then download and install this here http://http://ftp.us.debian.org/debian/pool/main/s/squashfs/squashfs-tools_3.3-7_i386.deb
i also strongly recommend downloading the sdk-tools v1.1(adb is almost essential when porting, for debugging purposes) enatefox has it posted on his media fire. (search for it)
3. ORGANIZATION
now that we have what we need. lets get organized.
a.mount points
we are going to use mount points while porting.
terminal:
Code:
sudo mkdir /mnt/rootfs
sudo mkdir /mnt/system
#i also have one for mounting data files
mkdir /mnt/data
b. directories
terminal:
Code:
mkdir ~/Desktop/android
mkdir ~/Desktop/android/ion
mkdir ~/Desktop/android/donut
#you get the point...
now put the ion 8/8/09 build in the ~/Desktop/android/ion folder and rename it system.sqsh then
terminal:
Code:
cd ~/Desktop/android/ion
unsquashfs ./system.sqsh
you should now have a folder called squashfs-root in the ion directory. it contains all the guts from the ion build. feel free to look around in that folder as you should get familiar with the folders and things in there
II PORTING
1. PORTING A HERO ROM(this was in zens how-to-make-a-hero-rom.txt im just adding on to it)
a. Download a rom from the dream/sapphire development forums.
b. Extract what you downloaded to ~/Desktop/android/hero. It is usually an update.zip.
c. Open the extracted folder. Inside you should see a data directory and a system directory.
d. Open the data directory and look for an app or app_s folder.
e. Open those folders and copy the apks to the system/app/ folder. Leave out what you don't need. feel free to add any custom apps. as long as they are from the same sdk number. ie 1.5, 1.6, 2.0.1, 2.1 most are pretty cross-compatible though.
f. Delete system/xbin from the rom your porting and replace it with the one from Ion.
g. Copy ~/Desktop/android/ion/squashfs-root/etc/apns-conf.xml from Ion to ~/Desktop/android/hero/system/etc/
h. Mount the latest rootfs.img
terminal:
Code:
sudo mount ~/whereever/rootfs.img -o loop /mnt/rootfs
i. Copy libaudio.so libaudioflinger.so libcameraservice.so libgps.so from /lib in the mounted rootfs over to system/lib in the rom you are porting*(donut and eclair really dont need this step because those files are in most of the latest rootfs.img's but be sure to check)
j. Edit the system/build.prop or even use the Ion build.prop.*(for donut/eclair you may want to edit the lcd density to 120 or 110 in the build.prop for qvga and 160 for 320x480)
k. Create a blank file in system/ called hero.build*(for eclair/donut create donut.build or eclair.build or eclairhero.build.....etc)
*l. for hero any systems too big to run on nand, here is a script to make a data file. put this in the ~/Desktop/android/hero directory. cut the app folder from ~/Desktop/android/hero/system and paste it to ~/Desktop/android/hero , and rename it too app_s . next run the mkdataimg.sh it should ask for you password in a terminal. type it in and then it should mount the data.img to data-mnt folder in ~/Desktop/android/hero . keep that terminal open copy the app_s folder in to data-mnt. then type y in the terminal to unmount the data.img. next:
terminal:
Code:
cd ~/Desktop/android/hero
ln -s /data/app_s ./system/app
that should make a broken symlink in system
2. Mount it and squash it
ok now that we are done porting lets put it together
terminal:
Code:
cd ~/Desktop/android/hero
genext2fs -d ./system -b 180000 -a system.ext2
sudo mount -o loop ./system.ext2 /mnt/system
sudo mksquashfs /mnt/system system.sqsh
sudo chown $USER ./system.sqsh
#and if you want
rm -rf ./system.ext2
from zenulator:
There are other little tweaks here and there but thats basically it. Now you can roll your own.
Click to expand...
Click to collapse
im gonna clean this up a bit later just wanted to get this out to you guys
nice thanks jamezelle
zen's manup456-based Eclair build contains different libaudio.so & libaudioflinger.so than the rootfs, and Eclair wouldn't boot if I replaced them with the libs from the rootfs. This might be due to the rootfs libs not being updated for Eclair yet (also why voice search/dial doesn't work) but I'm not sure. I don't know if this will be the case for 2.1, just wanted to add that in.
I really appreciate the guide and look forward to hearing more. I've learned a lot from zen as well but a lot of the work the devs do is so hard to follow because it's undocumented.
Do you know why the xbin has to be from Ion? Is it because of our kernel version or the squashfs ver that our kernel contains? I've been wanting to grab some of the tools from the xbin of other builds but have been unsure about compatibility.
Also, for more advanced Android ROM building, I'd like to add a link to zipalign optimization.
polyrhythmic said:
zen's manup456-based Eclair build contains different libaudio.so & libaudioflinger.so than the rootfs, and Eclair wouldn't boot if I replaced them with the libs from the rootfs. This might be due to the rootfs libs not being updated for Eclair yet (also why voice search/dial doesn't work) but I'm not sure. I don't know if this will be the case for 2.1, just wanted to add that in.
I really appreciate the guide and look forward to hearing more. I've learned a lot from zen as well but a lot of the work the devs do is so hard to follow because it's undocumented.
Do you know why the xbin has to be from Ion? Is it because of our kernel version or the squashfs ver that our kernel contains? I've been wanting to grab some of the tools from the xbin of other builds but have been unsure about compatibility.
Also, for more advanced Android ROM building, I'd like to add a link to zipalign optimization.
Click to expand...
Click to collapse
we need to move back to a more standardized comunity rootfs.img. i'm seeing more and more different rootfs.imgs that vary little by little. it is kind of hard to really document all of the development. but i see your point. the xbin(are just eXtended bin files) doesnt have to come from ion. the xbin in ion is actually empty
yes our kernel doesnt support LZMA compression which is what 4.0 uses. more info on it here http://www.squashfs-lzma.org/ i dont know why out kernel has not been updated to support it(you would have to ask DZO), i just know is isnt supported
thanks for the link to zipalign. i usually zipalign my apps. btw most dream and sapphire devs are already zipaligning there apks so we dont have to
I agree, I don't like forking the rootfs but the latest ones don't contain the correct WiFi files & settings for Kaiser. I know our kernel is way behind, I've asked several questions in the kernel thread about it but then the thread goes OT and I've never gotten an answer to most of the questions. Newbie16 has been compiling kernels but we've had trouble finding all the updated source files.
Oh, the PNG optimization in the zipalign thread is useful also, I easily saved 5 MB in the Eclair build.
The 8/8 file is a .img file, not .sqsh. Terminal tells me it can't find a sqash superblock on the file, or something to that extent.
EDIT: also missing a step that seems crucial... re squashing the files to make a .sqsh file to use?
ln -s help. hero nand porting
When ever I'm trying to port a hero build to nand ln -s gives me "operation not permitted" during boot. I used -a during genext2fs. Also data didn't work, even though I have the right apns-conif.xml. any idea? I was trying to port hero revolution (I think thats it ). Thanx
TheKartus said:
The 8/8 file is a .img file, not .sqsh. Terminal tells me it can't find a sqash superblock on the file, or something to that extent.
EDIT: also missing a step that seems crucial... re squashing the files to make a .sqsh file to use?
Click to expand...
Click to collapse
i fixed(add the missing steps) it but i dont have a copy of 8/8 ion personally. any ion system.sqsh build will work. if anyone has one please post it!
TheKartus said:
The 8/8 file is a .img file, not .sqsh. Terminal tells me it can't find a sqash superblock on the file, or something to that extent.
EDIT: also missing a step that seems crucial... re squashing the files to make a .sqsh file to use?
Click to expand...
Click to collapse
jamezelle said:
i fixed(add the missing steps) it but i dont have a copy of 8/8 ion personally. any ion system.sqsh build will work. if anyone has one please post it!
Click to expand...
Click to collapse
i just mounted the system.img and copied all the files to a new folder....that way then u dont have to mount the system.img everytime u are porting a rom
my steps to do that
[email protected]:~# cd Android
[email protected]:~/Android# dir
hi Inferno sensehero13 SenseHERO-v1.4_NoTheme senshero
signed-Hero_Inferno_Final signed-Hero_Inferno_Final.zip
system-2009-08-08.img system-sensehero-20091009.sqsh
TOOLS
ZipAlign.sh
[email protected]:~/Android# mkdir ion
[email protected]:~/Android# mount -o loop system-2009-08-08.img ion
[email protected]:~/Android#
Could someone please define...
Could someone please define rootfs, zIMage and the other parts that go into an Android build? If you're going from say, donut, to eclair, which ones can you reuse? I think I understand that the system.sqsh is what makes a build donut or eclair and actually is the file that has the customizations in it. But, what do the other parts do? If this is the wrong place to post this, mods, please move this. Thanks.
Sally
Hey guys, don't know if anyone else is having this issue or not.
I'm trying to work with the Topaz kernals...I downloaded the XDAndroid 2.1 system.sqsh and was able to unsquashfs it fine on my Vector Linux box...but I want to do the same to the TopazKernal16 system.sqsh (donut) but when I run unsquashfs it makes it to about 70% (highest I got to was 80% on one try) and then stops saying "killed".
any way to remedy this? also, what is the simplest way to "re"squash it?
Thanks!
iceman198 said:
Hey guys, don't know if anyone else is having this issue or not.
I'm trying to work with the Topaz kernals...I downloaded the XDAndroid 2.1 system.sqsh and was able to unsquashfs it fine on my Vector Linux box...but I want to do the same to the TopazKernal16 system.sqsh (donut) but when I run unsquashfs it makes it to about 70% (highest I got to was 80% on one try) and then stops saying "killed".
any way to remedy this? also, what is the simplest way to "re"squash it?
Thanks!
Click to expand...
Click to collapse
You just posted in the wrong forum altogether. This section is for the Vogue, not for the Topaz. Try to ask there on in one of the xdandroid threads. This project is different from xdandroid. Thanks.
egzthunder1 said:
You just posted in the wrong forum altogether. This section is for the Vogue, not for the Topaz. Try to ask there on in one of the xdandroid threads. This project is different from xdandroid. Thanks.
Click to expand...
Click to collapse
Sorry, thanks...
iceman198 said:
Sorry, thanks...
Click to expand...
Click to collapse
No prob
I would be interested in the Android's filesystem breakdown. Just some guide on what exactly is in the system, and then rootfs.img and then the modules. If someone could point me in the right direction, that would be much appreciated!
Thanks!
iceman198 said:
I would be interested in the Android's filesystem breakdown. Just some guide on what exactly is in the system, and then rootfs.img and then the modules. If someone could point me in the right direction, that would be much appreciated!
Thanks!
Click to expand...
Click to collapse
pm dzo, he will probably be able to help you there.
egzthunder1 said:
pm dzo, he will probably be able to help you there.
Click to expand...
Click to collapse
Thanks egzthunder1!
iceman198 said:
Thanks egzthunder1!
Click to expand...
Click to collapse
Not a problem. Good luck!

How to create flashable zip from scratch?

Hi everyone,
I was wondering if someone could point me in the right direction to create a flashable ROM from *SCRATCH*. I have googled everything I can think of and everyone seems to have the same answer -- take someone else's zip file and just replace the files with your own, then tweak the updater-script if necessary.
This seems kind of bogus to me, but perhaps I don't quite understand edify scripting. Certainly doing this with amend scripting would work, but that was deprecated a long time ago so I would like to use edify. I think the root of the problem is that I don't understand what the update-binary file is all about.
Can someone please explain how to create a zip without just using someone else's and tweaking it? I recently updated my framework-res.apk file and put new battery icons and new charging animation in it. Then I pushed it back over to my phone with adb and it works great. I would really like to know how to create a flashable zip from this. Sure, I could just download someone else's zip file and then swap out their framework-res.apk file with mine but that doesn't teach me the real, underlying process.
I am a developer for my day job so I'm not new to this type of stuff, but I am new to Android development. I can create the directory structure necessary and place my signed apk file where it needs to go. Furthermore I can write the updater-script file myself (in edify syntax). But then I need to somehow generate the update-binary file before creating the final, flashable zip and signing it.
So how exactly do I create the update-binary file? Do I need to run my updater-script file through a compiler or something? Or maybe the update-binary file is universal for every flashable zip (though if this were the case, then why have the file in every zip -- just put it on every phone and then you don't need to bloat every flashable zip file with it).
Can someone please explain? Also, if you can do it without mentioning or requiring any Windows specific tools that would be great. I run Ubuntu so most of the Windows tools are useless to me (yes I know I could run a virtual machine, or use Wine, etc.). I prefer to do everything with Linux or some platform-independent way.
Thanks!
I use linux too (gentoo) and I make mine pretty much from scratch. Just create a working directory somewhere (I use /usr/src/[my_package_name]/) then create a directory layout just like you'd want to see on the android device. For your example make a directory called "system" and then "system/framework" then copy your framework-res.apk to system/framework/. Now make a META_INF directory, and add "com" then "google" then "android" (so you have [my_package_dir]/META_INF/com/google/android/ ). Now copy the updater_binary (this is basically the command interpreter for edify scripts--amend commands are built-in to the recovery system). Now make your script. FOr your example above, your realy only need a few commands: mount the system dir, then copy the package file(s) over:
Code:
mount("ext3", "EMMC", "/dev/block/mmcblk0p25", "/system");
package_extract_dir("system", "/system");
You'll need to know the details for the specific device to know what arguments to use for the mount command. The above is for an Inspire or DesireHD.
Now just zip it all up (from your base package's directory):
Code:
zip -r -o my_package_file.zip META_INF/ system/
the "-r" means "recursive" and "-o" tells it what output file to use. The remaining arguments are the files (or directories in this case) to zip up.
That's great information...actually more detailed than what I needed but it's always better to have too much than too little. You answered my main question though which is what is the point of the update-binary file. If it's an interpreter for edify scripts then that makes total sense that it would be included in every zip (and furthermore be the same in every zip). I still think it's a bit of a waste though (just build that interpreter into the Android kernel itself so that people don't have to copy it around everywhere), but I'm not the one in charge of this stuff.
I guess I'm off to create a zip of my battery icons then. I'm on an Evo by the way, and if I remember correctly /system is mounted on /dev/block/mtdblock3. No big deal though, I can always cat /proc/mounts in a shell to find out.
Thank you very much!
P.S. You can save a few keystrokes on the zip command by dropping the -o and even dropping the .zip extension. Just try:
Code:
zip -r my_package_file *

[TUT]Series of guides to become a PRO DEV!!!!!!

[Hey guys Aditya here. After a month or so i'm posting tutorial and basic decompiling compiling using adb command!
THINGS YOU WILL NEED​
ON WINDOWS PC
1) Winrar
2) 7zip
3) Java
4) Apktool and adb tools!!!!! (Many tools are available download anyone of them)
5) notepad+ AWESOME THING
ON UBUNTU
1) Java
2) Android SDK
3) APKTOOL ofcourse
Let's get started! I asume you using a Windows PC
First of all download and install JAVA
From here
Download Latest Apktool, extract to :
Windows XP : C:\Document and setting\folder your computer name
Windows 7 : C:\user\folder your computer name
copy your apk & framework-res.apk/SemcGenericUxpRes.apk/framework 2 to same folder with apktool
Now you can start Editing apk
Example Editing Walkman
Open Command Prompt (CMD)
TO DECOMPILE
Code:
java -jar apktool.jar if framework-res.apk
java -jar apktool.jar d semcmusic.apk ( can be whatever name you give to your apk )
Some apks need dependies like tw-framework.apk
Code:
java -jar apktool.jar if framework-res.apk
java -jar apktool.jar if semcgenericuxpres.apk
java -jar apktool.jar d your.apk ( can be whatever name you give to your apk )
Now you can edit what you like to. E.g. Res layout etc!
(For more detalis refer Post #3)
TO COMPILE
To compile back the edited apk
Code:
java -jar apktool.jar yourapkname.apk
For signing apk just drop the android manifest and meta inf of older apk or original apk!!!!!!
F.A.Q
A.I'm getting error while compiling apk??
Check if you have installed framework-res.apk most of compiling errors are becoz of this
B.Can apktool batch decompile and recompile apk's??
Yes,many of modded apk manegers or tools can batch decompile and recompile apk's!!
C.Can i MOD any system app using apk tool?
Yes it can mod all types of apk's just make sure you have correctly installed framework and all other dependices!!!!
D.My modded apk is not working! What should i do???
This question is mostly asked to me! Firstly check weather you have put the Meta-Inf from original APK as this folder contain signatures required for apk to get install.Secondly if you have modded some xml check its correct or some code or values are wrong.If any values or wrong code can lead us to FC or Bootloop..!!!
Using ADB and taking logcat!!!!!
USING ADB AND TAKING LOGCAT
What ia adb??
adb stands for Android Debugging Bridge
For what it is used for
adb is commonly used to pull,push,taking system dumpFOR TAKING LOGCAT
What you will need
On windows
1) Java (Hmmm not needed but u should have. )
2) adb tools by me http://d-h.st/vHJ
Now to make it easy first of all check you have enabled USB Debugging in phone its in Developer Options.
PROCDURE
Make a new folder in C Drive
Extract these tools into it (Asume you folder name is adb)
Now open cmd
Code:
type cd..
cd.. again
cd adb
adb
Now you have installed adb on your PC!
TAKING LOGCAT
Code:
adb logcat>logcat.txt
For only redio related log type
Code:
adb -r logcat>logcatr.txt
For only errors type
Code:
adb -v logcat>logcate.txt
Push and pulling apps from system!
Pushing Apps
Pushing app is installing app on its intenrnal memory!Its simple and doesn't need extra powers!
Code:
adb push yourappname.apk /system/app or /system/framework
Place the app in the adb folder
Pulling Apps
Pulling app is to take out your system apps or frameworks etc!
Code:
adb pull /system/app or /framework yourapp.apk
By this method you can take a system dump
Code:
adb pull /system
Understanding Logcats!!!!!
Some keyword's that represent's error'
Code:
"E/" - error
"E/dalvikvm" - possibly crucial system error
"No such file or directory" - says it all
"couldn't" - android likes that, mostly shows faulty things.
"fail"/"failed" - mostly crucial error
"W/"/"warning" - says it all, but not always warn could be a boot failure cause
"exception"(especially NullPointerException) - points you that something went wrong in framework or application work
These type of errors help us understand the error's and we can easily call out from these bugs or errors!!!
Most common errors occuring in an logcat!
"couldn't find native method", the most common reason of a bootloop.
This error causes most of bootloop problems!!!
For example
Code:
E/dalvikvm( 100): ERROR: couldn't find native method
E/dalvikvm( 100): Requested: Landroid/view/GLES20Canvas;.nStartTileRendering:(IIIII)V
E/JNIHelp ( 100): RegisterNatives failed for 'android/view/GLES20Canvas', aborting
As you can see! The main reson for this error is smali present in android/view of framework.jar called GLES20Canvas.smali
This happens while you are trying to port ROMS!!!!
Now if you are having bugs in other apkor jars how can u find ahem! i.e logcat gives us only the location of smali files and not the name of apk or jar! For that you have to study hole android code sources! Some common folders i have posted here!!
Code:
"com/android/server" - services.jar (there is the same folder at framework.jar but most likely you don't need to touch it).
another place we could be mixed up:
"com/android/internal" - framework.jar
"com/android/internal/policy/impl/" - android.policy.jar
for framework.jar path ends up on internal, which represents telephony folder. policy/impl is the only android.policy.jar folder.
Other frameworks are actually not used in port as they contain core android functionality which is common.
Simple MOD's
Now you guy's have idea about how to take a Logcat,use adb,use apktool.
NOW SOME REAL STUFF
MOD's Related to SystemUI.apk
We will start with simple MOD's! Like replacing icons and to some extend changing layout!
Now we will start will replacing icons inside the SystemUI.apk
First of all pull app from /system/app using adb Refer #2
Then copy that app to apktool folder! Type this cmd
Code:
java -jar apktool.jar d SystemUI.apk
Now go to out folder of SystemUI.apk!
Will find META-INF! RES! ANDROID.manifest
Now Navigate to res/drawable-hdpi as our device uses HPDI
You will find many icons now be carefull here! If youare expert n photoshop or any bitmap editor eit these icons! Or search it! Google it you will find many!
Replace these default icons by ur edited once or downloaded once!!
XML EDITING
Some XML's are not so complicated as other once! Some xml's have just true or false! Example
Code:
<bool name="config_hardwareAccelerated">true</bool>
This tells me that Hardware Acceleration is enabled you can disable it by replacing true by false! You just need to experiment around!
Smali Editing!
Coming soon!
Patching!
Coming soon :d
Changelog
CHANGELOG
1 July Monday 6.04pm -- Inital Editing
Old info but very usefull for noobs. Keep it up
:thumbup:
Hit thanks if you think I helped you.
Sent from LG Nexus 4
Thats really awesome keep it coming am a noob and I rly want to learn n b a part of z dev team
Sent from my GT-I9082 using xda app-developers app
For apk editing there are many 3rd party softwares which doesn't requires one to write such huge codes for signing and etc .
Kinda old method
Make.Believe
Razor! said:
For apk editing there are many 3rd party softwares which doesn't requires one to write such huge codes for signing and etc .
Kinda old method
Make.Believe
Click to expand...
Click to collapse
Yup . Like chotu tools
Sent from my GT-I9082 using xda premium

[Q] Hopefully simple Nook Touch question...

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

[MOD][CM12.1 AND BASED ROMS]WebViewGoogle for CM Roms

WARNING: INSTALL GOOGLE´S ANDROID SYSTEM WEBVIEW FROM THE PLAYSTORE / GAPPS FIRST
https://play.google.com/store/apps/details?id=com.google.android.webview
Do you wan´t to use google´s updatable webview on a cm rom?
well too bad, even if you install and disable the built in webview, the system still dosen´t uses it, so what can we do?
modify a config in the framework called
"config_webViewPackageName" from com.android.webview to com.google.android.webview
you can do this via xposed with http://repo.xposed.info/module/net.typeblog.webview
however xposed for 5.1 is glitchy and will break a lot of optimizations if you are running a based cm run that has those.
so the solution? well flash the zip below, its a modified framework from cm12-13/04/2015 (DD/MM/YY btw)
https://drive.google.com/open?id=0BwduAK2l37OaSUprcG5LejNiS2s&authuser=0
Instructions:
Download zip from the link provided
Flash via recovery
??
profit
this is mine
BTW: I didn´t test on any other device, altought i dont think it will work since our framework contains some hammerhead-specific values
Thank you lord! I was searching for this for so long. This is going to be awesome to me!!
Best Regards,
Jairo.
May I ask how you did it? I decompiled framework-res.apk in Chroma ROM and then I navigated to "\framework-res\res\values" but I didn't find a config.xml file. Isn't this where the modification is done? Am I doing something wrong? @opssemnik
fr3quency said:
May I ask how you did it? I decompiled framework-res.apk in Chroma ROM and then I navigated to "\framework-res\res\values" but I didn't find a config.xml file. Isn't this where the modification is done? Am I doing something wrong? @opssemnik
Click to expand...
Click to collapse
its /res/values/strings.xml
opssemnik said:
its /res/values/strings.xml
Click to expand...
Click to collapse
I found it after decompiling your framework-res.apk and searching from Windows Explorer.
I went into strings.xml and replaced "com.android.webview" with "come.google.android.webview". Then I recompiled and pushed the new framework-res.apk to /system/frameworks(I had some translation errors but it was first time seeing who things). Anyway, the system doesn't boot at all and shows only the bootanimation for 15+ minutes. Could you help me?
I downoaded this folder: http://www.droidviews.com/tutorial-how-to-decompile-and-recomplie-apk-files/ and replaced the apktool inside of it with this one: http://forum.xda-developers.com/showpost.php?p=59436776&postcount=2812
I installed the framework via "apktool if framework-res.apk" just in case.
fr3quency said:
I found it after decompiling your framework-res.apk and searching from Windows Explorer.
I went into strings.xml and replaced "com.android.webview" with "come.google.android.webview". Then I recompiled and pushed the new framework-res.apk to /system/frameworks(I had some translation errors but it was first time seeing who things). Anyway, the system doesn't boot at all and shows only the bootanimation for 15+ minutes. Could you help me?
I downoaded this folder: http://www.droidviews.com/tutorial-how-to-decompile-and-recomplie-apk-files/ and replaced the apktool inside of it with this one: http://forum.xda-developers.com/showpost.php?p=59436776&postcount=2812
I installed the framework via "apktool if framework-res.apk" just in case.
Click to expand...
Click to collapse
after you recompile it, you must put the META-INF folder from the original apk into your new APK,then push it to system/framework and set its permissions to 644 (rw-r-r)
opssemnik said:
after you recompile it, you must put the META-INF folder from the original apk into your new APK,then push it to system/framework and set its permissions to 644 (rw-r-r)
Click to expand...
Click to collapse
It still doesn't boot and stays at bootanimation. I decompiled and recompiled the .apk again and using WinRar i copied the META-INF folder from the original .apk to the new one. Then I rebooted into recovery and typed these commands:
Code:
adb shell
cd system/framework
rm framework-res.apk
adb push framework-res.apk /system/framework (This is the recompiled apk with the META-INF folder)
adb shell chmod 644 /system/framework/framework-res.apk
adb reboot
Edit: I didn't install Google WebView this time.
fr3quency said:
It still doesn't boot and stays at bootanimation. I decompiled and recompiled the .apk again and using WinRar i copied the META-INF folder from the original .apk to the new one. Then I rebooted into recovery and typed these commands:
Code:
adb shell
cd system/framework
rm framework-res.apk
adb push framework-res.apk /system/framework (This is the recompiled apk with the META-INF folder)
adb shell chmod 644 /system/framework/framework-res.apk
adb reboot
Edit: I didn't install Google WebView this time.
Click to expand...
Click to collapse
install it from the playstore before doing this, also are you lastest snapshot apktool ? (its newer than rc4)
opssemnik said:
install it from the playstore before doing this, also are you lastest snapshot apktool ? (its newer than rc4)
Click to expand...
Click to collapse
The apktool I used is newer... I think; it was posted at a later date, thus newer. Could you upload your folder with your apktool that you used if you have enough bandwidth?
Edit: I installed it from the Play Store and pushed the .apk. Is there a way to see if it used Google or AOSP webview?
Will do once i get home
See the user agent or read the config , altought the latter probably will nerd system permissions.
Or you could delete system webview and see if webkit based apps still work
Since framework is updated regularly in cm nightlies, so is there any way to do this on the fly using latest framework files.
Thnx
fr3quency said:
The apktool I used is newer... I think; it was posted at a later date, thus newer. Could you upload your folder with your apktool that you used if you have enough bandwidth?
Edit: I installed it from the Play Store and pushed the .apk. Is there a way to see if it used Google or AOSP webview?
Click to expand...
Click to collapse
did you get it after all? if not i upload my apktool folder
prabhu_91 said:
Since framework is updated regularly in cm nightlies, so is there any way to do this on the fly using latest framework files.
Thnx
Click to expand...
Click to collapse
would require a custom build of cm with it, or a custom apk of the webview or a xposed module(see OP) or apktool / some kind of apk modifying program to be native compiled for android(so it could be ran as an addon.d script on recovery). you could always keep flashing older framework-res, generally cm dosen´t do much to it, but once it does, the mod will need to be updated.
BTW, making for VIVID-20150426v3
opssemnik said:
did you get it after all? if not i upload my apktool folder
Click to expand...
Click to collapse
Yeah I got it working. Thanks for the help!
Sorry ignorance, but what is the function of this file?
i need com.android.webview
could you please upload a com.android.webview flashable zip. i don't want com.google.android.webview, i'm facing major issue with google's updatable webview. i need a aosp webview. plz help me

Categories

Resources