LED debugging in Hero (6-22-09) - G1 Android Development

WOW OK SO I FINALLY GOT LED's WORKING IN HERO!!!
This means they can be manipulated via Terminal but not the Android OS. That will be the next step.
*IMPORTANT 4:50pm CST*
-Correction, you should be copying/symlinking sensors.msm7k.so to sensors.trout.so and not sensors.hero.so to sensors.trout.so. Please see updated instructions below.
If you already copied sensors.hero.so to sensors.trout.so then do the following to fix it. Following the previous instructions could affect auto rotate
Code:
rm /system/lib/hw/sensors.trout.so
ln -s /system/lib/hw/sensors.msm7k /system/lib/hw/sensors.trout.so
*Update 4:44pm CST*
-Changed copy commands to symlink so we save space on /system. Thanks for the tip chunga
*Update 6:01pm CST*
-If you're getting an issue where auto-rotate is no longer working it's most likely you fudged on the symlinking sensors.msm7k.so over to sensors.trout.so.
*Update 9:37pm CST*
-Forgot to add that you need to have /system remounted as read/write. I have added the command below
*Update 8:00pm CST*
The following command does not persist across reboots, therefore it will need to be placed in /init.rc or in /system/init.rc if you have a modded rom that allows for it. Just so everyone is clear, you can NOT edit /init.rc directly. To do that you'll need to unpack boot.img, edit init.rc, then repack boot.img and fastboot flash it to your device. My advice is to download a modded ROM that gets released with this fix.
Code:
echo "1" > /sys/devices/platform/i2c-adapter/i2c-0/0-0062/blink
It was a pretty trick fix to figure out. Here is a revised post with the complete terminal commands. ROM devs you could place these chmod commands in /init.rc to get it working. Please give credit where credit is due if you use my fixes.
Code:
[B]TERMINAL COMMANDS[/B]
mount -o rw,remount /dev/block/mtdblock3 /system
ln -s /system/lib/hw/lights.msm7k.so /system/lib/hw/lights.trout.so
ln -s /system/lib/hw/copybit.msm7k.so /system/lib/hw/copybit.trout.so
ln -s /system/lib/hw/sensors.msm7k.so /system/lib/hw/sensors.trout.so
echo "1" > /sys/devices/platform/i2c-adapter/i2c-0/0-0062/blink
chmod 666 /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/blue/brightness
chmod 666 /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/red/brightness
chmod 666 /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/green/brightness
What's left to fix?
1) Currently the system is only giving the LED's a brightness of 1 so the light that comes on is dim. We need to find where it's getting this default value and up it to 100.
Want to manually change the colors?
You can edit the "brightness" value under leds/[blue/red/green] . The acceptable values are from 0 - 100. If you mix them up you can make any color you want
Exampe to change colors manually:
Code:
echo "50" > /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/blue/brightness
echo "50" > /sys/devices/platform/i2c-adapter/i2c-0/0-0062/leds/red/brightness
This would make a purplish color.

okay so does it change colors when its charging after its cut on.

I believe the hero has dual LEDs. It says something about it in logcat...Let me see if i can find it.

jaygajay said:
I believe the hero has dual LEDs. It says something about it in logcat...Let me see if i can find it.
Click to expand...
Click to collapse
Yes it does in fact have dual LED's. So the trick now that LED's work is to get it working just like it was in cupcake. I'll keep working at it you can be sure of that

wizern23 said:
okay so does it change colors when its charging after its cut on.
Click to expand...
Click to collapse
I haven't seen it change colors as my phone is fully charged so the green LED comes on. Since we don't have bluetooth I can't check for the blue LED working. Anyone have chompsms installed? I know you can pick which LED color you want. Anyone wanna test that it's all working?

Terminal codes?
Hello! Thanks for the great fix!! But is there anyway you can post the entire terminal emu code? Kinda new on the copying and replacing of files. Thanks so much !

Try missed call, you can easily sample the different colors

phungshum said:
Hello! Thanks for the great fix!! But is there anyway you can post the entire terminal emu code? Kinda new on the copying and replacing of files. Thanks so much !
Click to expand...
Click to collapse
I updated the main post so others can easily find it

phungshum said:
Hello! Thanks for the great fix!! But is there anyway you can post the entire terminal emu code? Kinda new on the copying and replacing of files. Thanks so much !
Click to expand...
Click to collapse
this is actually editing the init.rc script... what do i open that in to edit it? and after edit can i just remount my system as writable and change the file names in my sys/lib/hw folder to the explained file names?

Zarboz said:
this is actually editing the init.rc script... what do i open that in to edit it? and after edit can i just remount my system as writable and change the file names in my sys/lib/hw folder to the explained file names?
Click to expand...
Click to collapse
You can type those commands from the terminal. If ROM devs want to make it so installing their ROM automatically does this, they would do it in init.rc.
You and I can do this from the terminal. It should hold those changes across a reboot. Hmmmm, lemme reboot and make sure otherwise it would require unpacking/repacking the boot.img and making the changes to init.rc in there. You can not edit init.rc directly. You have to extract boot.img (you can get this from the ROM you installed). Do a search for unpacking/repacking boot.img

great news

Good job shafty.

tried it, works, restarted my phone by itself after the echo though. Little confuse about the chmod stuff so not gonna try that yet. Oh did it in adb too, thanks.
EDIT: seemed to break my 'g-sensor', so no auto-rotate.

this is going into 1.65 Thanks shafty023 for the work!

