First of all give thanx to the below post for their awesome work and then download those files.....
to make the kermel compitable for OTG Kernel Modules for Xperia 2011 ICS v4.1.B.0.587
to load the kernel on boot [APP][2.2+] Module Loader 1.1
Now here we go to Mount Externel USB Storage on Settings as in the below pic....
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
if anything goes wrong don't blame me.......
I tested it on my LWW and the above pictures were taken on my phone.....
to do this we need...
1. apktool
2. notepad++
3. framework-res.apk
4. vold.fstab
1st,
open vold.fstab from \system\etc\ by root explorer and add the below line
Code:
dev_mount usbdisk /mnt/usbdisk auto /devices/platform/msm_hsusb_host.0
2nd,
Decompile your framework-res.apk by apktool
open public.xml with notepad++ from \res\values
add this line
Code:
<public type="string" name="storage_usb" id="0x010404cd" />
open strings.xml with notepad++ from \res\values
add this line
Code:
<string name="storage_usb">External USB storage</string>
open storage_list.xml with notepad++ from \res\xml
add red colored line
Code:
<?xml version="1.0" encoding="utf-8"?>
<StorageList
xmlns:android="http://schemas.android.com/apk/res/android">
<storage android:mountPoint="/mnt/sdcard" android:storageDescription="@string/storage_sd_card" android:primary="true" android:removable="true" android:allowMassStorage="true" />
[COLOR="Red"]<storage android:mountPoint="/mnt/usbdisk" android:storageDescription="@string/storage_usb" android:primary="false" android:removable="true" />[/COLOR]
</StorageList>
Recompile framework-res.apk and flash through CWM on your phone.
Click to expand...
Click to collapse
3rd,
we need to create directory for that using notepad++ add these lines
Code:
#Create usbdisk
#!/system/bin/sh
mount -o remount,rw rootfs 2>/dev/null
mkdir /mnt/usbdisk
or download the create usbdisk.zip extract it on your sdcard
Run it through script manager, checking su and boot
Now open your settings go to storage and enjoy...
I have attached some flashable.zip now here you guys can skip 1st & 3rd steps, only need to edit your runing framwork-res.apk
sorry for my bad presentation :crying:
special thanks to
zxp for his Kernel Modules
D4rKn3sSyS for his Module Loader
ICS 4.0.4 Build No. 4.1.B.0.587
Before going to proceed first make backup...
without using any app to get this settings in one step i have made a flashable.zip. but to get this work
you need.....
init.d enabled ( grab this from here ) for loading the kernel module and make the usbdisk directory on boot......
if you have init.d installed, skip this step
it is for Deodex ROM. If your ROM is Odex then flash Deodex587_By PranavPandey.zip via CWM...
If already Deodexed then, skip this step...
flash the Externel_USB_Storage_Settings_by_mOeenuR.zip file through CWM....
wipe dalvic cache.....
reboot...
Click to expand...
Click to collapse
note: if you guys get bootloop then you need to edit your framework-res.apk as i mentioned in the 1st post or restore your backup.
Download Link
Externel_USB_Storage_Settings_by_mOeenuR.zip - 10.94 MB
Special thanks to
puppet13th for his init.d.loader
Pranav Pandey for his ROM Deodexer
F. A. Q.
# Why does Storage in settings show force close ?
ans: first open vold.fstab from \system\etc\ by root explorer, check whether the below line is added
Code:
dev_mount usbdisk [B][COLOR="Red"]/mnt/usbdisk[/COLOR][/B] auto /devices/platform/msm_hsusb_host.0
if so then go to the above red marked directory, check usbdisk has created if not created then your init.d is not working if you use my flashable.zip then grab it from my 2nd post.
if still force close then you need to check your framework-res.apk's storage_list.xml
Code:
<storage android:mountPoint="[B][COLOR="red"]/mnt/usbdisk[/COLOR][/B]" android:storageDescription="@string/storage_usb" android:primary="false" android:removable="true" />
# Why does face bootloop?
ans: It will only happen if you flash by wrong framework-res.apk so edit your running framework-res.apk and flash.
# Why OTG is not working?
ans: download Android Terminal Emulator, type lsmod check your kernel module is running if not then use this [APP][2.2+] Module Loader 1.1
if you guys install it on your phone then give a feedback to inform the others whether it works or not for other xperia 2011 devices
very complex process thanks :good:
simple operation :silly: Worked USB OTG helper My LWW mount & unmount USB Disk
https://play.google.com/store/apps/details?id=net.shajul.usbotg&hl=tr
i know that there are many apps to mount usb storage but they dont appear on settings, so i did it. thats all....
i had already posted it here
using apps kernel module can be run from sdcard which save the internel phone memory too...
moeenur said:
ICS 4.0.4 Build No. 4.1.B.0.587
Before going to proceed first make backup...
to get this settings in one step i have made a flashable.zip. but to get this work
you need.....
init.d enabled ( grab this from here ) for loading the kernel module and make the usbdisk directory on boot......
if you have init.d installed, skip this step
it is for Deodex ROM. If your ROM is Odex then flash Deodex587_By PranavPandey.zip via CWM...
If already Deodexed then, skip this step...
note: if you guys get bootloop then you need to edit your framework-res.apk as i mentioned in the 1st post or restore your backup.
Download Link
Externel_USB_Storage_Settings_by_mOeenuR.zip - 10.94 MB
Special thanks to
puppet13th for his init.d.loader
Pranav Pandey for his ROM Deodexer
Click to expand...
Click to collapse
hey buddy
thanks for your GUIDE
i do all the steps properly
but when i tap Storage in my settings it shows force close.
i dont want to use settings.apk you uploaded
please show me how to mod my settings to add usb storage
note : i know how to mod APKs and settings.apk :good:
logcat shows these lines :
13:49:49.490 Error 1956 statfs /mnt/usbdisk failed, errno: 2
13:49:49.602 Warning dalvikvm 1956 threadid=15: thread exiting with uncaught exception (group=0x2b542210)
13:49:49.602 Error AndroidRuntime 1956 FATAL EXCEPTION: MemoryMeasurement
13:49:49.602 Error AndroidRuntime 1956 java.lang.IllegalArgumentException
13:49:49.602 Error AndroidRuntime 1956 at android.os.StatFs.native_setup(Native Method)
13:49:49.602 Error AndroidRuntime 1956 at android.os.StatFs.<init>(StatFs.java:32)
13:49:49.602 Error AndroidRuntime 1956 at com.android.settings.deviceinfo.StorageMeasurement$MeasurementHandler.measureApproximateStorage(StorageMeasurement.java:377)
13:49:49.603 Error AndroidRuntime 1956 at android.os.Handler.dispatchMessage(Handler.java:99)
13:49:49.602 Error AndroidRuntime 1956 at com.android.settings.deviceinfo.StorageMeasurement$MeasurementHandler.handleMessage(StorageMeasurement.java:267)
13:49:49.603 Error AndroidRuntime 1956 at android.os.Looper.loop(Looper.java:137)
13:49:49.603 Error AndroidRuntime 1956 at android.os.HandlerThread.run(HandlerThread.java:60)
13:49:49.603 Warning ActivityManager 1036 Force finishing activity com.android.settings/.SubSettings
13:49:49.603 Warning ActivityManager 1036 Force finishing activity com.android.settings/.Settings
Click to expand...
Click to collapse
don't need to edit settings.apk
Please check whether usbdisk folder has created under mnt folder?
or
dev_mount usbdisk line has been added in vold.fstab?
or
open terminal emulator type lsmod it will show you which kernels are running?
Fc is given ! for one of the above is missing....
moeenur said:
don't need to edit settings.apk
Please check whether usbdisk folder has created under mnt folder?
or
dev_mount usbdisk line has been added in vold.fstab?
or
open terminal emulator type lsmod it will show you which kernels are running?
Fc is given ! for one of the above is missing....
Click to expand...
Click to collapse
there is usbdisk folder in mnt folder
usb modules are live
maybe i had mistake when adding that line to vold.fstab
---------- Post added at 02:11 PM ---------- Previous post was at 02:05 PM ----------
no luck
i check all thing you said
but still force close.
is there any links to kernel?
i using lupusv6
it natively support usb otg
yamin8000 said:
there is usbdisk folder in mnt folder
usb modules are live
maybe i had mistake when adding that line to vold.fstab
---------- Post added at 02:11 PM ---------- Previous post was at 02:05 PM ----------
no luck
i check all thing you said
but still force close.
is there any links to kernel?
i using lupusv6
it natively support usb otg
Click to expand...
Click to collapse
EDIT your framework-res.apk as I mentioned in my 1st post...
keep in mind...
mount point "mnt/usbdisk" of storage.xml and dev_mount "mnt/usbdisk" of vold.fstab should be same..
it will fix your fc...
remove the kernel which i attached with the zip file...
Related
I have CM7 installed... I know there are settings for screen timeout under display, and CM7 settings allow you to specify the delay for the screen to actually lock. But what about when the screen is locked, you turn it on to check the time and it shuts off after 5 secs. Can this be changed?
Edit: Here's a list of important posts so people don't have to read the entire thread...
Background Info
Step-by-step guide for windows
Allow .jar files to be seen in APK Manager
How-to deODEX android.policy.jar for ODEXed ROMs
How-to for linux/mac(will make a better guide once I finish porting the APK Manager tool from Windows)
Old Stuff:There's not a setting to change the lock screen timeout but I got to looking around and think I found where it can be changed. The stuff I found pointed to android.policy.jar which is located in /system/framework so I adb pulled it and then decoded it using apktool. Some smali files contain hex values of 0x1388 equals 5000 in decimal where 5000ms = 5s. So one of those should be what we want to change. I'm going to try figuring out which one to change, set it to 10s = 10000ms = 0x2710. If it works for me, I can describe how to do it yourself in better detail and/or post a modified android.policy.jar with the timeout you would like.
Edit: I started a thread about this in the Eris dev forum and removed the attached files from here. PM me or post in one of these two threads if you have questions or would like me to modify and send you a custom android.policy.jar
http://forum.xda-developers.com/showthread.php?t=1079844
I successfully increased the default 5s timeout when you wake the phone but don't unlock. If you want to test it out, download one of the attached zip files corresponding to the timeout you would like to have(10s or 30s). Extract android.policy.jar from the zip file and follow either the ADB or Root Explorer or Terminal Emulator instructions below.
If using ADB:
Code:
adb remount
adb shell
cd /system/framework
mv android.policy.jar android.policy.jar.bak
exit
adb push android.policy.jar /system/framework
adb shell
cd /system/framework
chown 0:0 android.policy.jar
chmod 644 android.policy.jar
#reboot to recovery#
#wipe both cache and dalvik-cache#
#reboot#
If using Root Explorer on phone:
mount system as r/w
rename original android.policy.jar in /system/framework to android.policy.jar.bak
move modified android.policy.jar to /system/framework
change owner: owner = 0 - root & group = 0 - root
change permissions: rw-r--r--
#reboot to recovery#
#wipe both cache and dalvik-cache#
#reboot#
Click to expand...
Click to collapse
If using Terminal Emulator on phone:
Code:
mount -o remount,rw /dev/block/mtdblock3 /system
mv /system/framework/android.policy.jar /system/framework/android.policy.jar.bak
mv /PATH/TO/NEW/android.policy.jar /system/framework
cd /system/framework
chown 0:0 android.policy.jar
chmod 644 android.policy.jar
#reboot to recovery#
#wipe both cache and dalvik-cache#
#reboot#
Later tonight or tomorrow I will post a how-to so anyone can make the necessary modifications themselves. That should allow for other devices/ROMs to modify theirs as well since it will be customized to their phone.
I've only tested this on my Eris running GSB v3.1 - Gingerbread 2.3.4 - CM 7.1.0 RC0. Be sure to make a NAND backup and a backup of android.policy.jar as I can't guarantee this will work for you. If you have problems or just want to switch back to the original 5s timeout, replace the modified android.policy.jar with the android.policy.jar backup, wipe cache & dalvik-cache, and reboot or restore from the NAND backup you created.
I'm really surprised no one has brought this idea up before..well glad I had a chance to give you something to dig into and explore some more. I haven't done any editing to system files like this before so I might be posting back with some questions. Thanks for the info..I'll let you know how it goes!
When I plug my phone in it doesnt seem to be going into debugging mode. I have that option checked for it to enable when USB is plugged in but the only icon showing is the USB icon.
I say this because when I run adb devices its not listing my device..also running adb shell it says error: device not found
I havent tried running the adb shell since I flashed to CM7..is there something I need to do differently with this ROM?
thetornado said:
When I plug my phone in it doesnt seem to be going into debugging mode. I have that option checked for it to enable when USB is plugged in but the only icon showing is the USB icon.
I say this because when I run adb devices its not listing my device..also running adb shell it says error: device not found
I havent tried running the adb shell since I flashed to CM7..is there something I need to do differently with this ROM?
Click to expand...
Click to collapse
The debugging notification will only show up if the option for "USB debugging notify" is also checked in Settings->Applications->Development. Not sure why it wouldn't be able to find your phone especially since it sounds like you had it working fine before. What version of adb do you have? I'm using v1.0.26 and never had any problem. You can check the version with the command "adb version". You could also try using adbWireless which would allow you to not have it hooked to your computer with the USB cable.
Scratch that last post..I got it working in ADB Shell
I downloaded the APK tool and moved the files to C:\Windows
Ran this successful: adb pull /system/framework/android.policy.jar
Problem with: apktool d android.policy.jar out - error saying it couldn't find apktool. I went to restart my phone to see if that was an issue and now its hung on the white android screen and wont boot up
Thoughts?
You didn't actually modify anything on the phone right? And didn't push anything to it either? If not, nothing would have changed and it shouldn't be having a problem booting. Try "adb reboot recovery", wipe cache & dalvik-cache then reboot. If you can't run adb commands...pull the battery, put it back in, power it on and hold volume up + power to get into recovery. If something was modified, use adb to revert the modded files back to the originals or restore with a NAND backup if you made one.
Edit: As for apktool not being found, it sounds like apktool is not in your PATH. The Windows folder should be part of your PATH by default. You could check your PATH variable by following these instructions and modify it if needed or you try moving the unpacked apktool files to the same location as the adb command which is most likely /PATH/TO/ANDROID_SDK/platform-tools OR /PATH/TO/ANDROID_SDK/tools
Sorry for the delay..got back to trying this mod. I got an error..
C:\Users\ME\apktool d android.policy.jar out
Unable to access jarfile C:\Windows\\apktool.jar
Did I put these 3 files in the wrong location?
I just saw your comment about putting these files into where adb.exe is located. I moved these files there..also checked my path and its set up for:
Variable: path
Value: C:\android-sdk\platform-tools
The error I got now is: Unable to access jarfile C:\android-sdk\platform-tools\\apktool.jar
I'm not all that familiar with how Windows handles things but something it should be able to find apktool.jar if it's the same directory as apktool.bat. What is the contents of apktool.bat? A workaround would be manually doing the .bat file's job and run "apktool" using this command instead:
Code:
"java -jar /LOCATION/OF/apktool.jar"
Typing that in a cmd window should give you the usage output for apktool. If that works, you could then use that format to decode and build apk/jar files.
I have everything in the folder: C:\android-sdk\platform-tools
Contents of 'apktool.bat':
@echo off
java -jar "%~dp0\apktool.jar" %1 %2 %3 %4 %5 %6 %7 %8 %9
I am getting this error:
C:\Users\ME>java -jar C:\android-sdk\platform-tools\apktool.jar
Unable to access jarfile C:\android-sdk\platform-tools\apktool.jar
Ok...two more things to try.
Add the location of the java commands to the PATH variable. Probably somewhere like C:\jdk1.6.0_##\bin OR C:\Program Files\Java\jdk1.6.0_##\bin. The PATH variable as a whole would now be something like this: C:\LOCATION\OF\jdk1.6.0_##\bin;C:\WINDOWS\system32;C:\WINDOWS
If that doesn't help: change directory(cd) to C:\android-sdk\platform-tools in the cmd prompt, then run "java -jar apktool.jar"
Sorry it's being such a PITA to just get apktool to run.
1. The location of my Java program is: C:\Program Files\Java - There are 3 folders in there: jdk1.6.0_25, jre1.6.0_22, jre6 - I currently have a user variable 'path' with the value 'C:\android-sdk\platform-tools' - should it be added after this? ..if so, could you explain from what I gave about java what I need to add?
2. Tried cd - same thing..Unable to access jarfile
What does the following command give as output?
Code:
echo %PATH%
I'd set your system environment variable PATH like so:
right-click my computer -> properties -> advanced system settings -> Environment Variables...
under system variables, select Path, and Edit...
add the following(without the quotes) to the end of what's already there: ";C:\Program Files\Java\jdk1.6.0_25\bin;C:\android-sdk\platform-tools;C:\android-sdk\tools"
Also, since you are running Windows...it might make things easier on you to use APK Manager. Here's the thread for it: http://forum.xda-developers.com/showthread.php?t=695701
Here is what I have from the echo %PATH%
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I installed the APK manager..I have it up and running. So I pulled the 'android.policy.jar' - Now what do I do to edit this file?
With all the storms, a power outage, and being busy I'm just now able to get back to you. I'm going to try going through the process using APK Manager on a Windows desktop I have access to. Step-by-step instructions will be in the post below.
Step-by-Step for Windows
You will need the java jdk installed and ADB set up for this to work.
download APK Manager and extract it to you preferred location
this guide will use C:\apk_manager_4.9
run C:\apk_manager_4.9\Script.bat
select option 0 to adb pull
where = /system/framework/android.policy.jar
stored name = android.policy.jar
current project = y
select option 9 to decompile
minimize Script.bat window
use Notepad++(or your preferred editor) to open:
Code:
C:\apk_manager_4.9\projects\android.policy.jar\smali\com\android\internal\policy\KeyguardViewMediator.smali
find ".method public pokeWakelock()V" NOT ".method public pokeWakelock(I)V"
inside the method, find the two lines starting with "const/16 v#" followed by a hex value(0x####)
the second(0x1388=5000ms=5s) is the default timeout unless a hardware keyboard is open, in which case the first(0x2710=10000ms=10s) is used
the values are 16-bit signed integers so the highest either can be set is 0x7FFF=32767ms=32.767s (Your screen will not wake up if set higher)
use this dec->hex convertor to determine the hex equivalent of your desired ms timeout
modify the hex values to your liking, save the file, and close Notepad++
return to the Script.bat window
select option 11 to compile
system apk = y
additional files = n
select option 8 to adb push
where&name = /system/framework/android.policy.jar
select option 24 to quit
open a command prompt to run these commands:
Code:
adb shell chmod 644 /system/framework/android.policy.jar
adb reboot recovery
in recovery,wipe dalvik-cache & cache, then reboot
Done!
All GOOD! Thanks for your hard work on figuring all this out for windows..it really wasn't hard at all once I had the right set of instructions haha
The only thing I've noticed is that the "screen off animation" does not work now - I have checked and unchecked it and its still not working..its really no biggie but just thought I'd say in case you want to play around with this mod more.
thetornado said:
All GOOD! Thanks for your hard work on figuring all this out for windows..it really wasn't hard at all once I had the right set of instructions haha
The only thing I've noticed is that the "screen off animation" does not work now - I have checked and unchecked it and its still not working..its really no biggie but just thought I'd say in case you want to play around with this mod more.
Click to expand...
Click to collapse
I'm glad we finally got it figured out for you. I have the screen animation turned off on my Eris so I didn't notice this broke it. I'll look into it and see if I can figure anything out. The first thing that comes to mind is that the screen off animation could somehow be dependent on the AWAKE_INTERVAL_DEFAULT_MS variable. As I found when first looking at this mod, changing the variable won't actually affect the value wherever it is used since the package is already compiled. So if the animation does use that variable in some way, we'll need to find where that happens and change the value there.
Hi at all.. well i'm new in the forum but not a noob in the topic..!! This is my problem..!! I'm trying to install the latest version of the Kitchen posted in this same Categorie/Forum..!! Well all is correct until i run de cygwin.. looks the log..:
Code:
[email protected] ~
$ cd kitchen
[email protected] ~/kitchen
$ ./menu
./menu: line 46: chmod: command not found
scripts/check_install_dir: line 13: grep: command not found
scripts/init_kitchen: line 12: chmod: command not found
scripts/init_kitchen: line 13: chmod: command not found
scripts/init_kitchen: line 14: chmod: command not found
scripts/init_kitchen: line 15: chmod: command not found
scripts/init_kitchen: line 16: chmod: command not found
scripts/init_kitchen: line 17: chmod: command not found
scripts/init_kitchen: line 18: chmod: command not found
scripts/init_kitchen: line 19: rm: command not found
scripts/init_kitchen: line 20: rm: command not found
scripts/init_kitchen: line 21: rm: command not found
scripts/init_kitchen: line 22: rm: command not found
scripts/init_kitchen: line 23: rm: command not found
scripts/check_binaries: line 22: clear: command not found
Welcome to dsixda's Android Kitchen
Please wait .
Error: The application 'clear' is not installed - the kitchen
will not function properly without it. Ensure you did
not miss a step during installation! Refer to the
Android Kitchen FAQ at xda-developers.com for further
assistance.
[email protected] ~/kitchen
$
I'm not sure of what happend.. well at the first time that i run the cygwin it said an error with Java application not found..!! well i fixed it adding to the end of the .bash_profile file this line:
Code:
PATH=/cygdrive/c/Program\ Files/Java/jdk1.6.0_29/bin:\${PATH}
After that modification of the .bash_profile the Java error was solved..!! so now when i run again the ./menu it show that errors mentioned up..!!
So how can i fix it for work with the kitchen as soon as posible..!!??
Well i'm from colombia.. so my native language is spanish.. i'm learning english but it isn't perfect.. is good no more..!! So excuse me for mi wrongs with my words and if in any part the incoherence is too big tell me for re-tell you the correct form for you can understand me..!!
Thanks..!!
please can somebody help i have the same problem
You both didn't set up cygwin right. Go back and reread op of the kitchen. The tools are not in your path.
Sent from my Nexus S 4G using xda premium
i installed it in the right way:
After three attempts it still doesnt work so i deleted java jdk and cygwin and the kitchen. Then i have reinstalled java jdk (version 6.31, i allsow ttried with versions 6.20 and 6.21). After that i unzipped the cygwin package and started the setup exe, then i choosed "Install from local directory" then i choosed the root folder C:\Cygwin\. After that i choosed from where Cygwin should installed (the cygwin_package folder). So then setup choose me which packages should installed and i clicked on the arrow until to All Packages Install All (or something like that). Then it installed and finished. After that i copied the kitchen to C:\Cygwin\home\XXX\kitchen .
And when i start cygwin and type in cd kitchen i get always the error application clear is not installed.
I tried even Install All Default and Reinstall. But it shows always this fu***** error
solution
jojogangsta said:
i installed it in the right way:
After three attempts it still doesnt work so i deleted java jdk and cygwin and the kitchen. Then i have reinstalled java jdk (version 6.31, i allsow ttried with versions 6.20 and 6.21). After that i unzipped the cygwin package and started the setup exe, then i choosed "Install from local directory" then i choosed the root folder C:\Cygwin\. After that i choosed from where Cygwin should installed (the cygwin_package folder). So then setup choose me which packages should installed and i clicked on the arrow until to All Packages Install All (or something like that). Then it installed and finished. After that i copied the kitchen to C:\Cygwin\home\XXX\kitchen .
And when i start cygwin and type in cd kitchen i get always the error application clear is not installed.
I tried even Install All Default and Reinstall. But it shows always this fu***** error
Click to expand...
Click to collapse
hey
when there is a window for selection. Click on the icon next to package,it turn to install icon,do this to all and then try.
i did by this method.
You could always just get Linux too. that is the easiest possible fix!
solved this problem
initially i faced the same problem. Then while a window of cygwin asks what to install on top of the option bar there is a option with default. click on it until install appears. if still problem persists mail me and i will send you the link.
Gioyik said:
Hi at all.. well i'm new in the forum but not a noob in the topic..!! This is my problem..!! I'm trying to install the latest version of the Kitchen posted in this same Categorie/Forum..!! Well all is correct until i run de cygwin.. looks the log..:
Code:
[email protected] ~
$ cd kitchen
[email protected] ~/kitchen
$ ./menu
./menu: line 46: chmod: command not found
scripts/check_install_dir: line 13: grep: command not found
scripts/init_kitchen: line 12: chmod: command not found
scripts/init_kitchen: line 13: chmod: command not found
scripts/init_kitchen: line 14: chmod: command not found
scripts/init_kitchen: line 15: chmod: command not found
scripts/init_kitchen: line 16: chmod: command not found
scripts/init_kitchen: line 17: chmod: command not found
scripts/init_kitchen: line 18: chmod: command not found
scripts/init_kitchen: line 19: rm: command not found
scripts/init_kitchen: line 20: rm: command not found
scripts/init_kitchen: line 21: rm: command not found
scripts/init_kitchen: line 22: rm: command not found
scripts/init_kitchen: line 23: rm: command not found
scripts/check_binaries: line 22: clear: command not found
Welcome to dsixda's Android Kitchen
Please wait .
Error: The application 'clear' is not installed - the kitchen
will not function properly without it. Ensure you did
not miss a step during installation! Refer to the
Android Kitchen FAQ at xda-developers.com for further
assistance.
[email protected] ~/kitchen
$
I'm not sure of what happend.. well at the first time that i run the cygwin it said an error with Java application not found..!! well i fixed it adding to the end of the .bash_profile file this line:
Code:
PATH=/cygdrive/c/Program\ Files/Java/jdk1.6.0_29/bin:\${PATH}
After that modification of the .bash_profile the Java error was solved..!! so now when i run again the ./menu it show that errors mentioned up..!!
So how can i fix it for work with the kitchen as soon as posible..!!??
Well i'm from colombia.. so my native language is spanish.. i'm learning english but it isn't perfect.. is good no more..!! So excuse me for mi wrongs with my words and if in any part the incoherence is too big tell me for re-tell you the correct form for you can understand me..!!
Thanks..!!
Click to expand...
Click to collapse
Hey found a solution to ur problem jus follow the given steps
go to your jdk folder n open the bin folder (C:\Program Files\Java\jdk1.7.0_25\bin)
and find the java.exe application n put it in C:\cygwin\bin
dont edit the .bash_profile file
All the best :fingers-crossed::good:
hit like if i helped :good:
it caused by Java 7 versions, maybe cygwin cannot find their path.
revert the changes that you did it for bash_profiles.
then just copy java.exe into cygwin/bin folder.
how to test if works or not?
just run cygwin and type:
Code:
java -version
the result must be like this:
Code:
$ java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)
to check if other commands are working:
type:
Code:
chmod +x -R *
if works, then your package is ready to use.
Best regards.
how to fix
scripts/check_binaries: line 22: clear: command not found
Welcome to dsixda's Android Kitchen
Please wait .
Error: The application 'clear' is not installed - the kitchen
will not function properly without it. Ensure you did
not miss a step during installation! Refer to the
Android Kitchen FAQ at xda-developers.com for further
assistance.
** PLEASE READ THE FAQ BEFORE ASKING QUESTIONS!! **
YES, THIS ERROR IS ALREADY COVERED IN THE FAQ. DO NOT
WASTE YOUR TIME MESSAGING ME. JUST READ IT, PLEASE.
on this message the application of "clear" is not found
thanks
Thanks worked for me ...
yanyanruhyana said:
scripts/check_binaries: line 22: clear: command not found
Welcome to dsixda's Android Kitchen
Please wait .
Error: The application 'clear' is not installed - the kitchen
will not function properly without it. Ensure you did
not miss a step during installation! Refer to the
Android Kitchen FAQ at xda-developers.com for further
assistance.
** PLEASE READ THE FAQ BEFORE ASKING QUESTIONS!! **
YES, THIS ERROR IS ALREADY COVERED IN THE FAQ. DO NOT
WASTE YOUR TIME MESSAGING ME. JUST READ IT, PLEASE.
on this message the application of "clear" is not found
Click to expand...
Click to collapse
I have same problem, I don't understand what to do
Try "sudo apt-get install clear" from a command line.
remember, remember.......
vawa.id said:
I have same problem, I don't understand what to do
Click to expand...
Click to collapse
djmatt604 said:
Try "sudo apt-get install clear" from a command line.
remember, remember.......
Click to expand...
Click to collapse
no?no!no! them error only for Windows
thanks it help me
:good:
CLINTZ9 said:
Hey found a solution to ur problem jus follow the given steps
go to your jdk folder n open the bin folder (C:\Program Files\Java\jdk1.7.0_25\bin)
and find the java.exe application n put it in C:\cygwin\bin
dont edit the .bash_profile file
All the best :fingers-crossed::good:
hit like if i helped :good:
Click to expand...
Click to collapse
:good:
I'm sorry but I did not get everything done as it is written, and all the same error.
I can not use the kitchen. When I enter in cygwin (. /menu) Is an error
Welcome to dsixda's Android Kitchen
Please wait .
Error: The application 'clear' is not installed - the kitchen
will not function properly without it. Ensure you did
not miss a step during installation! Refer to the
Android Kitchen FAQ at xda-developers.com for further
assistance.
I do not understand what to do = (
CLINTZ9 said:
Hey found a solution to ur problem jus follow the given steps
go to your jdk folder n open the bin folder (C:\Program Files\Java\jdk1.7.0_25\bin)
and find the java.exe application n put it in C:\cygwin\bin
dont edit the .bash_profile file
All the best :fingers-crossed::good:
hit like if i helped :good:
Click to expand...
Click to collapse
:good:
Still same
Hi,
Tried all steps provided like your suggested post still the same error
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
:
scripts/check_binaries: line 22: clear: command not found
Welcome to dsixda's Android Kitchen
Please wait .
Error: The application 'clear' is not installed - the kitchen
will not function properly without it.
Please Help Thanks again
SATHYA0403 said:
Hi,
Tried all steps provided like your suggested post still the same error
:
scripts/check_binaries: line 22: clear: command not found
Welcome to dsixda's Android Kitchen
Please wait .
Error: The application 'clear' is not installed - the kitchen
will not function properly without it.
Please Help Thanks again
Click to expand...
Click to collapse
Not sure if you still need help with this. I resolved my issue by confirming that I had 32 bit Java installed on a 64 bit system. The answer was to install 64 bit Java and then update the path variable in Windows. Then there are also several modules in the CYGWIN setup called NCURSES. Launch the setup and when presented with the file listing to be installed search for NCURSES and then install all relating modules.
Hope this helps!
Awesome sauce
Worked for me!!:good:
Things you will need:
- Java SDK -> Download from HERE
- baksmali-1.3.2.jar and smali-1.3.2.jar-> Download from HERE
- Notepad++-> Download from HERE
Step One:
-> Create a folder named "project" on your desktop and put the "baksmali-1.3.2.jar" and "smali-1.3.2.jar" inside;
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Step Two:
-> Copy your ROM to "Project" folder and open it and extract the file "services.jar" from "system/framework";
Step Three:
-> Extract "classes.dex" from "services.jar" (using winrar) to "Project" folder;
Step Four:
-> Decompile "classes.dex" using baksmali.jar
- Open cmd with administrator rights
- Go to "Project" folder (cd "C:/Users/[your username account]/Desktop/Project/")
- Decompile the file entering this on cmd-> java -jar baksmali-1.3.2.jar classes.dex
- A folder named "out" should now be created
- Go to "out\com\android\server" and open "NotificationManagerService" with notepad++
- Add a # at the beggining of the following lines:
line 1933
before:
if-nez v4, :cond_18
Click to expand...
Click to collapse
after:
#if-nez v4, :cond_18
Click to expand...
Click to collapse
line 1983
before:
if-nez v4, :cond_3d
Click to expand...
Click to collapse
after:
#if-nez v4, :cond_3d
Click to expand...
Click to collapse
save the file and close notepad++;
Step Five:
-> Re-compile classes.dex
- Open cmd as administrator rights
- Go to "Project" folder (cd "C:/Users/[your username account]/Desktop/Project/")
- Re-compile the file entering this on cmd-> java -jar smali-1.3.2.jar -o "C:/Users/[your username account]/Desktop/Project/classes_edited.dex" "C:/Users/[your username account]/Desktop/Project/out"
- A file named "classes_edited.dex" should now be created on "Project" folder;
Step Six:
- Delete "classes.dex" (the old one) and change the name of the new one from "classes_edited.dex" to "classes.dex" and delete the "out" folder
- Open "services.jar" (with winrar) and put the "classes.dex" file at root (it will overwritte automatically). You can delete the "classes.dex" file from "Project" folder.
- Open your rom and copy the "services.jar" file to "system/framework" (it will overwritte automatically). You can delete the "services.jar" file from "Project" folder.
Now just flash the rom via cwm and enjoy BLN for sms!
Issues:
If you are expecting issues in cmd when entering-> java (bla bla bla) you have to do this:
Open the start menu, right click on Computer, and click properties. On the lefthand bar, the bottom option should say "Advanced System Settings". Click this, then click Environment Variables.
Find the variable in the BOTTOM box, that says Path, or PATH. Click on this, and click edit. Now, find the path of your JDK, and find the folder called "bin", usually something like
C:\Program Files\Java\jdk1.5.0_11\bin
Click to expand...
Click to collapse
Thx to Prawesome for helping me!
Nice work darknight_jao.A few suggestions for the guide You could add this to the guide in case the guy who is decompiling classes.dex wants to change it around a bit.
Rename baksmali-1.3.2.jar to baksmali and smali-1.3.2.jar to smali for ease of typing Also,to define the name of the output folder,the codes should be changed to:
Code:
java -jar baksmali.jar -o <out name>
To define Java heap size to 512M
Code:
java -jar -Xmx512 baksmali.jar -o out
For viewing command list
Code:
java -jar baksmali.jar
The same goes for smali.jar too
thx man!
darknight_joao said:
thx man!
Click to expand...
Click to collapse
Not a problem
Awesome!
darknight_joao said:
Things you will need:
- Java SDK -> Download from HERE
- baksmali-1.3.2.jar and smali-1.3.2.jar-> Download from HERE
- Notepad++-> Download from HERE
Step One:
-> Create a folder named "project" on your desktop and put the "baksmali-1.3.2.jar" and "smali-1.3.2.jar" inside;
Step Two:
-> Copy your ROM to "Project" folder and open it and extract the file "services.jar" from "system/framework";
Step Three:
-> Extract "classes.dex" from "services.jar" (using winrar) to "Project" folder;
Step Four:
-> Decompile "classes.dex" using baksmali.jar
- Open cmd with administrator rights
- Go to "Project" folder (cd "C:/Users/[your username account]/Desktop/Project/")
- Decompile the file entering this on cmd-> java -jar baksmali-1.3.2.jar classes.dex
- A folder named "out" should now be created
- Go to "out\com\android\server" and open "NotificationManagerService" with notepad++
- Add a # at the beggining of the following lines:
line 1933
before:
after:
line 1983
before:
after:
save the file and close notepad++;
Step Five:
-> Re-compile classes.dex
- Open cmd as administrator rights
- Go to "Project" folder (cd "C:/Users/[your username account]/Desktop/Project/")
- Re-compile the file entering this on cmd-> java -jar smali-1.3.2.jar -o "C:/Users/[your username account]/Desktop/Project/classes_edited.dex" "C:/Users/[your username account]/Desktop/Project/out"
- A file named "classes_edited.dex" should now be created on "Project" folder;
Step Six:
- Delete "classes.dex" (the old one) and change the name of the new one from "classes_edited.dex" to "classes.dex" and delete the "out" folder
- Open "services.jar" (with winrar) and put the "classes.dex" file at root (it will overwritte automatically). You can delete the "classes.dex" file from "Project" folder.
- Open your rom and copy the "services.jar" file to "system/framework" (it will overwritte automatically). You can delete the "services.jar" file from "Project" folder.
Now just flash the rom via cwm and enjoy BLN for sms!
Issues:
If you are expecting issues in cmd when entering-> java (bla bla bla) you have to do this:
Thx to Prawesome for helping me!
Click to expand...
Click to collapse
Thankyou brother
no problem
im glad i could help!
after replacing services.jar, we delete dalvik-cache and data/data, services.jar only files old, for regeneration new
Hi,
I got CM 11 running on my devices (Nexus Q) and want to add some system apk from the stock factory images and need some help. I mounted the factory image and copied TungstenLEDService.apk from /system/app to my computer and tried to install it over adb. This is what I have done so far.
Code:
adb install TungstenLEDService.apk
but it fails with INSTALL_FAILED_SHARED_USER_INCOMPATIBLE error. Ok fine, its a system apk, so I did the following.
I enabled root over adb on developer settings on the device and from the terminal I did
Code:
adb push TungstenLEDService.apk /sdcard/
adb shell
su
mount -o rw,remount -t ext4 /system
cp /sdcard/TungstenLEDService.apk /system/app/
And then I set the permission with Solid Explorer filemanager to -rw-r--r-- on TungstenLEDService.apk and rebooted. From logcat I got this error
Code:
Package com.google.tungsten.ledservice has no signatures that match those in shared user android.uid.system; ignoring!
What to do next? Do I need to resign the apk? How do I do that? I have not modified the apk in any way and the CM 11 build is from this xda thread: http://forum.xda-developers.com/showthread.php?t=2596910
mannberg said:
Hi,
I got CM 11 running on my devices (Nexus Q) and want to add some system apk from the stock factory images and need some help. I mounted the factory image and copied TungstenLEDService.apk from /system/app to my computer and tried to install it over adb. This is what I have done so far.
Code:
adb install TungstenLEDService.apk
but it fails with INSTALL_FAILED_SHARED_USER_INCOMPATIBLE error. Ok fine, its a system apk, so I did the following.
I enabled root over adb on developer settings on the device and from the terminal I did
Code:
adb push TungstenLEDService.apk /sdcard/
adb shell
su
mount -o rw,remount -t ext4 /system
cp /sdcard/TungstenLEDService.apk /system/app/
And then I set the permission with Solid Explorer filemanager to -rw-r--r-- on TungstenLEDService.apk and rebooted. From logcat I got this error
Code:
Package com.google.tungsten.ledservice has no signatures that match those in shared user android.uid.system; ignoring!
What to do next? Do I need to resign the apk? How do I do that? I have not modified the apk in any way and the CM 11 build is from this xda thread: http://forum.xda-developers.com/showthread.php?t=2596910
Click to expand...
Click to collapse
3 things that are probably causing issues.
1) it's a signed factory apk, and is looking for a factory rom to work on. You can try re-signing it using basic "test" signature. Also, make sure the apk is "deodexed".
2) Just incompatible with version 4.4 KitKat. In this case, you would probably have to re-write a lot of code.
3) Decompile and check the Android Manifest for anything unusual. Also, while decompiled, check all the folders for the last error message you posted. Might be a clue in there.
Moscow Desire said:
1) it's a signed factory apk, and is looking for a factory rom to work on. You can try re-signing it using basic "test" signature. Also, make sure the apk is "deodexed".
Click to expand...
Click to collapse
How do I deodex the apk / odex files? Any good and easy guides out there? Im a neewbie. Tell me like I'm 4 years old The apk / odex files is from android version 4.0.4
Signing with test signature, do you mean something like this
Code:
jarsigner -keystore ~/.android/debug.keystore -storepass android -keypass android TungstenLEDService.apk androiddebugkey
after the apk is deodoxed?
Moscow Desire said:
2) Just incompatible with version 4.4 KitKat. In this case, you would probably have to re-write a lot of code.
Click to expand...
Click to collapse
I hope not.
Moscow Desire said:
3) Decompile and check the Android Manifest for anything unusual. Also, while decompiled, check all the folders for the last error message you posted. Might be a clue in there.
Click to expand...
Click to collapse
I didnt see anything special in the Manifest, it looks like the one I posted below. Do I need to change android:versionCode and android:versionName?
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:sharedUserId="android.uid.system" android:versionCode="15" android:versionName="4.0.4-403218" package="com.google.tungsten.ledservice"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<application android:label="Tungsten LED Service">
<service android:name=".LEDService" android:exported="true">
<intent-filter>
<action android:name="com.google.tungsten.LedService" />
</intent-filter>
</service>
<receiver android:name="BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service android:name="com.google.tungsten.ledservice.TungstenLedContainer" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="com.android.athome.START_SERVICE" />
</intent-filter>
<meta-data android:name="com.android.athome.service" android:resource="@xml/connector_info" />
</service>
</application>
</manifest>
mannberg said:
How do I deodex the apk / odex files? Any good and easy guides out there? Im a neewbie. Tell me like I'm 4 years old The apk / odex files is from android version 4.0.4
Click to expand...
Click to collapse
Ha! Can't do that mate. Have to work!
Now, here is what I use for pretty much all my needs when it comes to working with apks and other things.
http://forum.xda-developers.com/showthread.php?t=1619473
They have a pretty good support here at XDA, and also their own website. This saves you having to find all these apktools and such for decompiling, deodexing and stuff, which is a real pain. I use it under Win 7. Might have to install the latest version of Microsoft.net though.
First thing, is make sure your apk is deodexed or not. If it's not, you will see an odex file with the same name in your system folder of your old 4.0.4 files. If it's not, you'll need to deodex it before decompiling. If there's not an odex file, then you can go straight to decompiling. Then, you can look in all the folders and such. Then recompile it back, using the test keys for signing.
As with the manifest, it's possible you need to change the android versions. But the message you had, seems to be looking for something signed specifically for that 4.0.4. Probably a factory signed framework or systemUI.
CM uses unsigned files, or files signed using random testkeys.
You can also check XDA University about porting apps to KitKat. Lots of these folks do this, and port to other devices, so hopefully somebody there can tell you more. Or check the General Android Application Development forums.
MD
I dedoxed the apk and odex files. Changed the manifest and removed the sharedUserId and rebuilt the apk, signed with a test key. Then I copied the the apk to /system/app. So far everything is fine.
I tried to launch the service (tungsten.ledservice) with
Code:
adb shell am startservice -n com.google.tungsten.ledservice/.TungstenLedContainer
and when I check ps in adb shell I see a process called com.google.tungsten.ledservice. But nothing happens when I change the volyme. It should change the leds on the Nexus Q. I checked adb logcat and found this in the log.
Code:
D/AndroidRuntime( 2626):
D/AndroidRuntime( 2626): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime( 2626): CheckJNI is OFF
D/dalvikvm( 2626): Trying to load lib libjavacore.so 0x0
D/dalvikvm( 2626): Added shared lib libjavacore.so 0x0
D/dalvikvm( 2626): Trying to load lib libnativehelper.so 0x0
D/dalvikvm( 2626): Added shared lib libnativehelper.so 0x0
D/dalvikvm( 2626): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
E/cutils-trace( 2626): Error opening trace file: No such file or directory (2)
D/dalvikvm( 2626): Note: class Landroid/app/ActivityManagerNative; has 180 unimplemented (abstract) methods
E/memtrack( 2626): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug( 2626): failed to load memtrack module: -2
D/AndroidRuntime( 2626): Calling main entry com.android.commands.am.Am
D/AndroidRuntime( 2626): Shutting down VM
This service use some library from /system/lib/, libled_service_jni.so and libtungsten_led.so. I guess some changes were made to the jni stuff between android 4.0.4 and 4.4. Is this fixable? Is it the java code that fails or the compiled c librarys?
So I decided to write up a little guide on how to modify apk and jar files on the Axon 7 for those of you who do not know how and would like to make some modifications such as the ones in my guides.
Prerequisites
A Windows/Linux/Mac computer
A rooted device with TWRP Recovery
USB cable
ADB installed and USB debugging enabled
Java JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html
APKTool: https://ibotpeaches.github.io/Apktool/install/ (Follow all the instructions)
Baksmali: https://bitbucket.org/JesusFreke/smali/downloads/baksmali-2.2.0.jar
7-Zip or another archive manager
1. Install the frameworks to your computer
Open a command window in your working directory and connect your device to your computer with the USB-C cable.
Pull the framework files with
Code:
adb pull /system/framework/framework-res.apk
adb pull /system/framework/framework-zte-res.apk
Install them
Code:
apktool if framework-res.apk
apktool if framework-zte-res.apk
Depending on which ROM you are on you may need to install other frameworks. The above is for the stock ROM.
2. Decompile the apk/jar file.
Pull the apk/jar you want to decompile with
Code:
adb pull path_to_apk_or_jar
Here are paths for some commonly modified apk/jars:
SystemUI: /system/priv-app/SystemUI_ZTE/SystemUI_ZTE.apk
Settings: /system/priv-app/Settings_ZTE/Settings_ZTE.apk
services.jar: /system/framework/services.jar
Decompile the apk with
Code:
apktool d <apk/jar>
If you did everything correctly, a folder should now exist with the name of your apk/jar.
3. Decompile the .odex file
You can skip this step if your apk/jar does not have an .odex associated with it or you only need to modify res and not smali.
Pull the odex file
Code:
adb pull path_to_odex
For example if you want to pull the odex file for SystemUI you would do
Code:
adb pull /system/priv-app/SystemUI_ZTE/oat/arm64/SystemUI_ZTE.odex
Create a folder called "smali" in the directory of your decompiled apk/jar. Then go back to your working directory.
Pull all boot oat files from your device with
Code:
adb pull /system/framework/arm64
Move all the oat files inside the arm64 folder on your PC to your working directory.
Using baksmali, decompile the odex file to smali
Code:
java -jar baksmali.jar deodex -a <api> filename.odex
where api is 23 for Android 6.0, 24 for Android 7.0, and 25 for Android 7.1
A new folder should now be created called "out". Cut and paste the files and folders inside this folder into the "smali" folder you created earlier.
4. Make your modifications.
5. Recompile the apk/jar
From the working directory (not the directory of the decompiled apk/jar) Recompile the apk/jar with
Code:
apktool b name_of_folder
where name_of_folder is the name of the directory of the decompiled apk/jar.
The complied apk/jar should now exist in the "dist" folder in the directory of the decompiled apk/jar.
6. Sign the apk.
Using 7-zip or another archive manager, copy the res folder, resources.arsc file, and the classes.dex file (if you modified smali in steps 3 and 4) from the NEW apk to the ORIGINAL apk.
7. Replace the apk/jar on your device.
Reboot your device into TWRP recovery with
Code:
adb reboot recovery
For user apps: Make sure data is mounted in TWRP's mount menu. If you have encryption turned on you must enter your password otherwise data will not be mounted!
For system apps and framework files: Make sure system is mounted in TWRP's mount menu. Uncheck "Mount system read-only" if it is checked.
Push the ORIGINAL apk/jar to the correct directory on your device
Code:
adb push <apk/jar> path_to_apk_or_jar
Set correct permissions on the apk/jar
Code:
adb shell chmod 0644 path_to_apk_or_jar
If you did step 3, use TWRP's file manager in Advanced<File Manager to navigate to the apk/jar file's directory and delete the existing .oat or .odex file associated with it.
You did it
No go
Hi,
Tried it with the SystemUI_ZTE.apk (and odex) from the 2017G B08 ROM. I ended up with a folder named SystemUI_ZTE. I created a smali folder in that folder and moved the android, com and cn folders (that I got using the "java -jar oat2dex.jar smali SystemUI_ZTE.odex" command) to that smali folder. But when I try the apktool b command I get the following error:
Code:
C:\Users\Blub\ZTE>apktool b SystemUI_ZTE
I: Using Apktool 2.3.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
SystemUI_ZTE\smali\android\support\v17\leanback\app\BackgroundManager.smali[102,4] iput-wide-volatile is an odexed instruction. You cannot reassemble a disassembled odex file unless it has been deodexed.
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: android/support/v17/leanback/app/BackgroundManager.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:75)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:59)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:36)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:412)
at brut.androlib.Androlib.buildSources(Androlib.java:343)
at brut.androlib.Androlib.build(Androlib.java:299)
at brut.androlib.Androlib.build(Androlib.java:270)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:75)
Any idea what I am doing wrong?
TIA,
Cheers,
/Cacti
le_cactus said:
Hi,
Tried it with the SystemUI_ZTE.apk (and odex) from the 2017G B08 ROM. I ended up with a folder named SystemUI_ZTE. I created a smali folder in that folder and moved the android, com and cn folders (that I got using the "java -jar oat2dex.jar smali SystemUI_ZTE.odex" command) to that smali folder. But when I try the apktool b command I get the following error:
Any idea what I am doing wrong?
TIA,
Cheers,
/Cacti
Click to expand...
Click to collapse
I updated the OP with a different tool for the odex file. Try it now.
Hi,
Thanks,but "java -jar baksmali-2.2.0.jar -a 25 -x SystemUI_ZTE.odex -d %CD%" gives me this error
Code:
Exception in thread "main" com.beust.jcommander.MissingCommandException: Expected a command, got -a
at com.beust.jcommander.JCommander.parseValues(JCommander.java:725)
at com.beust.jcommander.JCommander.parse(JCommander.java:304)
at com.beust.jcommander.JCommander.parse(JCommander.java:287)
at org.jf.baksmali.Main.main(Main.java:90)
Cheers,
/Cacti
le_cactus said:
Hi,
Thanks,but "java -jar baksmali-2.2.0.jar -a 25 -x SystemUI_ZTE.odex -d %CD%" gives me this error
Cheers,
/Cacti
Click to expand...
Click to collapse
Try it without any arguments: "java -jar baksmali-2.2.0.jar SystemUI_ZTE.odex"
Hi,
The command "java -jar baksmali.jar deodex -a 25 SystemUI_ZTE.odex"gives me
Code:
Error occurred while loading class path files. Aborting.
org.jf.dexlib2.analysis.ClassPathResolver$ResolveException: Error while loading oat file boot.oat
at org.jf.dexlib2.analysis.ClassPathResolver.loadEntry(ClassPathResolver.java:250)
at org.jf.dexlib2.analysis.ClassPathResolver.loadLocalClassPathEntry(ClassPathResolver.java:179)
at org.jf.dexlib2.analysis.ClassPathResolver.loadLocalOrDeviceBootClassPathEntry(ClassPathResolver.java:191)
at org.jf.dexlib2.analysis.ClassPathResolver.<init>(ClassPathResolver.java:120)
at org.jf.dexlib2.analysis.ClassPathResolver.<init>(ClassPathResolver.java:105)
at org.jf.baksmali.AnalysisArguments.loadClassPathForDexFile(AnalysisArguments.java:129)
at org.jf.baksmali.AnalysisArguments.loadClassPathForDexFile(AnalysisArguments.java:86)
at org.jf.baksmali.DisassembleCommand.getOptions(DisassembleCommand.java:203)
at org.jf.baksmali.DeodexCommand.getOptions(DeodexCommand.java:71)
at org.jf.baksmali.DisassembleCommand.run(DisassembleCommand.java:177)
at org.jf.baksmali.Main.main(Main.java:102)
Caused by: org.jf.dexlib2.analysis.ClassPathResolver$NotFoundException: Cannot find dependency boot-core-libart.oat in null
at org.jf.dexlib2.analysis.ClassPathResolver.loadOatDependencies(ClassPathResolver.java:270)
at org.jf.dexlib2.analysis.ClassPathResolver.loadEntry(ClassPathResolver.java:248)
... 10 more
Cheers,
/Cacti
le_cactus said:
Hi,
The command "java -jar baksmali.jar deodex -a 25 SystemUI_ZTE.odex"gives me
Cheers,
/Cacti
Click to expand...
Click to collapse
pull boot-core-libart.oat from /system/framework/arm64/boot-core-libart.oat and try again
Muchas gracias
Hi,
Had to pull all the .oat files from the /system/framework/arm64/ folder, only then I didn't get an error any more using the command "java -jar baksmali.jar deodex -a 25 SystemUI_ZTE.odex". The "command "java -jar baksmali.jar -a 25 -x SystemUI_ZTE.odex -d %CD%" still gave an error, you might wanna change that in the OP.
Now apktool b SystemUI_ZTE didn't give me any errors anymore. Executed the other steps, and bingo! Everthing seems to work. And byy replacing the charging.ogg, my device charges silently.
Thanks from my wife as she now doesn't wake up when I go to bed (and connect the charger). Many thanks for your patience and your excelent guide! I guess I'll bemodding some more APK's now
Cheers,
/Cacti
le_cactus said:
Hi,
Had to pull all the .oat files from the /system/framework/arm64/ folder, only then I didn't get an error any more using the command "java -jar baksmali.jar deodex -a 25 SystemUI_ZTE.odex". The "command "java -jar baksmali.jar -a 25 -x SystemUI_ZTE.odex -d %CD%" still gave an error, you might wanna change that in the OP.
Now apktool b SystemUI_ZTE didn't give me any errors anymore. Executed the other steps, and bingo! Everthing seems to work. And byy replacing the charging.ogg, my device charges silently.
Thanks from my wife as she now doesn't wake up when I go to bed (and connect the charger). Many thanks for your patience and your excelent guide! I guess I'll bemodding some more APK's now
Cheers,
/Cacti
Click to expand...
Click to collapse
Great! I'll add that to the OP! Thanks for helping me out!
Updated the OP with a new signing method that should fix boot hang issues with some apks (aka Settings_ZTE)
bkores said:
Updated the OP with a new signing method that should fix boot hang issues with some apks (aka Settings_ZTE)
Click to expand...
Click to collapse
IMO it was just the same as your previous method (under 5.)was saying : move META-INF ( and manifest but not necessary imo) from original apk into the new apk (in dist folder).
Now you're saying : put res, resources and classes from new apk into new apk...that's just the same, no ? Only more files to move imo.
Since res, resources and classes are indeed changing by compile, wouldn't it be better by just saying : put META-INF from original apk into new apk, like you first wrote in OP ? Easier no ?
ALSO : under 6. you say : Open a command window in the "dist" folder and push the ORIGINAL apk/jar to the correct directory on your device
Shouldn't that be : push ORIGINAL (since you copied files under 5 from NEW(in "dist") to ORIGINAL(in working folder) ) FROM WORKING FOLDER ? Since there is no original apk in DIST folder, only our new apk. Imo you make things a bit confusing here, no ? :cyclops:
raystef66 said:
IMO it was just the same as your previous method (under 5.)was saying : move META-INF ( and manifest but not necessary imo) from original apk into the new apk (in dist folder).
Now you're saying : put res, resources and classes from new apk into new apk...that's just the same, no ? Only more files to move imo.
Since res, resources and classes are indeed changing by compile, wouldn't it be better by just saying : put META-INF from original apk into new apk, like you first wrote in OP ? Easier no ?
ALSO : under 6. you say : Open a command window in the "dist" folder and push the ORIGINAL apk/jar to the correct directory on your device
Shouldn't that be : push ORIGINAL (since you copied files under 5 from NEW(in "dist") to ORIGINAL(in working folder) ) FROM WORKING FOLDER ? Since there is no original apk in DIST folder, only our new apk. Imo you make things a bit confusing here, no ? :cyclops:
Click to expand...
Click to collapse
Fixed!
bkores said:
Fixed!
Click to expand...
Click to collapse
Thnx Mate ! Appreciate all your work :good:
i have some problem with framework.jar, it doesn't have classes.dex in jar but it also doesn't have odex file in /system/framework/oat/arm64 (also arm). Because of it i can't decompile it using smali/baksmali tool. I want to make more volume steps mode like VolumeSteps+ but without Xposed. Hope someone can help.