Related
Yes, I've searched this forum, xda in general, and google.
I'm cooking up the next MatrixROM, and I have nearly everything the way I want it, but now when I download any app, it fails with an insufficient storage error.
Mainly the only things I've messed with are android.policy.jar and framework-res.apk as well as swapping some assorted apks in an out. Otherwise this is based on the latest DC. I've also got the rotary lockscreen stuck in there too. The only thing I've modified in the update script is a line to copy over the DATA folder for a few apks.
I have tried fixing apk uid mismatches and have also tried wiping and reinstalling. I'm guessing that this most likely has something to do with permissions, but I'm not too experienced with those sorts of issues..
Does anyone have an idea of what to try? I would have PM'd a dev, but I wasn't sure who was the best one to ask.
(going to sleep now, be back tomorrow) THANKS in advance!
SOLVED I don't want to bump the thread again, but I totally forgot that you need to apply permissions to the data/app folder
Code:
set_perm 1000 1000 0771 DATA:app
You try optimizing after zipping? The link to the script is somewhere in thus forum.
Edit: By optimize I mean deodex and zipalign the files.
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.
Hi,
Can anybody extract the APK for the LED Torch app preinstalled in Froyo?
I saw that the one include with Froyo on the Desire works with a Desire with Eclair. (But doesn't work with my Legend) So I would like to check if the one included in Froyo for the Legend will also work with the Legend on Eclair.
The package name is com.htc.flashlight
Thanks!
U don't have to wait....
Try this APP: Lamppu
But first u have to (Soft)root your Legend with (Universal Androot)
After that, install superuser APP. Now start Lamppu and allow superuser rights...
Now u can use your LED as torch.
Tried it self on my legend v.2.1
Sure about the name?
The only thing I found in the Modaco ROM was Flashlight.apk
Then again...I have no clue what I am doing
above file is not working
Yeah it doesn't install
Ok gentlemen, one more try.
Extracted, re-zipped and signed the apk using apk-manager.
Removed the system app from my phone using TitaniumBackup and installed the signed apk through Root Explorer.
Works for me. No guarantee that it does for any other ROM or Android version though.
Sorry for the video but I just found out how to do screencasts and love it
Its German but you should be able to understand it.
Notice that it is now uninstallable and listed as downloaded app.
denisman said:
Ok gentlemen, one more try.
Extracted, re-zipped and signed the apk using apk-manager.
Removed the system app from my phone using TitaniumBackup and installed the signed apk through Root Explorer.
Works for me. No guarantee that it does for any other ROM or Android version though.
Click to expand...
Click to collapse
Installed and ran for me in stock 2.1 but it didn't do anything with the flash when playing with it
Thanks for trying!
This one is installing correctly, and also loading correctly, but it doesn't light up the LED.
So it isn't working
Are you phones rooted?
First of all, you have to have deodexed apk and second, you need to set right permissions in sysfs.
Sent from my HTC Legend
BlaY0 said:
First of all, you have to have deodexed apk and second, you need to set right permissions in sysfs.
Sent from my HTC Legend
Click to expand...
Click to collapse
The apk is deodexed. As for the permissions. No clue how to set them right
Had to read up an hour last night just to learn enough to extract it. Big newbie here hehe. Guess I'll check some threads about sysfs permissions and try it again later.
Sysfs is everything under /sys directory. File /sys/class/leds/flashlight/brightnes should have read-write permission set for everyone.
Sent from my HTC Legend
BlaY0 said:
Sysfs is everything under /sys directory. File /sys/class/leds/flashlight/brightnes should have read-write permission set for everyone.
Sent from my HTC Legend
Click to expand...
Click to collapse
Ahhh thanks! I guess I understand now.
Ok I just flashed whitetigerdk's rev03 ROM which is a rooted 2.03 ROM.
Than I did the following in adb shell:
Code:
chmod 777 /sys/class/leds/flashlight/brightness
checked permissions with:
Code:
cd /sys/class/leds/flashlight
ls -l
and it has rw permission for everyone now.
Code:
-rwxrwxrwx root root 4096 2010-12-01 16:29 brightness
Problem is, that booting the phone resets the permissions.
EDIT:
I just repeated the procedure while the phone was booted in normal mode.
Permissions successfully changed AND flashlight is working correctly, including all three different light settings!
Still, a reboot resets the permissions.
Guess I have to find a way to make this change permanent now and all is done
Hah so cool. Never used chmod or any other linux command until today. Had to google everything while I was testing. Nice how much one can learn here.
Another EDIT:
Found something else that is interesting.
http://developer.android.com/reference/android/Manifest.permission.html#FLASHLIGHT
Would adding this to the AndroidManifest.xml help aswell? I'd do it myself but I have to work soon. Just tried it decoding the xml with AXMLPrinter and adding it. Unfortunatly I don't know how to save the xml in the right format again and just saving it corrupts the apk. If noone else wants to give it a try I'll check back after work.
denisman said:
Still, a reboot resets the permissions.
Click to expand...
Click to collapse
Yeah... this is done via init.rc which is inside initrd image. So you have two options... tweak init.rc (you would need to unpack boot.img image and extract initrd image, edit init.rc, make new initrd image and construct back boot.img... this can all be done in one swoop with dsixda's kitchen) or make a script that is run every boot (we are doing it via run-parts which also requires editing of init.rc... once again dsixda's kitchen can add this functionality in a single swoop)...
As for "android.permission.FLASHLIGHT" I'm not sure about it as I can see that HTC is doing it avoiding it (setting permissions to 666 by default in FroYo)...
If you want decoding/encoding xmls use ApkManager. It's a nice CLI tool that can decompile and compile apks back...
You are quite a fast learner, congrats.
Back home Got pretty late.
I don't actually need this since I am running a rooted Froyo ROM anyways but thought it would be an interesting task to get this working for others to easily use it and for me to learn more about Android. The first option sounds like it would require a bit too much end-user activity and would be limited to a certain set of ROMs if I understand it correctly.
Leaving the second and third option as the most user-friendly ones I guess.
I will read up more on init.rc and ways to script for it tomorrow. Sounds like a very powerful "tool" to know.
For now I will concentrate on the XML. Might be the most comfortable and ROM-independent way if I get it to work.
BlaY0 said:
As for "android.permission.FLASHLIGHT" I'm not sure about it as I can see that HTC is doing it avoiding it (setting permissions to 666 by default in FroYo)...
If you want decoding/encoding xmls use ApkManager. It's a nice CLI tool that can decompile and compile apks back...
Click to expand...
Click to collapse
Used Apk Manager to extract, zip and sign the apk in the first place. Really nice tool. Just didn't find an option to convert the xml from binary to readable, that's why I used AXMLPrinter2.jar which can do the conversion one-way but not back to binary.
I'll find a way
Thanks again for the input! Helped me a lot!
There are a couple of people whose navigation bar on their N4 isn't working. I'm talking about this.
Found a github repository which contains the fix (credits to gkraynov) for all stock releases: https://github.com/gkraynov/nexus-4-navfix
I've recently installed this ROM, which has a different build number (LMY48G), so this solution would not work for me, because stock 5.1.1 has LMY47V.
The fix (source): https://android-review.googlesource...droid/systemui/statusbar/policy/DeadZone.java
My steps were:
1.) Decompiled the SystemUI.apk with apktool (to get to the smali file):
Code:
java -jar apktool.jar d SystemUI.apk
Here's the decompiled source in a zip file.
2.) Decompiled the same apk with http://www.decompileandroid.com/ to get the java source
3.) Compared the source of the fix with corresponding smali and java file, like in this image.
4.) Recompiled with:
Code:
java -jar apktool.jar b SystemUI
5.) Pushed the apk back to the phone:
- set root access for adb and apps on phone under developer settings
- adb root
- adb remount
- adb push SystemUI.apk /system/priv-app/SystemUI.apk
After that I rebooted the phone, which didn't display the navbar anymore, so I've must have made a mistake somewhere.
Can someone, please, take a look and tell me, what I did wrong? I have zero experience with this.
You can share files you edit?
You didn't set perms right. Reboot to recovery and fix permissions or just change the permissions to
RW-R--R--
I also want to wear a custom rom , but the nav bar I do not work , if you can help ?
chmod?
Can anyone compile this source with android 6.0 marshmallow
Sent from my Nexus 4 using Tapatalk
I tried, I've tried to edit Deadzon.java but I am confused as to restore the file to dex for compile into apk again
I did the same thing using TMA to decompile and to update and got the same issue.
No more NAVBAR.
Any clue?
It appears that the code edit it`s not correct.
Using another tool http://bytecodeviewer.com/ to reverse engineer it appears wrong.
I am also newbie at this.
Can someone help?
same here
I have encountered the same issue with my N4.
To fix it, I tried a stock reset. Did not work.
Than I granted myself root access, installed CyanogenMod, which then allowed me to use the "pie"-Navigation, which works great.
I also found out, because of the full screen option etc., that the area of the screen of the broken navigation bar should be working, as it appears to work in different apps in landscape-mode.
So... My problem is now that I can't try out the patch you writing about because now I am using CM13, not the Stock Version which the fixes are referring to.
I am really new to all this ROM stuff (all I know about it is from this very day) - So, is there a way of applying this way of fixing the navigation bar to CM13?
Thank you.
Sackhaar said:
I have encountered the same issue with my N4.
To fix it, I tried a stock reset. Did not work.
Than I granted myself root access, installed CyanogenMod, which then allowed me to use the "pie"-Navigation, which works great.
I also found out, because of the full screen option etc., that the area of the screen of the broken navigation bar should be working, as it appears to work in different apps in landscape-mode.
So... My problem is now that I can't try out the patch you writing about because now I am using CM13, not the Stock Version which the fixes are referring to.
I am really new to all this ROM stuff (all I know about it is from this very day) - So, is there a way of applying this way of fixing the navigation bar to CM13?
Thank you.
Click to expand...
Click to collapse
I am facing the same issue.
But I am trying to create the patch for Paranoid Rom. If I suceed I think the same concept can be use for any other rom.
Hi all..
does anyone want to help me to update this patch for Lineage OS??
https://github.com/gkraynov/nexus-4-navfix
I don't understand why this isn't a feature of stock Android. They did it with the notification bar, but why not the navigation bar? The main reason for doing this is to prevent the navigation bar from being burned into your screen. There are Xposed modules for Lollipop/Marshmallow that do this exact same thing, making this mod unnecessary on those versions of Android. Since there's no Xposed for Nougat (or if you don't like using Xposed on Lollipop/Marshmallow), doing this mod will make your navigation bar dynamically change color to match your notification bar.
***Please Note***
This isn't perfect. In applications like Google Messenger the navigation bar doesn't change to match the color of the contact you're texting, but it's better than nothing.
Prerequisites:
- Nexus 6 with USB debugging enabled in developer settings
- TWRP
- ADB fully setup and functional
- Text editor (gedit (Linux), NotePad++ (Windows), or whatever you like to use)
- Archive Manager (Linux) or 7Zip (Windows)
- Apktool 2.2.2 (link at the bottom of this post)
- Apktool Windows wrapper script (Windows only)
Step 1: Boot into TWRP
Step 2: Select mount, then select system
Step 3: Connect your Nexus 6 to your computer and fire up a terminal (Linux) or command prompt (Windows)
Step 4: Navigate to the folder containing ADB (platform-tools).
Step 5: Type "adb pull system/framework/framework-res.apk".
Step 6: Type "apktool if framework-res.apk" This installs the framework
Step 7: Type "apktool d framework-res.apk" This decompiles the apk
Step 8: Navigate to res, values, and open styles.xml with your text editor of choice
Step 9: Search for "navigationBar". There will be three instances of it. You only have to change the last two. Change "@colorBlack" to "?colorPrimaryDark" and save your changes
Step 10: Open colors.xml and search for "input_method_navigation_guard". Change "ff000000" to "00000000" and save the file. If you don't change this, the navigation bar will turn black when you open the keyboard
Step 11: Go back to your terminal window/command prompt and type "apktool b framework-res". This recompiles the apk
IF YOU SKIP THE FOLLOWING STEP YOU WILL END UP IN A BOOTLOOP!!!!!!!!!!
Step 12: Delete META-INF and AndroidManifest.xml from the modified framework-res.apk and copy over the ones from your original framework-res.apk
Step 13: Push the modified framework-res.apk to your device with ADB or by boot into recovery, copy it to your phone, and use the TWRP file manager to move it to /system/framework. If you do the TWRP method, be sure to set the permissions to 0644 or your​ phone will not boot.
Step 14: Boot up your Nexus 6 and test it out!
Link to Apktool
Nice tutorial. However, the reasons you're having issues "reusing" an existing modified copy of framework-res.apk are twofold.
1. You're re-signing a system app. Unless things have changed in the four years since I last modified framework-res.apk, system apps are not signed.
2. The apk can also be moved into /system/framework using a file explorer on the device. It simply cannot be done in one shot as the permissions need to be changed prior to the final move into /system/framework.
The framework is Android version dependent, so an Android 5.x framework will not work in Android 6.x or 7.x. However, replacing the framework on multiple copies of the same version of Android is certainly possible. I have to head off to work, but when I have a spare moment upon getting home I'll generate a "reusable" framework, and a flashable zip as well.
Strephon Alkhalikoi said:
Nice tutorial. However, the reasons you're having issues "reusing" an existing modified copy of framework-res.apk are twofold.
1. You're re-signing a system app. Unless things have changed in the four years since I last modified framework-res.apk, system apps are not signed.
2. The apk can also be moved into /system/framework using a file explorer on the device. It simply cannot be done in one shot as the permissions need to be changed prior to the final move into /system/framework.
The framework is Android version dependent, so an Android 5.x framework will not work in Android 6.x or 7.x. However, replacing the framework on multiple copies of the same version of Android is certainly possible. I have to head off to work, but when I have a spare moment upon getting home I'll generate a "reusable" framework, and a flashable zip as well.
Click to expand...
Click to collapse
1. The first time I did this I didn't sign the app and ended up in a bootloop. After researching the issue I came across a post that said signing the app was necessary. Signing it fixed my problem, so I've signed it ever since out of habit. Next time I do this I'll skip signing it and see what happens. If I don't get a bootloop I'll remove it from the guide. It's possible I had a permissions error or something.
2. While moving it with a file explorer is possible, I just prefer ADB, so that's why I used it in my guide.
I realize that they're version dependant. I wasn't trying to use a modified framework-res from Marshmallow on Nougat or anything like that. For example, when I tried reusing one from the November factory image on the December security update, or one from the November image on Pure Nexus, I get a bootloops, so that's why I assumed it necessary to create a new one each time. It's not like this mod is hard or takes a large amount of time, so why not redo it each time just for fun?
Face_Plant said:
It's not like this mod is hard or takes a large amount of time, so why not redo it each time just for fun?
Click to expand...
Click to collapse
Not everyone likes playing around with app mods. When I last did it, it was to enable the network location service on a Coby tablet running Android 4.0.3. That was NOT fun as it involved smali editing. At least this is only an XML edit.
Strephon Alkhalikoi said:
Not everyone likes playing around with app mods. When I last did it, it was to enable the network location service on a Coby tablet running Android 4.0.3. That was NOT fun as it involved smali editing. At least this is only an XML edit.
Click to expand...
Click to collapse
I didn't mean for all mods, just this one. Like you said, it's only simple changes to two XML files.
After getting some practice by doing this a couple of times it only takes a few minutes to complete, depending on the speed of your computer. It takes me about 30 minutes since my Ubuntu machine is an old early 2000's PC that takes about 10 minutes to decompile the app, 10 minutes to sign it, and 10 more to recompile it... I'll be able to knock 10 minutes of that time if what you're saying is correct and signing it is unnecessary.
I'll try it again after class today and remove the signing bit if all goes well [emoji106]
Great write-up, worked well OP!
You can after recompile of the framework-res folder, you can delete the AndroidManifest.xml in the new APK, and copy the AndroidManifest.xml and META-INF folder from the original framework-res.apk into the newly built APK...hopefully that makes sense.
No need to sign. That's what I did and it worked just fine, eliminates a step. I use 7zip to do all of that BTW.
RMarkwald said:
No need to sign. That's what I did and it worked just fine, eliminates a step. I use 7zip to do all of that BTW.
Click to expand...
Click to collapse
Good to hear. Those steps have been removed from the guide.
I wonder why signing it fixed my problem when I did this on Marshmallow earlier this year... I guess I screwed up something else and the second time around when I signed it I didn't screw up whatever I did wrong the first time.
Face_Plant said:
Good to hear. Those steps have been removed from the guide.
I wonder why signing it fixed my problem when I did this on Marshmallow earlier this year... I guess I screwed up something else and the second time around when I signed it I didn't screw up whatever I did wrong the first time.
Click to expand...
Click to collapse
Could depend on the app maybe? Not too sure there. I started wanting to learn modding apks (mainly making color changes, etc) by guides similar to this, the whole "I wonder if I can do that?" thing. Hopefully this will encourage those looking to try something like this that isn't too difficult to do to give it a shot and try it, just remember to have a backup of framework-res.apk handy, always can be adb pushed back via recovery if something goes south.
Thanks again for this OP, so far working great!
Awesome write up!
Not trying to hijack the thread, but for those not comfy making mods, there is "an app for that" Navbar Apps
Simple app that will dynamically change your nav bar color as well as other goodies.
recompiling it fails. i get this error on Ubuntu 16.10 I even tried using sudo
I: Using Apktool 2.2.0-dirty
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:258)
at brut.androlib.Androlib.build(Androlib.java:270)
at brut.androlib.Androlib.build(Androlib.java:263)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:105)
at brut.androlib.Androlib.readMetaFile(Androlib.java:254)
... 4 more
how do i deal with this?
i see the yml file right in the folder
kidhudi said:
recompiling it fails. i get this error on Ubuntu 16.10 I even tried using sudo
I: Using Apktool 2.2.0-dirty
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:258)
at brut.androlib.Androlib.build(Androlib.java:270)
at brut.androlib.Androlib.build(Androlib.java:263)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:105)
at brut.androlib.Androlib.readMetaFile(Androlib.java:254)
... 4 more
how do i deal with this?
i see the yml file right in the folder
Click to expand...
Click to collapse
Is Apktool installed correctly? Have you tried using Apktool 2.2.1? Maybe 2.2.0 isn't compatible for some reason? These are obviously just guesses. I'm no master at reading error logs...
ok i figured that out..
will this technique work on nitrogen version 7.1.1 because the nav bar doesnt change but when i pull the framework-res.apk the xml files are in fact altered.
---------- Post added at 09:13 PM ---------- Previous post was at 08:24 PM ----------
Face_Plant said:
Is Apktool installed correctly? Have you tried using Apktool 2.2.1? Maybe 2.2.0 isn't compatible for some reason? These are obviously just guesses. I'm no master at reading error logs...
Click to expand...
Click to collapse
no the command in the tutorial didnt work. because i was compiling a folder named framework-res and not an apk all i did was remove the .apk from the command supplied and it worked finally
also i dont know if it is an error but the push command has an lsystem for the location to be pushed. that wasnt working either.
thanks for the reply bro
Thanks face_plant. It was working the whole time. I thought I would get the pixel icons lol. My bad
Great tut thanks
kidhudi said:
Thanks face_plant. It was working the while time. I thought I would get the pixel icons lol. My bad
Great tut thanks
Click to expand...
Click to collapse
Pixel buttons are from the Substratum theme I'm using. You can get those too by being on a Nougat ROM that supports Substratum and using Pixel UI theme from the Play Store.
Just a heads up, if you're on 7.1.1 the theme won't work. It needs to be updated to support 7.1.1. Haven't tried it on 7.1, so it may or may not work.