running jacman hero and his lights.msm7k.so is already renamed do i need to worry about this and after the chmod lines after the /brightness/ can i enter a modifier to change the ammount of light given out?

just to clarify the terminal commands,
using JACMAN 1.64, files are already renamed.

Zarboz said:
running jacman hero and his lights.msm7k.so is already renamed do i need to worry about this and after the chmod lines after the /brightness/ can i enter a modifier to change the ammount of light given out?
Click to expand...
Click to collapse
Ya that's because he got it from justanothercrowd who got it from me. I was sending him most of my fixes directly since I'm using his ROM. Only seemed fair.
So you can ignore the line pertaining to lights.msm7k.
Yes you can feel free to change the value in brightness to whatever you want. I actually think the max is somewhere around 256. You can mix brightness values and that will allow you to change the colors manually. But unfortunately when you plug an a/c adapter it turns on the green led at a brightness value of only 1

so for example at the endo f my chmod 666 .... /brightness/100 ?? or would it be /brightness100

cool! thanks for the fix!

did nothing for me? wonder what i did wrong

Related

Installing Maps w/ Navigation

Thanks to FollowingInsanity for editing the build.prop file to get it working corectly, and thanks to Maxisma for the Droid dump. Thanks to everyone else who pitched in on this whole thing. Really all I did was realize the exact line that needed to be changed....everyone else did the rest
Here are instructions on how I got the new maps w/ Navigation to work via adb. I'm running the official rooted 1.6 build, but this should work for anyone.
(if you don't know how you use adb, go to the here
Next, you need to uninstall the old maps.apk file and here's how I personally did it since you can't just go to "uninstall" from the Application Settings(these instructions start already in the ADB shell):
# mount -o rw,remount /dev/block/mtdblock3 /system
# cd system
# cd app
# rm xxxxxxx (this is whatever your maps.apk is titled. sometimes is just maps.apk, but it could also be com.android.google.maps.apk or somethin like that)
# exit
Click to expand...
Click to collapse
Now you've uninstalled the google maps. You can then do these next steps outside of adb.(for instructions purposes i'm using my own Android location):
C:\android\tools> adb pull /system/build.prop C:\Android
C:\android\tools> adb pull /system/build.sapphire.prop C:\Android
The 2nd may not be may be build.trout.prop or something to that effect...build.xxxx.prop
Click to expand...
Click to collapse
Next, change those 2 file names on your PC from build.prop to build-backup.prop and build.xxxx-backup.prop(if you have one) so that you don't lose those files in case anything stupid happens in the mean time lol.
Make a 2nd copy of build.xxxx-backup.prop and rename it is build.xxxx.prop. So now you should have a build.xxxx.prop AND a build.xxxx-backup.prop
Now you'll need the build.prop file to use
build.prop
(IF you are running a sapphire build, you can also use the build.sapphire.prop file located there and skip down to "re-loading prop files")
I saved that file to the same location that I saved my original files.
open build.xxxx.prop in notepad. look for where it says:
ro.build.description=kila-user 1.6 DRC83 14721 ota-rel-keys,release-keys
ro.build.fingerprint=xxxxxxxxxx:user/ota-rel-keys,release-keys
# end build properties
Click to expand...
Click to collapse
you'll need to delete the line that says ro.build.fingerprint=xxxxxxxxxx:user/ota-rel-keys,release-keys but DO NOT delete the line that says #end build properties
replace the line you deleted with the following:
ro.build.fingerprint=verizon/voles/sholes/sholes:2.0/ESD20/17572:user/ota-rel-keys,release-keys
Reloading Prop Files
next, back in your command line window do the following:
c:\android\tools> adb push c:\android\build.prop /system/
c:\android\tools> adb push c:\android\build.xxxx.prop /system/
Click to expand...
Click to collapse
then restart your phone
while the phone is restarting, go back and rename your build.prop and build.xxxx.prop files to build-update.prop and build.xxxx-update.prop, then change your build-backup.prop and build.xxxx-backup.prop to build.prop and build.xxxx.prop
After it restarts you'll want to locate your maps.apk file(the new one) and go back into your command line and type:
c:\android\tools> adb shell
# mount -o rw,remount /dev/block/mtdblock3 /system
# exit
c:\android\tools> adb install c:\android\maps.apk
(install crap...if it doesn't install correctly then don't do whats below)
Click to expand...
Click to collapse
Go check your google maps, type in two locations and click "go" and on the next screen you should see a button that says "Navigate"
go back to your command line screen and type:
Sorry if this is confusing, anyone who could make it more simple, please feel free to give it a try, but this is the best I could offer so people wouldn't have to go looking though the whole think tank thread to get everything they need to get it working
IF THE INSTALL GAVE YOU AND INVALID_UPGRADE ERROR THEN TRY THIS:
(again these instructions are using my own android sdk location, replace the
c:\android\tools with YOUR sdk location
from the command line type the following:
c:\android\tools> adb shell
# mount -o rw,remount /dev/block/mtdblock3 /system
# exit
c:\android\tools> adb pull /data/system/packages.xml c:\android\
Click to expand...
Click to collapse
BACK UP THIS FILE BEFORE EDITING IT
Once that's done, open that xml file in a text editor hit ctrl+f and search for maps, the first one will probably say auth.sitemaps, ignore that, keep searching untile you get to something to the effect of com.android.google.maps.apk or something like that. when you see that, you'll want to delete everything from "<packagename=" to "</package>" for the google maps app. BE VERY CAREFUL!!!! you don't want to accidentally delete something else, thus the reason for the back up.
after you've done that, go back to your command prompt and type:
c:\android\tools> adb push c:\android\ /data/system/packages.xml
c:\android\tools> adb install c:\android\maps.apk
Click to expand...
Click to collapse
it should then install perfectly fine. thats what I had to do to get it to work for me
I love you guys! will try this when I get home from work!
it does not appear to be 100% working....yet...
as posted by dwang, http://forum.xda-developers.com/showpost.php?p=4921655&postcount=275
dwang said:
If you push the old build.prop files back, after a while, the nav option disappears.
Click to expand...
Click to collapse
which I can confirm. About midnight last night it was working okay, and this morning it was gone.
followinginsanity says he will work on it today. http://forum.xda-developers.com/showpost.php?p=4921665&postcount=278
followinginsanity said:
Confirmed... will work on it tomorrow.....
Click to expand...
Click to collapse
may not want to rush to get it working only for it to not work a few hours later...but ..like most people here...that probably won't stop many
I edited the build.prop file...and now it will only work with Sapphire builds. For CM builds, build.prop file that FollowingInsanity created
Code:
c:\android\tools> abd push c:\android\build.prop /system/
c:\android\tools> abd push c:\android\build.xxxx.prop /system/
Should be
Code:
c:\android\tools> adb push c:\android\build.prop /system/
c:\android\tools> adb push c:\android\build.xxxx.prop /system/
Takenover83 said:
Code:
c:\android\tools> abd push c:\android\build.prop /system/
c:\android\tools> abd push c:\android\build.xxxx.prop /system/
Should be
Code:
c:\android\tools> adb push c:\android\build.prop /system/
c:\android\tools> adb push c:\android\build.xxxx.prop /system/
Click to expand...
Click to collapse
Changed lol. thanks
where can i get the new maps apk? the old one fails to install
i get error
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
ahronzombi said:
where can i get the new maps apk? the old one fails to install
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=4921092&postcount=196
That's the one I did, it also has all the needed files just grab the files from there and you should be able to use them for these instructions
ahronzombi said:
i get error
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
Click to expand...
Click to collapse
When that happens you need to:
adb push <path to>/Maps.apk /system/app
adb shell
# install /system/app/Maps.apk
# exit
hey hey hey
could you or somone who got this to work try to make a video tuturiol on this so we can all clearly see how it works!!! please someone make an post it on youtube if possible thanks!!!!!!!!!
navigation doesn't work outside of the US at the moment right?
I was able to get the new maps.apk to install - and it is clearly a different application (with the new layers), but no navigate button. : (
seaweeduk said:
navigation doesn't work outside of the US at the moment right?
Click to expand...
Click to collapse
Nope, not until the big G says so.
mianosm said:
I was able to get the new maps.apk to install - and it is clearly a different application (with the new layers), but no navigate button. : (
Click to expand...
Click to collapse
what rom are you using?
mianosm said:
I was able to get the new maps.apk to install - and it is clearly a different application (with the new layers), but no navigate button. : (
Click to expand...
Click to collapse
You might have to try editing your packages.xml file even though it didn't give you an install error. Also, if you push your original build.prop's back, you lose navigation after a few hours. I guess the quick solution to that would be to keep the new build.prop's, but I'm not sure what the problems that might or might not create for other apps.
I'm using CM-4.2.3.1 with the edited build.prop and the build.sapphire.prop files.
# mount -o rw,remount /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
A quick shortcut is to drop the device from this command. As you're re-mounting, the kernel knows the device name. Like this:
# mount -o rw,remount /system
Click to expand...
Click to collapse
Wow dude your the bomb, I did it a different way but it worked perfect. I just took a dount rom extracted it, deleted the maps.apk, then I took the droid dump maps app and put it into the donut rom. Then I made the changes to the build.trout.prop so that it recognized the g1 as the verizon phone, used your downloadable build.prop, of course I just deleted the original build.prop in the donut build, I resigned the donut rom, flashed it like it was brand new, and bingo everything worked perfectly. Wow good job dude. I would upload my rom but I dont want to get into any trouble.
I am using "AOSP1.6_r1.4+ADP DRD20 ROM". Maps on here is called "GoogleMaps.apk". I also do not have just a build.prop. I have a build.sapphire.prop and build.trout.prop. I modified both and replaced according to the first post. When I rebooted, GoogleMaps.apk was reinstalled, so I had to uninstall it again.
I did get the error described in post #8, but was able to get around it with the help of post #10.
But for some reason my network is completely down so I can't do nothing. Wifi and Cellular network. Hmmmm.
Edit: Replacing the files I backed up with the originals, brought my networks back.

How make run sound boot animation on CM6

Hello guys im trying for awhile to make a run some boot animation sound over the stock CM6 blue android that is comming as stock but i never get succes can somebody help me with this please
juancaperez2000 said:
Hello guys im trying for awhile to make a run some boot animation sound over the stock CM6 blue android that is comming as stock but i never get succes can somebody help me with this please
Click to expand...
Click to collapse
The solution is not for the faint of heart and will have to be reapplied with each nightly.
Add this to init.local.rc
Code:
###Bootsound - Safe to Delete: Start ###
service bootsound /system/bin/bootsound
user media
group audio
disabled
oneshot
on property:init.svc.bootanim=running # to correct timing
start bootsound
on property:dev.bootcomplete=1
stop bootsound
### Bootsound - Safe to Delete: End ###
Then make a new file called "bootsound" and push it to /system/bin
i.e. "adb push c:\path\to\bootsound /system/bin/bootsound"
Code:
#!/system/bin/sh
bprop=/system/build.prop
grepprop() { x=`grep "^$1=" $bprop | head -n 1`; echo $x | cut -d = -f 2; }
play=`grepprop "ro.config.play.bootsound"`
if [ "$play" = "1" ]; then
stagefright -a -o /data/local/android_audio.mp3
fi
exit 0
Issue the following commands:
Code:
adb remount
adb shell chmod 777 /system/bin/bootsound
adb shell chown root:shell /system/bin/bootsound
adb shell echo ro.config.play.bootsound=1 | cat >> /system/build.prop
Now put your startup sound, whatever MP3 it is, in /data/local with name android_audio.mp3 and it will be played at startup. You test it with an adb reboot. I flash nightlies on a regular basis so I stopped doing this as it's a PITA to constantly have to push changes each night. I like to flash + go.
'tuna
Wow...only question is would this work for for stable 6? And can I do it thru term emu
cubanjinx said:
Wow...only question is would this work for for stable 6? And can I do it thru term emu
Click to expand...
Click to collapse
As long as you have a way to edit the init file + create/edit the new bootsound file then yes it can be done via term emu. Should work with any/all versions of cm6. Obviously you'd omit the "adb shell" portion of the shell commands.
'tuna
spiicytuna said:
The solution is not for the faint of heart and will have to be reapplied with each nightly.
......
'tuna
Click to expand...
Click to collapse
Wow. One of the best answers I have ever seen around here.
spiicytuna said:
The solution is not for the faint of heart and will have to be reapplied with each nightly.
---------
Now put your startup sound, whatever MP3 it is, in /data/local with name android_audio.mp3 and it will be played at startup. You test it with an adb reboot. I flash nightlies on a regular basis so I stopped doing this as it's a PITA to constantly have to push changes each night. I like to flash + go.
'tuna
Click to expand...
Click to collapse
Wow. Not kidding with the "not for the faint of heart" part. I think I will live with no sound. Unless, I knew how the hell to use that code. Meh....
Will donate
Tuna or anyone else willing to walk me through this for a donation? Haha... I set up a whole mp3 for the boot to come to this road block. Also, for anyone reading, how can I change just the lock screen wallpaper on froyo. (Using plain black background right now and it makes the lockscreen a little too boring) Thanks.
has this been confirmed working on CM6 final? read some comments over at the cyanogenmod forum that this script was droid x phones, not the evo?
i'm going to give it a try tonight or tomorrow night, some questions
1)where is the init.local.rc file?
2)what kind of file should the bootsound file be? .txt file? no extension? ??
3) the code you put after saying to make the bootsound, does that mean that code is to be entered into adb or as the content of the bootsound file?
spiicytuna said:
The solution is not for the faint of heart and will have to be reapplied with each nightly.
'tuna
Click to expand...
Click to collapse
EDIT: tried it. edited the init.local.rc file using Notepad++. made the bootsound file using Notepad++ and in it put the code you have up there. no file extension. pushed it to the right directory, followed the adb commands. got an error in the last one (echo) saying it couldn't find the path (it's there though?).
put the android_audio.mp3 in /data/local....rebooted and no sound. no errors either, but no sound.
EDIT 2: thanks for your work spiciituna. apparently there was some mistake on my part. i ran a script that your code in it and now the boot sound works.
http://forum.cyanogenmod.com/topic/7433-bootanimations-audio/
I am still having no luck. :-( Can anyone enlighten me?
Sent from my PC36100 using XDA App
austinjay said:
I am still having no luck. :-( Can anyone enlighten me?
Sent from my PC36100 using XDA App
Click to expand...
Click to collapse
I was finally about to get it to work.
Here is the post with the flashable zip
http://forum.xda-developers.com/showthread.php?t=844414
juancaperez2000 said:
Hello guys im trying for awhile to make a run some boot animation sound over the stock CM6 blue android that is comming as stock but i never get succes can somebody help me with this please
Click to expand...
Click to collapse
if it's FroYo, then the directory has been moved to /system/customize/resource/. You reboot to clockworkmod -> mount system (partitions menu) -> reboot recovery (advanced menu) -> open cmd prompt in windows, cd to sdk\tools\ and run: "adb remount" -> then have the .wav file in the tools folder and run "adb push ATT_bootup.wav /system/customize/resource/" if it's an AT&T phone. Verizon phones use VZW_bootup.wav I am pretty sure & I'm not sure about the other ones.

[DEV] Script for tweaks (version 1.02) 18-12-2010

Here is a script i've made (had nothing to do, so...).
Phone must be rooted and have busybox installed.
What first menu looks like:
1 - enable/disable hardware acceleration
2 - enable/disable jit
3 - enable/disable stagefright player
4 - change heapsize
s - show status
r - revert to original configuration
q - quit (don't forget to reboot your phone!)
==================
enter your option:
Click to expand...
Click to collapse
Download:
http://www.4shared.com/file/gApTB6EG/tweaks.html
md5 b0865d9de67a82215913512cb644211d
Just copy the file to your sdcard. Then in a terminal emulator run:
su
cat /sdcard/tweaks > /data/tweaks
rm /sdcard/tweaks
cd /data/
./tweaks
If it doesn't run, type first:
chmod 755 /data/tweaks
Additional notes:
Script does not work if run from sdcard, must be in /data/ or /system/ (this one goes to allsalvati for testing)
---
If anything is wrong i will fix it, but only if you give me feedback
If you know any good tweaks, say it and i'll add them.
---
Changelog:
version 1.02:
backup/restore added
version 1.01d:
working again. sorry for the mess...
version 1.01c:
nothing new. just rearranging code
version 1.01b:
messages were not staying in output. fixed
version 1.01a:
small fix. v1.01 was not working
version 1.01:
added status menu
ruigui said:
Here is a script i've made (had nothing to do, so...). Phone must have busybox.
Download:
http://www.4shared.com/file/gApTB6EG/tweaks.html
md5 ea568c399c67ecd87db0dd790cdf0e93
Just copy the file to your sdcard. Then in a terminal emulator run:
cd /sdcard/
./tweaks
If it doesn't run, type first:
chmod 777 /sdcard/tweaks
Please give me some feedback. I don't own the phone so i can't test.
Click to expand...
Click to collapse
what the script does?
So script should be able to do:
enable/disable hw acceleration
enable/disable jit
enable/disable stagefright player
change heapsize
Yes. For now it's what it does.
The ideia is to be able to enable/disable a certain tweak, without reflashing zips, and rewriting files in phone.
But i need some feedback to know if it is working. I can't test it.
It will only change values in /data/local.prop, nothing else.
It seems that it is well written, so I will try that and let you know what's happened.
Thanks for testing. I'm still waiting to have some money so i can buy this phone...
Meanwhile, i'm "playing" with ROMs and files. I'm not good at scripting, but i'm trying to learn while doing something useful.
How much did you increase the heap size?
domenic_s said:
How much did you increase the heap size?
Click to expand...
Click to collapse
I didn't increase it. Script shows this message:
"default=24, recommended=32"
"enter new heapsize value (1-64): "
You can enter any value between 1 and 64.
If you enter any other value, or a string, character, symbol... script will show this message:
"wrong value"
"please input a value between 1 and 64"
For those who don't feel like editing this themselves this is great. Thanks for releasing it for people to try out more tweaks on stock ROMs.
i'm trying to run this script and gives me the following message: ./tweaks: permission denied
Before anything i typed su, then chmod 777 and it gave me error.
It should work be working...
Anyone else confirms this issue? Is this script running or not?
If it is working and there are more tweaks, i can easilly add them to the script.
If this is an isolated case, i really can't help. I don't own an android phone (yet), so i can't test....
allsalvati do you have busybox installed?
No, i don't.
Sent from my LG-P500h using XDA App
That may be your issue.
You must mount /system/ as read-write, then copy busybox binary to /system/xbin/, then run these commands in terminal emulator:
su
cd /system/xbin
/system/bin/chmod 755 busybox
./busybox --install -s /system/xbin
After that you can mount /system/ as read only again, and reboot your phone.
I don't know if there is another way to install it that is easier.
I downladed busybox installer from market and the app says that was installed. The. /tweaks gives me the same message.
How do i test if busybox was installed right?
Sent from my LG-P500h using XDA App
I found this:
That is a problem, you cannot chmod a script to executable on the SD card. (well some things can, but 99% no) the system is designed to prevent u executing scripts from an SD card
cp it to /system/xbin or /system/bin.
Or if u hate to see it in system', use /data/
THEN chmod it. should be fine to run
Click to expand...
Click to collapse
Try to copy the file to /data/ (so you don't mess with /system/), and then try to run it with:
cd /data/
chmod 777 tweaks
./tweaks
It should not need to be run as root
Moved to /data and worked.
I changed heap size to 32 and disabled hardware accelaration just to test.
With hw acc - 981 on Quadrant
Without - 820
So i think this is working.
Perhaps you should print the values so the user can see what is enabled or not before apply.
Thanks for your help
Sent from my LG-P500h using XDA App
Can you test something for me?
Make sure you have hardware acceleration disabled, and reboot you phone.
Then open terminal and run:
getprop | grep hw (see what it outputs)
then run the script, enable hardware acceleration on it, but DON'T reboot your phone yet.
Then exit script, and run again:
getprop | grep hw
Has the value changed, or is it the same?
I need to know if the system assumes immediately any changes (although they may not be functional until reboot).
This is needed to work on your request.
allsalvati said:
Perhaps you should print the values so the user can see what is enabled or not before apply.
Click to expand...
Click to collapse
I'll work on that and post an update after someone tries what i asked above.
Thanks for testing
EDIT: to test benchmarks, enable/disable jit. It gives greater differences in values
I tried what you say and both outputs are the same:
$getprop | grep hw
[debug.sf.hw]: [0]
[hw.keyboards.65537.devname]: [7k_handset]
[hw.keyboards.65540.devname]: [thunder_keypad]
[hw.keyboards.65541.devname]: [touch_mcs6000]
[hw.keyboards.65542.devname]: [atcmd_virtual_kbd]
Edit: Tested disabling JIT and it worked. Linpack Before 7.35 - After 4.3
So i can't rely on getprop to check current values...
If anything is changed, getprop won't give the right output till reboot.
Damn... Script was almost updated. Now i must find a new way and redo this section.
Thanks for testing again
EDIT:
New version for download at first post. status menu added.
I think it's all ok.
It seems work fine on my phone. But I can't see the status. When I choose to see current status or status after reboot, the screen of my emulator returns too fast to the selection menu (show curent status or after reboot) and I can't see anything !

[MOD] Enable Stock Hotspot on Verizon

I have gotten the built-in wireless tether to work. I know there's been some discussion about getting Wireless tether without FoxFi and similar.
Since we cannot use the recovery method directly, you can still use the tools and everything from it.
So to begin:
Obviously, you must have root for this to work.
1) Download the patch.zip from the original thread. [here: http://forum.xda-developers.com/showthread.php?t=2768837 ]
2) extract the zip to somewhere on sdcard. I extracted mine to the Download folder. You may need to edit the script below to reflect your locations.
3) okay, this part gets a little weird, but bear with me...
Save this code as run.sh in Download folder or wherever you extracted. You can over-write the old run.sh if you save it in toggle folder where original was located-- BE SURE TO EDIT AS REQUIRED
Code:
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/data/local/tmp/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
4) now open up adb on pc (preferred!!! So you can still see progress and if necesary you can undo/alter/fix things) or terminal emulator (untested but should work, may be weird since you have to reboot phone while it's interface is locked up)
Run:
adb shell
su
sh /mnt/sdcard/Download/toggle/run.sh [or where ever you saved it]
5) Your phone will probably lock up now because you've just replaced the framework-res.apk while the system was running.
adb reboot or reboot by other methods.
6) Profit ;]
I DO NOT WARRANTY OR GUARANTEE THIS METHOD. USE AT YOUR OWN RISK
I believe the sqlite edits serve the purpose of showing the icon in the quick settings pull down. Otherwise, just replacing the framework-res.apk with the correct changes is enough: See this thread for the changes needed:
http://forum.xda-developers.com/showthread.php?t=2759119
Incidentally, I was attempting to make the changes on my own and recompile the framework-res.apk, and I must've done something not quite right because the phone hung at the verizon logo. Thankfully adb was up so I was able to remount system as rw to replace the edited framework-res.apk from the original thread OP linked. Interestingly enough, as soon as I finished copying the edited file, the phone continued booting just fine, and I'm posting from the native tethered connection now.
Edit: I was able to do the changes on the framework-res.apk extracted/decompiled from my phone after all. I'm guessing that the phone didn't like deflate method as opposed to store method (no compression) on the resources.arsc file in the apk file. Had to use the 7zip command line tool to save the modified resources.arsc file without compression to the original apk:
7z u -mx0 framework-res.apk.zip resources.arsc
where -mx0 means no compression (copy)
Got it enabled by just replacing the framework-res.apk, and noticed speeds were really slow. I get 1.88mbps on LTE at home (so-so coverage), but only .15mbps on my iPad connected to my phone via Wi-Fi.
I did this: http://forum.xda-developers.com/showpost.php?p=53431713&postcount=9
SO MUCH EASIER than what you guys were doing. :good:
Droid_Evo_8 said:
I did this: http://forum.xda-developers.com/showpost.php?p=53431713&postcount=9
SO MUCH EASIER than what you guys were doing. :good:
Click to expand...
Click to collapse
It's a manner of preference. In terms of overhead, this native method should technically be quicker to enable, as it does not have to wait for the exposed module to intercept the call and return an empty array of apps to execute for the provision check. That being said, we're probably talking miliseconds at most. While I use xposed for other modules sometimes, others might prefer not to, and this native method does not require it.
vacaloca said:
It's a manner of preference. In terms of overhead, this native method should technically be quicker to enable, as it does not have to wait for the exposed module to intercept the call and return an empty array of apps to execute for the provision check. That being said, we're probably talking miliseconds at most. While I use xposed for other modules sometimes, others might prefer not to, and this native method does not require it.
Click to expand...
Click to collapse
I don't know much about adb or terminal emulator so I'm fine with it. :good:
Here's to hoping for an easy tethering mod!
fillyo said:
Here's to hoping for an easy tethering mod!
Click to expand...
Click to collapse
I'm not sure how easier it can get than installing xposed framework + X Tether mod and rebooting, or replacing the framework-res.apk file on your phone with the one listed in the OP... either will work. This of course assumes you have the Verizon model. Replacing the premade framework-res.apk on any other S5 model would probably cause issues and wouldn't solve anything .
I just made it 'harder' on myself by deciding to copy the original framework-res.apk from my phone, and using the latest apktool and aapt to extract the apk, make the modifications, rebuild it, and replace it on my phone (after renaming the original to .bak). I mostly did this to refresh my memory on how to do it as I had done the process with another phone a while back to do the same mod. As I mentioned earlier, the sqlite stuff is only necessary if you want a toggle in the quick settings bar... otherwise you can just go into settings menu and enable it that way.
vacaloca said:
I'm not sure how easier it can get than installing xposed framework + X Tether mod and rebooting, or replacing the framework-res.apk file on your phone with the one listed in the OP... either will work.
Click to expand...
Click to collapse
I don't see the framework-res.apk file in OP, am I missing something? I have no idea how to decompile mine to make changes.
fillyo said:
I don't see the framework-res.apk file in OP, am I missing something? I have no idea how to decompile mine to make changes.
Click to expand...
Click to collapse
It's linked to in step (1). It's inside the zip file that's meant to be flashed in a recovery... however, because our bootloader is still locked, we cannot flash a recovery, so the way to do it is by replacing the framework-res.apk file as the filesystem is live, which as the OP mentions, will trigger a soft reboot as this file is used extensively by Android apps.
vacaloca said:
It's linked to in step (1). It's inside the zip file that's meant to be flashed in a recovery... however, because our bootloader is still locked, we cannot flash a recovery, so the way to do it is by replacing the framework-res.apk file as the filesystem is live, which as the OP mentions, will trigger a soft reboot as this file is used extensively by Android apps.
Click to expand...
Click to collapse
I got the framework-res apk from the zip package, I guess I am a little nervous since this is from a dev edition, correct? Anyone else successfully just replace framework-res from the zip package on their retail Verizon GS5?
fillyo said:
I got the framework-res apk from the zip package, I guess I am a little nervous since this is from a dev edition, correct? Anyone else successfully just replace framework-res from the zip package on their retail Verizon GS5?
Click to expand...
Click to collapse
The OP (presumably), user in post #3, and myself before I did the changes manually.
SO I followed these instructions and this is what i get both from adb and Term Em.
mount: No such file or directory
: Read-Only file systemramework-res.apk.bak
: Read-Only file systemramework-res.apk
/mnt/sdcard/download/toggle/run.sh[8]: /mnt/sdcard/download/toggle/sqlite3: can't execute: permission denied
I use the same folder structure you did, created a download folder and extracted the zip...
Thoughts?
tangoboyz said:
SO I followed these instructions and this is what i get both from adb and Term Em.
mount: No such file or directory
: Read-Only file systemramework-res.apk.bak
: Read-Only file systemramework-res.apk
/mnt/sdcard/download/toggle/run.sh[8]: /mnt/sdcard/download/toggle/sqlite3: can't execute: permission denied
I use the same folder structure you did, created a download folder and extracted the zip...
Thoughts?
Click to expand...
Click to collapse
Seems at least like 2 errors... the mount command can't find the input or output directories, thus you attempt to copy the files and get read-only file system, and it looks like sqlite3 needs to be changed to executable... chmod +x sqlite3
Also make sure you're running as root, obviously.
I saw a similar post int the android development subforum, and they seem to believe you will bootloop if you try to overwrite your framework-res. I chickened out and just did the xposed and x tether mod.
vacaloca said:
Seems at least like 2 errors... the mount command can't find the input or output directories, thus you attempt to copy the files and get read-only file system, and it looks like sqlite3 needs to be changed to executable... chmod +x sqlite3
Also make sure you're running as root, obviously.
Click to expand...
Click to collapse
I am rooted. Here's what i had in my run.sh:
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/mnt/sdcard/Download/toggle/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
NOW does this look right??
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod +x 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/mnt/sdcard/Download/toggle/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
I'm sorry as I'm very new to this.
tangoboyz said:
I am rooted. Here's what i had in my run.sh:
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/mnt/sdcard/Download/toggle/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
NOW does this look right??
#!/sbin/sh
cp /mnt/sdcard/Download/toggle/sqlite3 /data/local/tmp/sqlite3
chmod +x 0777 /data/local/tmp/sqlite3
mount -o remount,rw /dev/block/mmcblk0p23 /system
cp /system/framework/framework-res.apk /system/framework/framework-res.apk.bak
cp /mnt/sdcard/Download/system/framework/framework-res.apk /system/framework/framework-res.apk
/mnt/sdcard/Download/toggle/sqlite3 /data/data/com.android.providers.settings/databases/settings.db < /mnt/sdcard/Download/toggle/toggles.sql
I'm sorry as I'm very new to this.
Click to expand...
Click to collapse
The original script should work assuming the files are in the right path... when I mentioned make sure you are running as root meant, make sure you run the 'su' command and get the # prompt before you run the script, otherwise the script won't run with root permissions and will fail.
For the third line, you (and the OP) can replace the mount command with:
Code:
mount -o,remount rw /system
----
As an aside, the chmod 0777 part in the original script already does mark the file as executable... chmod works with generic +rwx (read,write,execute) distinctions or the regular numbering permissions (777 means rwx for everyone)
Edit: the last line of the script should start with: /data/local/tmp/sqlite3
because that's the one that you set the permissions to rwx, not the one in your sdcard
vacaloca said:
The original script should work assuming the files are in the right path... when I mentioned make sure you are running as root meant, make sure you run the 'su' command and get the # prompt before you run the script, otherwise the script won't run with root permissions and will fail.
For the third line, you (and the OP) can replace the mount command with:
Code:
mount -o,remount rw /system
----
As an aside, the chmod 0777 part in the original script already does mark the file as executable... chmod works with generic +rwx (read,write,execute) distinctions or the regular numbering permissions (777 means rwx for everyone)
Edit: the last line of the script should start with: /data/local/tmp/sqlite3
because that's the one that you set the permissions to rwx, not the one in your sdcard
Click to expand...
Click to collapse
Hmm still no dice... Something isn't working right. Really I wanted the Hotspot in the pull down menu. I am currently paying for hotspot anyway....
Just found that wanam xposed has an option to skip provisioning check. Anyone tried this yet? Seems to enable native tethering but doesn't give a quick settings button.
dlscott1111 said:
Just found that wanam xposed has an option to skip provisioning check. Anyone tried this yet? Seems to enable native tethering but doesn't give a quick settings button.
Click to expand...
Click to collapse
Yes, we have tried it and it works. The quick settings button, as I have mentioned earlier in this thread, is what the sqlite3 executable and the file commands it takes in (just a simple text file of DB commands) take care of. You could also just get sqlite editor ($3 from the play store, IIRC) and do them manually if you don't like command line tools. it's basically adding "WiFiHotspot" to system -> notification_panel_active_app_list_for_reset and notification_panel_default_active_app_list in the settings.db file in /data/data/com.android.providers.settings/databases/
Or you could just do it the free with the command line sqlite3 using the tools already at your disposal

