Hello,
NFC does not work when the screen is off or locked. XlAfbk has explained the steps to follow in order to make the NFC working with the screen locked. This is working very well on my Note 8 (SM-N9500) with Android 8.0 (does not break SafetyNet and works with NFC payments). The steps:
1. Pull NfcNci.apk from your device: adb pull /system/app/NfcNci/NfcNci.apk
2. Download smali-<version>.jar and baksmali-<version>.jar from https://bitbucket.org/JesusFreke/smali/downloads
3. Put NfcNci.apk and the 2 .jar files in the same directory
4. open a command prompt in that directory
5. open NfcNci.apk with 7z/winzip/winrar/... and extract classes.dex from it (into the same directory)
6. run: java -jar baksmali-<version>.jar classes.dex -o out
7. navigate to directory out\com\android\nfc
8. open NfcService.smali in a text editor
9. search for "android.intent.action.SCREEN_OFF" and replace with "android.intent.action.SCREEN_OFFA"
10. search for "android.intent.action.SCREEN_ON" and replace with "android.intent.action.SCREEN_ONA"
11. search for "android.intent.action.USER_PRESENT" and replace with "android.intent.action.USER_PRESENTA"
12. search for "android.intent.action.USER_SWITCHED" and replace with "android.intent.action.USER_SWITCHEDA"
13. search for ".method private computeDiscoveryParameters" -> about 20 lines below it should be a line like "if-lt v2, p1, :cond_5b" -> replace the 2 parameters in that function (in this example: "if-lt p1, v2, :cond_5b")
14. open ScreenStateHelper.smali in a text editor
15. search for ".method checkScreenState()I" -> change all the return values ("const/4 v0, 0x...") to "const/4 v0, 0x3"
16. run: java -jar smali-<version>.jar out -o classes.dex
17. open NfcNci.apk with 7z/winzip/winrar/... and add classes.dex to it
18. push the modded apk to your device: adb push NfcNci.apk /system/app/NfcNci/NfcNci.apk. Do not forget to make a backup of the original NfcNci.apk before.
19. chmod 644 /system/app/NfcNci/NfcNci.apk
All credit goes to the original writer of the guides: https://forum.xda-developers.com/xposed/modules/mod-nfc-unlocking-based-t2478163/post59941326
Alternately, you can download the modded NfcNci.apk and install it with adb. This is for the Note 8 (SM-N9500) with Android 8.0. It might work for other versions of Note 8.
Nice. I'm guessing root is required?
Yes. Root is required.
oddbehreif said:
Nice. I'm guessing root is required?
Click to expand...
Click to collapse
LeBobbo said:
Hello,
NFC does not work when the screen is off or locked. XlAfbk has explained the steps to follow in order to make the NFC working with the screen locked. This is working very well on my Note 8 (SM-N9500) with Android 8.0 (does not break SafetyNet and works with NFC payments). The steps:
1. Pull NfcNci.apk from your device: adb pull /system/app/NfcNci/NfcNci.apk
2. Download smali-<version>.jar and baksmali-<version>.jar from https://bitbucket.org/JesusFreke/smali/downloads
3. Put NfcNci.apk and the 2 .jar files in the same directory
4. open a command prompt in that directory
5. open NfcNci.apk with 7z/winzip/winrar/... and extract classes.dex from it (into the same directory)
6. run: java -jar baksmali-<version>.jar classes.dex -o out
7. navigate to directory out\com\android\nfc
8. open NfcService.smali in a text editor
9. search for "android.intent.action.SCREEN_OFF" and replace with "android.intent.action.SCREEN_OFFA"
10. search for "android.intent.action.SCREEN_ON" and replace with "android.intent.action.SCREEN_ONA"
11. search for "android.intent.action.USER_PRESENT" and replace with "android.intent.action.USER_PRESENTA"
12. search for "android.intent.action.USER_SWITCHED" and replace with "android.intent.action.USER_SWITCHEDA"
13. search for ".method private computeDiscoveryParameters" -> about 20 lines below it should be a line like "if-lt v2, p1, :cond_5b" -> replace the 2 parameters in that function (in this example: "if-lt p1, v2, :cond_5b")
14. open ScreenStateHelper.smali in a text editor
15. search for ".method checkScreenState()I" -> change all the return values ("const/4 v0, 0x...") to "const/4 v0, 0x3"
16. run: java -jar smali-<version>.jar out -o classes.dex
17. open NfcNci.apk with 7z/winzip/winrar/... and add classes.dex to it
18. push the modded apk to your device: adb push NfcNci.apk /system/app/NfcNci/NfcNci.apk. Do not forget to make a backup of the original NfcNci.apk before.
19. chmod 644 /system/app/NfcNci/NfcNci.apk
All credit goes to the original writer of the guides: https://forum.xda-developers.com/xposed/modules/mod-nfc-unlocking-based-t2478163/post59941326
Alternately, you can download the modded NfcNci.apk and install it with adb. This is for the Note 8 (SM-N9500) with Android 8.0. It might work for other versions of Note 8.
Click to expand...
Click to collapse
Have you upgraded to pie, and does this mod still work? I'm not on a Samsung device but want to make the mods myself, just wondering if anything has changed from oreo to pie
Related
!! THIS TUTORIAL IS All Linux Distros
!!START -------------------------------------- Optional
You will now install the SDK.
!!START -------------------------------------- Installing Android SDK --------------------------------------
Installing the SDK is the easiest of all.
Download the SDK.169.9 MB [http://developer.android.com/sdk/]
Right-click and select Extract Here.
Move the contents of the android-sdk-linux_x??-??_ directory to your desired location.If you followed Optional Installation, move the contents to your /AndroidSDK directory in the root of your filesystem.
Close directory window.
-------------------------------------- Installing Android SDK -------------------------------------- END!!
You will now set up your bashrc file and UDEV to recognize your HTC Device.
!!START -------------------------------------- ADB + FASTBOOT --------------------------------------
The Android Debug Bridge (adb) is one of the tools that will help you the most when you run into flashing problems or running shell commands directly from your machine. UDEV will not recognize your G1 out of the box, but we will configure it with some rules so it can connect.
We will work with /AndroidSDK as the location of your sdk. If this is not your setup, I think you're smart enough to figure it out.
Editing .bashrc file to use tools from /AndroidSDK/tools/ directory -
Go to your home folder.Example: /home/wddglr/
Press Control + H to view hidden files.
Look for your .bashrc file and double click to open it with gedit.
Add the following lines to the top of the file:
Code:
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
IMPORTANT NOTE
Setting up UDEV to recognize HTC Device -
Type the following into a terminal (Applications > Accessories > Terminal):
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
Now add the following line to the blank file:
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
Click save and close.
To restart udev, open up a terminal and enter:
Code:
sudo /etc/init.d/udev restart
Setting up fastboot -
Download this fastboot binary from http://android-dls.com.130.4 KB [http://android-dls.com/files/linux/fastboot]
Once downloaded to your desktop, right click and select Properties.
Navigate to the Permissions tab and configure the following option:Execute: [√] Allow executing file as program
Click Close.
Move the fastboot bianary to your /AndroidSDK/tools/ directory.
Reboot.
-------------------------------------- ADB + FASTBOOT -------------------------------------- END!!
Thank to http://forum.xda-developers.com/showthread.php?t=537508 for making this for the g1
In newer versions of Debian based systems "sudo /etc/init.d/udev restart" will not work as the command have been changed..
Instead use: "sudo restart udev"
BTW, thanks for a very useful post
In modern distros, none of this nonsense is necessary. Download and extract the SDK, use it. No udev tinkering.
In Slackware it's /etc/rc.d/rc.udev restart and probably something similar with anything using a BSD-style init.
This is nice, but like so many linux how-tos I see these days, it's really a ubuntu how-to. Anything with a "g" in front of it (gksudo, gedit) will probably only work on half of linux boxes.
how do you find out what vendor ids to use for other devices? I see the first one here http://developer.android.com/guide/developing/device.html but what about the second one?
pietro_spina said:
how do you find out what vendor ids to use for other devices? I see the first one here http://developer.android.com/guide/developing/device.html but what about the second one?
Click to expand...
Click to collapse
You very unlikely have to do this.. Which is the point of my first post in this thread. It'll most likely just work.
Hello all I'm new to Android (loving it by the way) as well as the OS X terminal but I managed to fumble my way through removing My Verizon, Skype, VZ Navigator, Visual Voicemail and CityID the steps are as follows:
1. Download the Android SDK and unzip it onto your desktop
2. Rename the folder sdk (this is for easier terminal navigation)
3. Reboot your phone into recovery from the main menu select Partitions Menu then select Mount/System
4. Now open up terminal and type cd desktop/sdk/tools hit enter
5. Now type ./adb shell hit enter
6. Next type mkdir /system/app.disabled hit enter
7. Next type mv /system/app/VZW_MyVerizon.apk /system/app.disabled hit enter
8. Next type mv /system/app/VZW_Skype.apk /system/app.disabled hit enter
9. Next type mv /system/app/VzNav.apk /system/app.disabled hit enter
10. Next type mv /system/app/VVM.apk /system/app.disabled hit enter
11. Next type mv /system/app/CityID.apk /system/app.disabled hit enter
12. Now type exit hit enter
13. Now on your phone in the Partitions Menu select Unmount/System
14. Reboot and enjoy!
Hope this helps!
can you post the links on sdk download...n also the commands to remove;
amazon
footprints
mail
peep
stocks
HeyItsLou said:
Hello all I'm new to Android (loving it by the way) as well as the OS X terminal but I managed to fumble my way through removing My Verizon, Skype, VZ Navigator, Visual Voicemail and CityID the steps are as follows:
1. Download the Android SDK and unzip it onto your desktop
2. Rename the folder sdk (this is for easier terminal navigation)
3. Reboot your phone into recovery from the main menu select Partitions Menu then select Mount/System
4. Now open up terminal and type cd desktop/sdk/tools hit enter
5. Now type ./adb shell hit enter
6. Next type mkdir /system/app.disabled hit enter
7. Next type mv /system/app/VZW_MyVerizon.apk /system/app.disabled hit enter
8. Next type mv /system/app/VZW_Skype.apk /system/app.disabled hit enter
9. Next type mv /system/app/VzNav.apk /system/app.disabled hit enter
10. Next type mv /system/app/VVM.apk /system/app.disabled hit enter
11. Next type mv /system/app/CityID.apk /system/app.disabled hit enter
12. Now type exit hit enter
13. Now on your phone in the Partitions Menu select Unmount/System
14. Reboot and enjoy!
Hope this helps!
Click to expand...
Click to collapse
are you removing or just disabling??
HeyItsLou said:
Hello all I'm new to Android (loving it by the way) as well as the OS X terminal but I managed to fumble my way through removing My Verizon, Skype, VZ Navigator, Visual Voicemail and CityID the steps are as follows:
1. Download the Android SDK and unzip it onto your desktop
2. Rename the folder sdk (this is for easier terminal navigation)
3. Reboot your phone into recovery from the main menu select Partitions Menu then select Mount/System
4. Now open up terminal and type cd desktop/sdk/tools hit enter
5. Now type ./adb shell hit enter
6. Next type mkdir /system/app.disabled hit enter
7. Next type mv /system/app/VZW_MyVerizon.apk /system/app.disabled hit enter
8. Next type mv /system/app/VZW_Skype.apk /system/app.disabled hit enter
9. Next type mv /system/app/VzNav.apk /system/app.disabled hit enter
10. Next type mv /system/app/VVM.apk /system/app.disabled hit enter
11. Next type mv /system/app/CityID.apk /system/app.disabled hit enter
12. Now type exit hit enter
13. Now on your phone in the Partitions Menu select Unmount/System
14. Reboot and enjoy!
Hope this helps!
Click to expand...
Click to collapse
Thank you this will be a huge help for everyone using a Mac.
kartoon56 said:
can you post the links on sdk download...n also the commands to remove;
amazon
footprints
mail
peep
stocks
Click to expand...
Click to collapse
Cant post a link but just google android sdk and you will find it.
These instructions work fine for PC too, just the first step is "Open command prompt" instead of terminal.
This should work regardless of computer OS. It's just using adb which is the same regardless.
Sent from my ADR6300 using XDA App
well my question still stands...does this method only disable the app or does it remove it completly; erasing it from the phone?
This method technically doesn't delete the application it create a system directory called app.disabled and moves the program.from the system app directory to it so.its no.longer recognized as an installed app. This is beneficially especially if you move something that's causes instability and can move it from the created app.disabled directory to its original system app directory. You can move the apps then execute the command rm - r app.disabled which will delete everything
UPDATE: System App list for help in deleting apps
I've installed some apps since making this list as well as deleted a few which are listed at the top of this thread....happy hunting
htccontactwidgets.apk
htccalendarwidgets.apk
htcbookmarkwidget.apk
com.htc.WeatherWidget.apk
com.htc.TwitterWidget.apk
com.htc.NewsReaderWidget.apk
com.htc.MusicWidget.apk
com.htc.FriendStreamWidget.apk
com.htc.FMRadioWidget.apk
amazonmp3.apk
YouTube.apk
WorldClock.apk
WifiRouter.apk
WidgetDownloadManager.apk
WeatherSyncProvider.apk
WeatherProvider.apk
WeatherAgentService.apk
Weather.apk
VzwLBSPerm.apk
VzWBAService.apk
VzWBAClient.apk
VpnServices.apk
VoiceSearch.apk
VoiceDialer.apk
VisualizationWallpapers.apk
Vending.apk
UserDictionaryProvider.apk
UploadProvider.apk
UpgradeSetup.apk
Updater.apk
TtsService.apk
TelephonyProvider.apk
Talk.apk
TVOUT.apk
Superuser.apk
Street.apk
SocialNetworkProvider.apk
SetupWizard.apk
SettingsProvider.apk
Settings.apk
Rosie.apk
RSS.apk
QxdmLog.apk
Quickoffice.apk
PluginManager.apk
PicoTts.apk
Phone.apk
PackageInstaller.apk
PDFViewer.apk
PCSCII.apk
NewsReader.apk
NetworkLocation.apk
Mode10Wallpapers.apk
Mms.apk
MediaUploader.apk
MediaProvider.apk
MarketUpdater.apk
Maps.apk
Mail.apk
MagicSmokeWallpapers.apk
LiveWallpapersPicker.apk
LiveWallpapers.apk
LbsProvider.apk
HtcWeatherWallpaper.apk
HtcTwitter.apk
HtcSyncwidget.apk
HtcStreamPlayer.apk
HtcSoundRecorder.apk
HtcSettingsProvider.apk
HtcRingtoneWidget.apk
HtcRingtoneTrimmer.apk
HtcProfilesWidget.apk
HtcPhotoWidget.apk
HtcMusic.apk
HtcMessageUploader.apk
HtcLockScreen.apk
HtcLocationService.apk
HtcLocationPicker.apk
HtcFootprintsWidget.apk
HtcFootprints.apk
HtcFacebook.apk
HtcFMRadio.apk
HtcDialer.apk
HtcCopyright.apk
HtcContacts.apk
HtcClockWidget.apk
teeter.apk
HtcCdmaMccProvider.apk
HtcCarPanel.apk
HtcCalculatorWidget.apk
HtcAddProgramWidget.apk
HTMLViewer.apk
HTC_IME.apk
HTCSetupWizard.apk
HTCCamera.apk
HTCAlbum.apk
GoogleServicesFramework.apk
GoogleQuickSearchBox.apk
restartapp.apk
GooglePartnerSetup.apk
GoogleFeedback.apk
GoogleContactsSyncAdapter.apk
GoogleCalendarSyncAdapter.apk
GenieWidget.apk
FriendStream.apk
Flickr.apk
install_flash_player.apk
Flashlight.apk
FilePicker.apk
FieldTrial.apk
FieldTest.apk
Facebook.apk
EPST.apk
DrmProvider.apk
DownloadProvider.apk
DefaultContainerService.apk
DebugTool.apk
DMPortRead.apk
DCSUtility.apk
htcsettingwidgets.apk
DCSStock.apk
DCSImpl.apk
CustomizationSetup.apk
CustomizationSettingsProvider.apk
ContactsProvider.apk
Clicker.apk
CheckinProvider.apk
CertInstaller.apk
Gmail.apk
CalendarProvider.apk
htcmsgwidgets.apk
Calendar.apk
Calculator.apk
Browser.apk
BrcmBluetoothServices.apk
Bluetooth.apk
ApplicationsProvider.apk
AppSharing.apk
AccountSyncManager.apk
htcmailwidgets.apk
What would be the commands to completely remove the apps? Also, does removing them mess with the system stability?
You will have to run the rm /system/app/programname.apk be careful if you completely delete something and the system goes unstable you will have to re-flash the rom
If you remove The HTC dialer is their a vanilla one left? If not how do you push a vanilla one on?
i've move the apps on my sdcard, dont want to have them on my phone
chefjayhawk said:
If you remove The HTC dialer is their a vanilla one left? If not how do you push a vanilla one on?
Click to expand...
Click to collapse
i would also like the answer to this..thanks
Unfortunately the HTC incredible differs from other HTC devices in that most of the vanilla parts of android are overlaid by Sense and the user is unable to choose between Vanilla Android or Sense UI. So to answer your question directly if you remove the dialer there is no Vanilla one present so I don't recommend it. This applies to most of the Sense Rom as well.
Also I'm not positive but I don't think the stock Vanilla dialer will play nice with the rest of sense due to how the Sense dialer integrates with the rest of the UI.
I'd like to make a few changes in the services.odex file, and I want to make sure I do it correctly the first time, so I'd like to run this by everyone for comments/corrections.
So far, these are the steps that I *think* are correct:
1. Pull /system/framework/* files onto my PC.
2. On the PC, baksmali the services.odex.
3. Makes the changes to whatever .smali file I wish.
4. Rebuild services.dex via smali (using the output dir created by baksmali).
5. Insert services.dex into services.jar (using, say, WinRAR).
6. Push the new services.jar onto /sdcard and then copy it over to /system/framework dir.
7. Reboot and pray it works.
Is this correct?
---
EDIT: See my reply below for the answer.
Should I post this question over in the "Captivate Android Development" forum? Anyone?
Small bump for this post, interested in the correct procedure for this too.
[A] Here are the steps
Yeah, it took me a week of digging to find this answer.
Disclaimer:
1. Proceed at your own risk and don't blame me if you brick your phone.
2. While I've done my best to document the steps I took, there's always a chance I've mistyped something.
3. If you're unsure at any point, STOP! Re-read everything so you fully understand what you're doing.
4. Editing .odex files can be extremely tricky! All it takes is a bad edit to royally screw up your phone.
This guide assumes:
* you have a Captivate and it's running stock Eclair. (Don't know about other phones or other OSes.)
* you have rooted your phone, and have busybox & Superuser Permissions installed.
* you have adb installed and working on a PC.
* you have baksmali and smali installed and working on a PC (along with Java).
* you have downloaded the utility "dexopt-wrapper". (Do a search - you'll find it.)
* you know what the BOOTCLASSPATH value is for your phone. (Hint: It's in /init.rc)
* you have made a complete backup of your phone! (Yes, if something goes wrong, it's much nicer to be able to restore files from a recent backup than to have to wipe the phone and start from scratch again.)
- I highly recommend you install ROM Manager w/ ClockworkMod. (And don't delete /sdcard/update.zip)
Notations:
When you see a line beginning with >, that's a command to be executed on the PC.
When you see a line beginning with #, that's a command to be executed on the phone.
Ready? Here we go:
put the dexopt-wrapper onto your phone.
> adb push dexopt-wrapper /sdcard
copy all of the /system/framework files onto your PC.
> adb pull /system/framework
let's pretend you want to change something in services.odex.
decompile the .odex file
> baksmali -x services.odex -o services.out
now edit whatever .smali file you want in the services.out folder.
rebuild the classes.dex file for services.odex.
> smali -o classes.dex services.out
now put classes.dex into services.jar (I used WinRAR, but other ZIP utilities should work.)
put the new .jar file onto your phone.
> adb push services.jar /sdcard
> adb shell
become super user
# su
put the dexopt-wrapper utility into the bin folder with the correct permissions. (you only need to do this once, obviously.)
# cd /system/bin
# busybox cp /sdcard/dexopt-wrapper .
# busybox chmod 755 dexopt-wrapper
# cd /sdcard
create a new .odex file from the new .jar file
# dexopt-wrapper services.jar new.odex [BOOTCLASSPATH]
yes, fill in the value of BOOTCLASSPATH, without the []
here's the "special sauce": copy over the "signature" from the current .odex file into the new .odex file. do NOT continue until this command succeeds!
hint: the file size of the new.odex file should not change!
# busybox dd if=/system/framework/services.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
now replace the old .odex file with the new .odex file.
# cd /system/framework
# busybox cp /sdcard/new.odex services.odex
# busybox chmod 644 services.odex
and you're done.
# sync
# reboot
Now, if all goes well, your phone should reboot normally.
However, if something has not gone well, you'll hear the bootup sounds, but the screen will be "stuck" on the first white logo screen. That means the new .odex file was not accepted. What to do? Well, first, (and with all do respect) Don't Panic! Plug in the USB line and issue:
> adb reboot recovery
That should drop you into the recovery. "Apply Updates" and that will get you into ClockworkMod. Then you can restore the /system files from your full backup (the one you did RIGHT BEFORE doing any of this, right?) and be back up and running in just a few minutes. (Yeah, I had to do this many times. It's scary the first time, but you get use to it after a while.)
Good luck!
software_samurai said:
Yeah, it took me a week of digging to find this answer.
Disclaimer:
1. Proceed at your own risk and don't blame me if you brick your phone.
2. While I've done my best to document the steps I took, there's always a chance I've mistyped something.
3. If you're unsure at any point, STOP! Re-read everything so you fully understand what you're doing.
4. Editing .odex files can be extremely tricky! All it takes is a bad edit to royally screw up your phone.
This guide assumes:
* you have a Captivate and it's running stock Eclair. (Don't know about other phones or other OSes.)
* you have rooted your phone, and have busybox & Superuser Permissions installed.
* you have adb installed and working on a PC.
* you have baksmali and smali installed and working on a PC (along with Java).
* you have downloaded the utility "dexopt-wrapper". (Do a search - you'll find it.)
* you know what the BOOTCLASSPATH value is for your phone. (Hint: It's in /init.rc)
* you have made a complete backup of your phone! (Yes, if something goes wrong, it's much nicer to be able to restore files from a recent backup than to have to wipe the phone and start from scratch again.)
- I highly recommend you install ROM Manager w/ ClockworkMod. (And don't delete /sdcard/update.zip)
Notations:
When you see a line beginning with >, that's a command to be executed on the PC.
When you see a line beginning with #, that's a command to be executed on the phone.
Ready? Here we go:
put the dexopt-wrapper onto your phone.
> adb push dexopt-wrapper /sdcard
copy all of the /system/framework files onto your PC.
> adb pull /system/framework
let's pretend you want to change something in services.odex.
decompile the .odex file
> baksmali -x services.odex -o services.out
now edit whatever .smali file you want in the services.out folder.
rebuild the classes.dex file for services.odex.
> smali -o classes.dex services.out
now put classes.dex into services.jar (I used WinRAR, but other ZIP utilities should work.)
put the new .jar file onto your phone.
> adb push services.jar /sdcard
> adb shell
become super user
# su
put the dexopt-wrapper utility into the bin folder with the correct permissions. (you only need to do this once, obviously.)
# cd /system/bin
# busybox cp /sdcard/dexopt-wrapper .
# busybox chmod 755 dexopt-wrapper
# cd /sdcard
create a new .odex file from the new .jar file
# dexopt-wrapper services.jar new.odex [BOOTCLASSPATH]
yes, fill in the value of BOOTCLASSPATH, without the []
here's the "special sauce": copy over the "signature" from the current .odex file into the new .odex file. do NOT continue until this command succeeds!
hint: the file size of the new.odex file should not change!
# busybox dd if=/system/framework/services.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
now replace the old .odex file with the new .odex file.
# cd /system/framework
# busybox cp /sdcard/new.odex services.odex
# busybox chmod 644 services.odex
and you're done.
# sync
# reboot
Now, if all goes well, your phone should reboot normally.
However, if something has not gone well, you'll hear the bootup sounds, but the screen will be "stuck" on the first white logo screen. That means the new .odex file was not accepted. What to do? Well, first, (and with all do respect) Don't Panic! Plug in the USB line and issue:
> adb reboot recovery
That should drop you into the recovery. "Apply Updates" and that will get you into ClockworkMod. Then you can restore the /system files from your full backup (the one you did RIGHT BEFORE doing any of this, right?) and be back up and running in just a few minutes. (Yeah, I had to do this many times. It's scary the first time, but you get use to it after a while.)
Good luck!
Click to expand...
Click to collapse
Thanks, was really useful for me
awsome thx
super thanks for guide
Strange... all thanks but nothing to add?
I had to install the new Android SDK r16 because of buggy "adb" executable (my fault).
http://developer.android.com/sdk/index.html
Newest version smali/baksmali v1.3.0 has been used.
Helpfull page:
http://code.google.com/p/smali/wiki/DeodexInstructions
Copied whole "/system/framework" to my current working folder (reason in command below).
Code:
baksmali -c /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar -a 10 -x Mms.odex -o Mms.out
Already had to put "BOOTCLASSPATH" in this command with "-c" option, else I would get an error stating. "Error occured while loading boot class path files.".
With new baksmali you have to put in the Android SDK api-level with option "-a" of the current Android OS you're working on. For Gingerbread numbers 10-13 work, but 14 (ICS) doesn't work anymore.
Api levels are stated right at the beginning on each "Android X.X Platform" links on the left side of Android SDK page (mentioned above).
For the most part this guide was perfect, but since a lot has been updated I felt this guide needed a minor update too!
to get quicker answers to non-captivate specific questions (without a week of searching) ask android software questions in the XDA > Android OS > fourms instead of the XDA>Captivate fourms.
the Captivate forums are not a frequent stop for experienced programmers and developers to find and answer these type of questions.
software_samurai said:
Yeah, it took me a week of digging to find this answer.
Disclaimer:
1. Proceed at your own risk and don't blame me if you brick your phone.
2. While I've done my best to document the steps I took, there's always a chance I've mistyped something.
3. If you're unsure at any point, STOP! Re-read everything so you fully understand what you're doing.
4. Editing .odex files can be extremely tricky! All it takes is a bad edit to royally screw up your phone.
This guide assumes:
* you have a Captivate and it's running stock Eclair. (Don't know about other phones or other OSes.)
* you have rooted your phone, and have busybox & Superuser Permissions installed.
* you have adb installed and working on a PC.
* you have baksmali and smali installed and working on a PC (along with Java).
* you have downloaded the utility "dexopt-wrapper". (Do a search - you'll find it.)
* you know what the BOOTCLASSPATH value is for your phone. (Hint: It's in /init.rc)
* you have made a complete backup of your phone! (Yes, if something goes wrong, it's much nicer to be able to restore files from a recent backup than to have to wipe the phone and start from scratch again.)
- I highly recommend you install ROM Manager w/ ClockworkMod. (And don't delete /sdcard/update.zip)
Notations:
When you see a line beginning with >, that's a command to be executed on the PC.
When you see a line beginning with #, that's a command to be executed on the phone.
Ready? Here we go:
put the dexopt-wrapper onto your phone.
> adb push dexopt-wrapper /sdcard
copy all of the /system/framework files onto your PC.
> adb pull /system/framework
let's pretend you want to change something in services.odex.
decompile the .odex file
> baksmali -x services.odex -o services.out
now edit whatever .smali file you want in the services.out folder.
rebuild the classes.dex file for services.odex.
> smali -o classes.dex services.out
now put classes.dex into services.jar (I used WinRAR, but other ZIP utilities should work.)
put the new .jar file onto your phone.
> adb push services.jar /sdcard
> adb shell
become super user
# su
put the dexopt-wrapper utility into the bin folder with the correct permissions. (you only need to do this once, obviously.)
# cd /system/bin
# busybox cp /sdcard/dexopt-wrapper .
# busybox chmod 755 dexopt-wrapper
# cd /sdcard
create a new .odex file from the new .jar file
# dexopt-wrapper services.jar new.odex [BOOTCLASSPATH]
yes, fill in the value of BOOTCLASSPATH, without the []
here's the "special sauce": copy over the "signature" from the current .odex file into the new .odex file. do NOT continue until this command succeeds!
hint: the file size of the new.odex file should not change!
# busybox dd if=/system/framework/services.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
now replace the old .odex file with the new .odex file.
# cd /system/framework
# busybox cp /sdcard/new.odex services.odex
# busybox chmod 644 services.odex
and you're done.
# sync
# reboot
Now, if all goes well, your phone should reboot normally.
However, if something has not gone well, you'll hear the bootup sounds, but the screen will be "stuck" on the first white logo screen. That means the new .odex file was not accepted. What to do? Well, first, (and with all do respect) Don't Panic! Plug in the USB line and issue:
> adb reboot recovery
That should drop you into the recovery. "Apply Updates" and that will get you into ClockworkMod. Then you can restore the /system files from your full backup (the one you did RIGHT BEFORE doing any of this, right?) and be back up and running in just a few minutes. (Yeah, I had to do this many times. It's scary the first time, but you get use to it after a while.)
Good luck!
Click to expand...
Click to collapse
excuse me, where to find the "dexopt_wrapper"? i can't find it anywhere!
Search with Google. You'll find it that way.
Daniel D. said:
Search with Google. You'll find it that way.
Click to expand...
Click to collapse
i found a dexopt in my /system/bin directory. 9.63k
is it the dexopt-wrapper i needed?
if it is, should i rename it to 'dexopter-wrapper' to use it?
software_samurai said:
Yeah, it took me a week of digging to find this answer.
Disclaimer:
1. Proceed at your own risk and don't blame me if you brick your phone.
2. While I've done my best to document the steps I took, there's always a chance I've mistyped something.
3. If you're unsure at any point, STOP! Re-read everything so you fully understand what you're doing.
4. Editing .odex files can be extremely tricky! All it takes is a bad edit to royally screw up your phone.
This guide assumes:
* you have a Captivate and it's running stock Eclair. (Don't know about other phones or other OSes.)
* you have rooted your phone, and have busybox & Superuser Permissions installed.
* you have adb installed and working on a PC.
* you have baksmali and smali installed and working on a PC (along with Java).
* you have downloaded the utility "dexopt-wrapper". (Do a search - you'll find it.)
* you know what the BOOTCLASSPATH value is for your phone. (Hint: It's in /init.rc)
* you have made a complete backup of your phone! (Yes, if something goes wrong, it's much nicer to be able to restore files from a recent backup than to have to wipe the phone and start from scratch again.)
- I highly recommend you install ROM Manager w/ ClockworkMod. (And don't delete /sdcard/update.zip)
Notations:
When you see a line beginning with >, that's a command to be executed on the PC.
When you see a line beginning with #, that's a command to be executed on the phone.
Ready? Here we go:
put the dexopt-wrapper onto your phone.
> adb push dexopt-wrapper /sdcard
copy all of the /system/framework files onto your PC.
> adb pull /system/framework
let's pretend you want to change something in services.odex.
decompile the .odex file
> baksmali -x services.odex -o services.out
now edit whatever .smali file you want in the services.out folder.
rebuild the classes.dex file for services.odex.
> smali -o classes.dex services.out
now put classes.dex into services.jar (I used WinRAR, but other ZIP utilities should work.)
put the new .jar file onto your phone.
> adb push services.jar /sdcard
> adb shell
become super user
# su
put the dexopt-wrapper utility into the bin folder with the correct permissions. (you only need to do this once, obviously.)
# cd /system/bin
# busybox cp /sdcard/dexopt-wrapper .
# busybox chmod 755 dexopt-wrapper
# cd /sdcard
create a new .odex file from the new .jar file
# dexopt-wrapper services.jar new.odex [BOOTCLASSPATH]
yes, fill in the value of BOOTCLASSPATH, without the []
here's the "special sauce": copy over the "signature" from the current .odex file into the new .odex file. do NOT continue until this command succeeds!
hint: the file size of the new.odex file should not change!
# busybox dd if=/system/framework/services.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
now replace the old .odex file with the new .odex file.
# cd /system/framework
# busybox cp /sdcard/new.odex services.odex
# busybox chmod 644 services.odex
and you're done.
# sync
# reboot
Now, if all goes well, your phone should reboot normally.
However, if something has not gone well, you'll hear the bootup sounds, but the screen will be "stuck" on the first white logo screen. That means the new .odex file was not accepted. What to do? Well, first, (and with all do respect) Don't Panic! Plug in the USB line and issue:
> adb reboot recovery
That should drop you into the recovery. "Apply Updates" and that will get you into ClockworkMod. Then you can restore the /system files from your full backup (the one you did RIGHT BEFORE doing any of this, right?) and be back up and running in just a few minutes. (Yeah, I had to do this many times. It's scary the first time, but you get use to it after a while.)
Good luck!
Click to expand...
Click to collapse
very well written guide for begginers, all other guides i tried were so confusing. thanks
software_samurai said:
However, if something has not gone well, you'll hear the bootup sounds, but the screen will be "stuck" on the first white logo screen. That means the new .odex file was not accepted. What to do? Well, first, (and with all do respect) Don't Panic! Plug in the USB line and issue:
> adb reboot recovery
That should drop you into the recovery. "Apply Updates" and that will get you into ClockworkMod. Then you can restore the /system files from your full backup (the one you did RIGHT BEFORE doing any of this, right?) and be back up and running in just a few minutes. (Yeah, I had to do this many times. It's scary the first time, but you get use to it after a while.)
Good luck!
Click to expand...
Click to collapse
If you backup the original services.odex before you replace it with the modified one then if you get stuck in a bootloop you can just use adb shell commands to copy it back and then do adb reboot. This worked for me anyways. Faster then doing a full restore.
Of course you should still to a backup beforehand.
I followed all of these instructions. Link: Here
But when I try to navigate to AndroidSDK folder in my home directory I can't get adb shell to start.
Code:
cd ~/AndroidSDK/tools
adb shell
After that the terminal says command not found and stuff.....anyone know how to set up adb shell on linux? (I'm running linux mint 10 specifically but I am a experienced linux user, i've used ubuntu and linux mint 10, so if you give me ubuntu commands for fixing this i can convert them into linux mint commands if need be).
Thanks for helping me get this set up on linux. I've mainly been a windows user and as easy as it would be for me to dual boot into windows instead i'm trying to make linux my main operating system slowly b/c i'm liking this operating system more than windows 7. so before i do that I want to make sure i know how to complete all the task i would want to do on windows 7 on linux instead, starting with adb shell
Those instructions are for an earlier version of android SDK. I am sure you downloaded and installed the latest from google's official website. If so, the adb command has moved to a different folder - platform-tools.
Do a search in the android sdk folder for "adb.exe", you should be able to find it and then use that folder as your base adb folder. Alternatively, you can setup the folder to be part of the path, that way you can execute adb from anywhere. If you need help, let me know.
andythegreenguy said:
Those instructions are for an earlier version of android SDK. I am sure you downloaded and installed the latest from google's official website. If so, the adb command has moved to a different folder - platform-tools.
Do a search in the android sdk folder for "adb.exe", you should be able to find it and then use that folder as your base adb folder. Alternatively, you can setup the folder to be part of the path, that way you can execute adb from anywhere. If you need help, let me know.
Click to expand...
Click to collapse
Can you give me full instructions on how to set up adb using the latest android sdk from google? Thanks
Sent from my DROIDX using XDA App
kifno said:
Can you give me full instructions on how to set up adb using the latest android sdk from google? Thanks
Sent from my DROIDX using XDA App
Click to expand...
Click to collapse
What I found when setting up mine on linux was to start adb, navigate to the tools directory where you have it setup, and use the command "./adb shell" minus the quotes. This seems to work fine, I don't know why. I beat my head against the wall, and don't remember how I found out about this. It's safe to say, the ./adb should need to be used with all the adb commands.
Kifno check the dev section for my thread on how to install adb on Ubuntu should help you out. It might be buried but I posted a full guide.
Edit---- If you look on my thread on how to indtall adb in windows. On the bottom of the post its a link to my other thread..
Yea it's me Again. With the
Modified .HERO.
Step-by-step guide to setting up android sdk on linux:
1. On your linux box, go to http://developer.android.com/sdk/index.html and download the package for linux
2. Create a "androidsdk" folder in your home folder
3. Unzip the contents of the "android-sdk-linux_x86" from inside the tgz file - into the above folder. You should have "add-ons", "platforms", "tools" and "SDK-readme.txt" in the above folder
4. Open a terminal window and navigate to androidsdk -> tools directory
5. Execute command "android" without quotes - this should open a UI
6. Go to available packages and install all packages you need
7. Once it has installed everything, exit the application
8. Navigate to your androidsdk/platform-tools directory - you should have adb there.
Now you can run adb from here or setup your computer to run from anywhere - following steps are to setup so that you can run adb from anywhere...
1. Append the following code in your .profile file - replacing "full path to your platform-tools directory" with the actual path with quotes:
if [ -d "full path to your platform-tools directory" ] ; then
PATH="full path to your platform-tools directory:$PATH"
fi
2. Save your .profile
3. Logout and log back in.
Now you should be able to execute adb from anywhere on the linux box, when you login using your credentials.
andythegreenguy said:
Now you can run adb from here or setup your computer to run from anywhere - following steps are to setup so that you can run adb from anywhere...
1. Append the following code in your .profile file - replacing "full path to your platform-tools directory" with the actual path with quotes:
if [ -d "full path to your platform-tools directory" ] ; then
PATH="full path to your platform-tools directory:$PATH"
fi
2. Save your .profile
3. Logout and log back in.
Now you should be able to execute adb from anywhere on the linux box, when you login using your credentials.
Click to expand...
Click to collapse
the bold is where i'm having trouble....where is the .profile file located?
also would this be the correct full path leading to platform tools? (so i can know when i get ready to do the .profile file thingy once you explain that)
~/AndroidSDK/platform-tools
btw thanks for the help (clicking thanks button.....lol)
edit: i also just got this problem
Code:
kevin-Satellite-L305 platform-tools # ./adb shell
error: insufficient permissions for device
it won't let me launch adb shell even after i typed su and put in my password
.profile is in your home directory. You can get to your home directory from anywhere in linux by typing "cd $HOME" at the shell prompt without quotes and as is here. If you know of DOS, you can relate to a .profile file as an autoexec.bat, that executes everytime a user logs in.
You need the absolute path to the platform-tools folder - which you can get by being in that folder and typing "pwd" without quotes.
The last error, it has something to do with your computer OS not recognizing your device.
1. Go to /etc/udev/rules.d
2. Look for a file 99-android.rules - if one does not exist, create one
3. Append the following line to the file: SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", OWNER="linux user name" GROUP="linux user group", replacing linux user name and linux user group with the actual values.
4. Save the file and restart your computer
This should do it.
If you're like me, you find the adb debugging notification to be unnecessary and aggravating. Here's the simplest way to get rid of it.
Disassemble the services.jar using baksmali or apktool. Navigate to NotificationManagerService.smali. Search for this line
Code:
iput v7, v6, Landroid/app/Notification;->icon:I
Simply comment it out
Code:
#iput v7, v6, Landroid/app/Notification;->icon:I
Reassemble and adb push services.jar /system/framework/services.jar
No more stupid and unecessary adb debugging notification
For those not savy with smali/baksmali or apktool/apkmanager, I have attached a modded services.jar with the edits. Remove the .zip ending (xda won't lemme attach .jar) and adb push services.jar /system/framework/services.jar.
BTW: I used the SbrissenMod services.jar as a base to include his previous edits/mods.