[SCRIPT] Move clock to the right

I'm not responsible for damage, loss, etc cause by this script. This script lacks of situation and error management. Please read the script and understand what it does. Please backup your /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk
Tested on xiaomi.eu 11.0.4.0. Should work on any miui11, maybe even other devices with notch.
This scripts moves the system clock in the notch-enabled status bar to the right side of the notch. It does this by pulling the apk, decompiling it in tmp folder and recompiling it. I made this because I got annoyed by the fact that there is tons of space on the right side of the notch while there is no space for notification icons on the left side.
SafetyNet should pass. Reboot after execution to ensure root is read-only.
Requirements:
MIUI 11
Magisk v20+
apktool < v2.6.0 (-c option is required)
adb
a decent linux install
The patch.patch file on the same directory of where you run it. If you're dev you can edit this file to make your custom patch.
PS: xda doesn't let me upload sh, the script is script.txt, rename it into script.sh, make it executable and execute it
EDIT: Will bootloop on Android 10 MIUI 11!
Thanks, it's very useful.
But can you please explain how to run the script?
---------- Post added at 11:00 AM ---------- Previous post was at 11:00 AM ----------
Thanks, it's very useful.
But can you please explain how to run the script?
he script is script.txt, rename it into script.sh, make it executable and execute it
DP FH said:
he script is script.txt, rename it into script.sh, make it executable and execute it
Click to expand...
Click to collapse
I'd rename it. but how to execute it? dublle click on the file or how?
yamabokra1 said:
I'd rename it. but how to execute it? dublle click on the file or how?
Click to expand...
Click to collapse
Via terminal
DP FH said:
Via terminal
Click to expand...
Click to collapse
It seems that you don't have time to explain. thanks anyway
yamabokra1 said:
It seems that you don't have time to explain. thanks anyway
Click to expand...
Click to collapse
Mate, if you don't know how to execute scripts from terminal you probably shouldn't mess around with them.
JaSomTy said:
Mate, if you don't know how to execute scripts from terminal you probably shouldn't mess around with them.
Click to expand...
Click to collapse
Please, spend 10 second to tell here if it worked, so we know on which systems it works
DP FH said:
Please, spend 10 second to tell here if it worked, so we know on which systems it works
Click to expand...
Click to collapse
I'm not getting it right.
Can you assist?
https://ibb.co/N7GXpcS
https://ibb.co/XDMZSv9
I run it, but it says apktool not found?
Please check the link for the picture. Do i have the correct APK tool there? I see you said < 2.6.0, but the highest i can find is 2.4.1
Dude... Running Windows binaries from Linux ain't gonna work. Just install everything from apt.
V2.6.0 does not yet exist, I wrote it for the time being
Rooted phone?
Maybe an obvious question, but does the phone need to be rooted to allow that manipulation?
duplicate message lol
josephlegrand33 said:
Maybe an obvious question, but does the phone need to be rooted to allow that manipulation?
Click to expand...
Click to collapse
Requirements: Magisk v20+ so yes. You can unroot after a successful installation, but if the mod goes away (ota update) you need root to reinstall it
Hey, I think I set up everything right, but when I run it I get
Input file (MiuiSystemUI.apk) was not found or was not readable.
Script: modding
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- /tmp/miuis/res/layout/drip_status_bar_contents_container.xml 2020-01-04 20:09:39.224390176 +0100
|+++ /tmp/miuis/res/layout/drip_status_bar_contents_container.new 2020-01-04 20:09:56.504390102 +0100
--------------------------
File to patch:
Am I missing something?
I'm attaching the output
Thx for your work
I also think I did it right, but get "MiuiSystemUI.apk was not found or was not readable".
(Redmi Note 8 Pro, MIUI Global 11.0.3)
I've also tried to move that stupid clock with Substratum, but overlays seem not affecting system stuff in statusbar and, sadly, CustoMIUIzer doesn't include this setting.
Hi, sorry if I didn't read it straight away. That means MiuiSystemUI.apk couldn't be read. Do you have correct permissions to write files in /tmp?
Try to execute the commands in the script manually. for example, adb pull /system/priv-app/MiuiSystemUI/MiuiSystemUI.apk /tmp/
Can you manage to read the file? Do you see it in /tmp?
If it is, apktool d -p /tmp -o /tmp/miuis/ -s MiuiSystemUI.apk
should work right away
Tancredus said:
I'm attaching the output
Click to expand...
Click to collapse
I've read the log, the apktool decompilation gets straight away skipped for some reason. I'm using 2.4.1 as well.
What happens when you run apktool d -p /tmp -o /tmp/miuis/ -s MiuiSystemUI.apk
manually?
Oh right! My fault. replace
apktool d -p /tmp -o /tmp/miuis/ -s MiuiSystemUI.apk
with
apktool d -p /tmp -o /tmp/miuis/ -s /tmp/MiuiSystemUI.apk
And try again.
Also, don't try using it on android 10. will bootloop.
Do you know why it will bootlop in android 10 miui 11?
Because it's only a change on one line of xml... Maybe it's a invalid positioning, let me see it...

Categories

Resources