> Attention!

New threads need to be created only inroot partition! In the future, they will be processed by moderators.



Editing system apk for Samsung GT-i9000 Galaxy S. | Discussion, exchange of experience.



Rep: (1151)
Editing system apk Samsung GT-i9000 Galaxy S
Discussion, exchange of experience

In this topic, we share our experience and discuss the nuances of editing system software Samsung Galaxy S.
Ready modifications, decorations and requests for their creation are published in the relevant topics:
Modification of software and decorations for the Samsung Galaxy S
Decorating orders table for Samsung Galaxy S I9000

Useful links:


Post has been editedLares - 12.11.11, 16:21



Rep: (1151)
Guide for editing system apk SGS for beginners


What you need:
  1. Jdk ;
  2. Android SDK ;
  3. Archiver for exampleWinrar ;
  4. APKTool (two archives: 1 and 2 )
  5. APK Manager either Russian .
For official firmware also:
  1. Auto-deodexer
  2. Ultra ISO

Getting started
Install JDK, Android SDK. In .. \ Program Files \ Android \ android-sdk-windows \ run the SDK Manager.exe and in the Installed Packages update all tools - Update All. After Windows PCM on My Computer ->System properties ->Additionally ->Environment variables must be set to the path to them at the end of the Path item, separated by a semicolon. I did this:
C: \ Program Files \ Java \ jdk1.6.0_21 \ bin \; C: \ Program Files \ Android \ android-sdk-windows \ platform-tools \; C: \ Program Files \ Android \ android-sdk-windows \ tools \;

The contents of the two archives with APKTool unpacked in the Windows folder.
APK Manager is unpacked into any folder, from the archive with APKTool, the apktool.jar file besides Windows is also copied and replaced with the other folder in the APK Manager. In order to unpack the system files from our phone in the future, you need to connect it to a PC with "USB debugging" enabled and enter in the command line:
adb pull system / framework / twframework-res.apk twframework-res.apk

apktool if twframework-res.apk

It should turn out as on the screen:
Attached Image


Everything is ready to go.

Video Example with APK Manager : http://www.youtube.com/watch?v=OPynKz22flg

Some resources in the decapile form (unpacked apk) are placed a little differently than in compiled (ready apk):
projects \ name.apk \ res \ - in the compiled form also the res folder in the apk root
projects \ name.apk \ res \ values ​​* \ - the compiled file resources.arsc in the apk root
projects \ name.apk \ smali \ - the compiled file classes.dex in the apk root - it’s also the name.odex - if there is one (for example, on official firmware), then before editing apk you need to deodex:
Deodexing apk
Unpack the archive Auto-Deodexer in any folder. To deodex the system apk we need from SGS, we need a framework from our firmware. If we are sitting on some mode, then just open the zip with it, go to the \ system \ framework \ and extract all the contents to the folder with the Auto-Deodexer in the root (NOT to the framework folder). If the firmware is official, then open tar or md5 with it in the archiver, extract it to any factoryfs.rfs folder, open it with Ultra ISO program or similar, and extract the contents of the framework folder to the folder with Auto-Deodexer.

In the app folder, copy our cloaked apk and odex files. For example, Phone.apk and Phone.odex. Run deoall.bat. We need the second item:
2 Deodex a non-stock rom (custom bootclasspath)

Enter 2, we are asked to specify BOOTCLASSPATCH, we write "twframework.jar" without quotes and press Enter. Upon completion, go to the deodexed_APK folder and see our deodexed apk there. But the system apk after such caching will not work, you need to manually extract the classes.dex file from the received apk file and put it into the original apk (by analogy with other resources after editing the APK Manager). File name.odex delete.


When you have figured out how to rule, you can proceed to the question of what to rule.
Below is a list of popular contact mods, dialers, dialers and sms, using JPY as an example:
Change the alphabet strip in the contacts
Contacts.apk \ res \ values-ru \ strings.xml

Line 575:
\ # AGREELSKLMNOPRSTUFHTSCHSHYYAZAZ

Change the character set to any. In order for the alphabet to fit completely, the number of characters must not exceed 27.
If the non-Russian language menu is selected on the phone, then we edit strings.xml in the values ​​folder with the identifier of your language. For example, values-uk for Ukrainian.

Displaying the name of the subscriber in the dialer in a few lines
Phone.apk \ res \ layout \ call_card_person_info.xml

Lines 8-11:




android: layout_height - block height in dip (1 dip = 1.5 px) two times
android: layout_marginTop - indent from the top
TextView android: textSize - font size
android: gravity - leveling
android: singleLine - output text in one line, change true to false and append separating with spaces android: lines = "3" (in quotes the required number of lines)

On the example of how it is donePako777 in his Phone B:




Also, in line 12 you can edit the font and the position of the subscriber number:


Increase photo contacts
Here, for a full increase, you will need to edit two files: Phone.apk and Contacts.apk.

Phone.apk \ res \ layout \ call_card_person_info.xml

Lines 4-7:




123.0dip - width / height of the photo output field of the subscriber in the dialer window (change three times)

The first part is ready, but leaving the editing at this stage, we get only a photo of the old size, scaled, which badly affects the quality. To do this, you need to teach Contacts.apk to assign large sized photos.

Contacts.apk \ res \ values-hdpi \ dimens.xml

Line 3:
185.0px

We change the value to the same as indicated in Phone.apk \ res \ layout \ call_card_person_info.xml, not forgetting that there the size is registered in dip, and here in the usual px. (123dip = 185px, 1dip = 1.5px)

After that, all the photos on the contacts need to be reassigned. And an important point: when synchronizing Google, it compresses all photos to 96x96 px, so you need to back up contacts with third-party tools.

Deleting a rising call
Phone.apk \ smali \ com \ android \ phone \ Ringer $ 1.smali

Line 236:
invoke-virtual {v1, v5, v3, v4}, Landroid / media / AudioManager; -> setStreamVolume (III) V

Remove it completely.

Russian buttons and Russian search in the dealer
DialertabActivity.apk \ smali \ com \ sec \ android \ app \ dialertab \ dialer \ DialerActivity.smali

In this file, all the characters for the search are given in a similar way:
.line 1969
const-string v6, "2"

invoke-virtual {v5, v6}, Ljava / util / ArrayList; -> add (Ljava / lang / Object;) Z

.line 1970
const-string v6, "a"

invoke-virtual {v5, v6}, Ljava / util / ArrayList; -> add (Ljava / lang / Object;) Z

.line 1971
const-string v6, "b"

invoke-virtual {v5, v6}, Ljava / util / ArrayList; -> add (Ljava / lang / Object;) Z

.line 1972
const-string v6, "c"

invoke-virtual {v5, v6}, Ljava / util / ArrayList; -> add (Ljava / lang / Object;) Z

And just below:
.line 1976
.restart local v1 #cc: Ljava / lang / String;
const-string v6, "2"

invoke-virtual {v1, v6}, Ljava / lang / String; -> concat (Ljava / lang / String;) Ljava / lang / String;

move-result-object v6

invoke-virtual {v5, v6}, Ljava / util / ArrayList; -> add (Ljava / lang / Object;) Z

.line 1977
const-string v6, "a"

invoke-virtual {v1, v6}, Ljava / lang / String; -> concat (Ljava / lang / String;) Ljava / lang / String;

move-result-object v6

invoke-virtual {v5, v6}, Ljava / util / ArrayList; -> add (Ljava / lang / Object;) Z

.line 1978
const-string v6, "b"

invoke-virtual {v1, v6}, Ljava / lang / String; -> concat (Ljava / lang / String;) Ljava / lang / String;

move-result-object v6

invoke-virtual {v5, v6}, Ljava / util / ArrayList; -> add (Ljava / lang / Object;) Z

.line 1979
const-string v6, "c"

invoke-virtual {v1, v6}, Ljava / lang / String; -> concat (Ljava / lang / String;) Ljava / lang / String;

move-result-object v6

invoke-virtual {v5, v6}, Ljava / util / ArrayList; -> add (Ljava / lang / Object;) Z

Each character corresponds to several lines of code, and each character is given in two places. Without going into details, it can be understood that the code snippets above are the values ​​for the numeric key 2, on which Latin a, b and c are placed. For the rest of the keys is similar. To make it possible to search in Russian, you just need to write Russian characters in each key in the same way.unicode. This means that in the code instead of the usual "a", "b", etc. will be: "\ u0410", "\ uo411", etc. The whole Russian alphabet:
\ u0410 A
\ u0411 B
\ u0412 V
\ u0413 G
\ u0414 D
\ u0415 E
\ u0401 E
\ u0416 F
\ u0417 W
\ u0418 And
\ u0419 nd
\ u041A K
\ u041B L
\ u041C M
\ u041D H
\ u041E About
\ u041F P
\ u0420 P
\ u0421 C
\ u0422 T
\ u0423
\ u0424 F
\ u0425 X
\ u0426 C
\ u0427 h
\ u0428 W
\ u0429 u
\ u042A b
\ u042B s
\ u042C b
\ u042D E
\ u042E Yu
\ u042F I


\ u0430 a
\ u0431 b
\ u0432 in
\ u0433 g
\ u0434 d
\ u0435 e
\ u0451 g
\ u0436
\ u0437 s
\ u0438 and
\ u0439 th
\ u043A to
\ u043B l
\ u043C m
\ u043D n
\ u043E o
\ u043F p
\ u0440 p
\ u0441 with
\ u0442 t
\ u0443
\ u0444 f
\ u0445 x
\ u0446 q
\ u0447 h
\ u0448 w
\ u0449 u
\ u044A СЉ
\ u044B s
\ u044C
\ u044D uh
\ u044E
\ u044F me

Visually, it looks like this:
Attached Image

Attached Image

Attached Image

On the screenshots you can see that the code corresponding to the Latin a, b and c on the two, is written (red) code for our A, B, C, D in Unicode. In addition to lines beginning with .line and const-string v6, all the others are repeated each time. Digit after each .linemust be unique for all codethis:
fguy @ 01/22/2011, 21:37*
The Java tag that is used when reporting error messages, if you are afraid that the code you are inserting will have glitches enter any of your numbers and they will be in the log and make it easier for you to debug, and if you are sure that everything is good, just do not write anything.

Well, after each const-string v6 in quotes, our Russian characters are in Unicode. Described messy, but explained how I could, I can rejoice that remembering all this and manually editing each line is not necessary. In fact, everything is much simpler than it might seem at first glance, this can be seen by comparing two files of DialerActivity.smali, the first from deodexed JPY, the second from the same one, but already edited by me and with bolted search.
Pick up here:Attached filedialersmali.rar(42.17 KB)

Compare, for example, in Total Commander by content, and all changes are evident. You can copy different pieces of code (without paying attention to any different single lines or pieces of code that do not correspond to the one described above - if such occur, simply ignore them). If the comparison of the content shows exactly 16 differences inside, then you can safely replace your DialerActivity.smali with mine, you do not need to rule anything at all.


Russian buttons are carried out by replacing the graphics in DialertabActivity.apk \ res \ drawable-hdpi \
For a standard skin:Attached filedigits.rar(50.96 KB)


Display the date of sending incoming SMS instead of the date of receipt (experimentally)
Mms.apk \ smali \ com \ android \ mms \ transaction \ SmsReceiverService.smali

Line 573:
invoke-static {}, Ljava / lang / System; -> currentTimeMillis () J

Change to:
invoke-virtual {p1}, Landroid / telephony / SmsMessage; -> getTimestampMillis () J

Line 2294:
invoke-static {}, Ljava / lang / System; -> currentTimeMillis () J

Change to:
invoke-virtual {p1}, Lcom / android / internal / telephony / gsm / SmsMessage $ PduParser; -> getSCTimestampMillis () J


Endless thankssk0tfor help and education.


Post has been editedroly - 11.01.12, 10:24
Reason for editing: + from saker



Rep: (111)
Lar3s,
Write down, please, about signing system apk. Which option to get such apk is the easiest (fastest). I think it will be very useful for beginners in connection with the title of the topic, and there will be a lot of questions that will disappear immediately.



Rep: (1151)
Write down, please, about signing system apk.

And they do not subscribe.) I edit, and then replace the resources in the original. If you can do without it, I do not know how. What I tried did not work.

Post has been editedLar3s - 03.03.11, 23:54



Rep: (111)
Romma @ 01/15/2011, 00:19*
In the Market there are free Signapktic and ZipSigner programs (there are here), they sign in the phone itself. I signed up with several reworked programs.

I correctly understood that you can collectsystemic apk via apkmanager and sign it with Signapktic (choose platform type?) and the system will accept it? Just after reading the forum, I have clear information that the system apk should be signed by the samsunga signature, which should coincide with the signature of all other apk systems (especially the framework). That is exactly the way Lar3s it seems to be the only correct one. Something I did not understand?

Post has been editedakifjev - 15.01.11, 10:28



Rep: (1979)
I correctly understood that you can build a system apk through apkmanager and sign it with Signapktic (choose platform type?) And the system will accept it?

All apk that are in system / app and system \ framework do not need to be signed - you just need to replace or (and) add files to an existing apk or repack it with the same winrar with the exception of files for compression "* .arsc * .png *. ogg * .jpg * .gif * .mp3 ", it is better to take files for modification from the phone or by unpacking the firmware that was recorded in the body
Another note to the cap - put the version of the android sdk with which you work yourself, but not higher than 2.2, because aapt.exe is used by apktool when compiling resources, the one that is in APK Manager is a bit earlier build and 2.2.1 there may be some inconsistencies - try replacing it with aapt.exe from sdk for 2.2. Also apktool decompilit resources in the format incompatible with aapt from sdk 2.3, seems to be suitable from 2.2, but did not check

Post has been editedfguy - 15.01.11, 11:05



Rep: (111)
fguy @ 01/15/2011, 10:52*
repack it using the same winrar with the exception of files for compression "* .arsc * .png * .ogg * .jpg * .gif * .mp3"

There is exclusive information from experienced modders that with the packaging of pictures you can not bother, even if they are packed everything works on SGS. I did not check it myself.



Rep: (1757)
With the packaging of pictures you can not bother

I confirm and give a hand on clipping. For png, jpg compression is not critical. This is the compression format for images. Open any apk and see. Many pictures that before compression, that after have the same size. The rest of the account goes tobytes.
About other files, I do not know, did not add, but I think the same story.
Even with the firmware M8 I transfer the pictures there and there, no problems. Butresources.arsc in no case can not compress.
PS Supplement that there was no misunderstanding.
I use WinRAR. In it, the default compression method is normal. I repeat, no problems with the apk.

I have clear information that the system apk should be signed

Forget about it and do not bother.

By the wayHERE sk0t From and to painted editing framework-res.apk. I think the link should be in the header. Actually for our device.

Post has been editedloza100 - 15.01.11, 13:51



Rep: (1979)
loza100 @ 01/15/2011, 13:01*
I confirm and give a hand on clipping. For png, jpg compression is not critical. This is the compression format for images. Open any apk and see. Many pictures that before compression, that after have the same size. The rest of the account goes to bytes. About other files, I do not know, did not add, but I think the same story.

The apk is in fact a classic zip, it's not a matter of the compression ratio and the gain received, but in the unpacking method, if you put it without compression, the file is simply copied from the archive to the buffer into the RAM, but if it is compressed, then the appropriate unpacking algorithm runs much slower than direct copying as it processes each byte separately, I think the requirements of the droid feng shui to the packaging of the apk are not formed because of the developers' whim



Rep: (1757)
Romma @ 01/15/2011, 13:24*
Then the question. When replacing the camera icon (only 1 icon), the program does not start, why?

I'm running the same. Take out of my update (or look at the screenshots) apk and see how many icons are replaced. All of them are added with normal compression.
and signed there

Sorry, are you reading posts? I personallynever signed up. Never once. And third-party too:) And the icons change, and everything works.
However, if you want, sign. As they say, just to work. :)

fguy, I agree, what you write has some meaning. But I think it is not visible through the eyes.
As far as I understand, we are talking about the fact that when inserting / replacing .png * .ogg * .jpg * .gif * .mp3 into the archive, they cannot be compressed, because the apk will not work. It will be as pretty !!!
For example, aboveRomma writes about the signature. Maybe it was something else?

Post has been editedloza100 - 15.01.11, 17:29



Rep: (1)
then tell me the guru how to do ...
Huawei u8230 phone in native firmware 2.1 in contacts immediately was the search string on the notebook.
Now the phone is altered to a custom cyanogen mode pulse 5, there, to start the search, you need to tap on the hard button and select the search, it is not convenient
What did you do:
I went through the root manager in my native firmware in the system \ app pulled contact.apk and contactprovider.apk from there
I installed custom firmware and slipped these files into the system \ app. the notebook disappeared altogether and an error flies (for some process)
by installing apk and agreeing to replace the system files, too, no result ....
what else can you try? Can they be stuck in the firmware before installing it in the phone? Or try to put in zip and flash through recovery?



Rep: (111)
phone Huawei u8230

SGS (Samsung Galaxy S) is discussed here.
Do you feel betterhereturn to.



Rep: (1)
akifjev there is about the framework, and then just about editing the apk ... no matter what phone, I think that the principle of picking system apk will be the same for everyone



Rep: (9)
It would be cool to change the system apk files from via adb shell while running 3e. It's inconvenient to mess with these update.zip.
However, I can’t get super user rights through su. In principle, everything is clear - during normal operation, su displays a notification “whether to give such a program the superuser rights,” and here the graphic part of the android is not running, so it’s not possible to display a window with a question. Maybe someone knows a way, how can I get su to give me superuser rights in recovery mode without confirmation?



Rep: (1979)
Maybe someone knows a way, how can I get su to give me superuser rights in recovery mode without confirmation?

and in the normal mode, pick up the cable and enter the adb shell from the computer and give it su, and confirm the resolution on the screen so that it would be registered in the database - it won't ask any more, maybe it will work through the recovery
And how bad is it to change files in systems in normal mode through adb? give sync after replacement and reboot.
My root is made through super-cone and core JPY. I noticed that through the adb shell, the su command does not get write permissions to the systems until you connect it to the recording in the ruteexplorer.
The main thing in this business is that there is a place in the systems, otherwise many do not take this into account and start stuffing a new framework-res.apk with the size of 7-8 meters there, when there are only 3 free after the firmware - as a result, the new one does not fit and the old one is deleted in the end cramps
can anyone help my experienceModification of software and decorations for Samsung Galaxy S (Post # 6022450)

Post has been editedfguy - 16.01.11, 21:27



Rep: (9)
Well, just when the main system is loaded, these files are used with might and main, I fear all sorts of unwanted effects. I basically do as you say and do now - via adb with the Android loaded in normal mode and immediately reboot. And why should I run the sync command before rebooting? I did not do it seems to work :)
For some reason, when the system boots into recovery mode, it is not mounted / data /, so the hike cannot su to access the database with a list of programs that are allowed full access to the system.

Post has been editedvegogo - 16.01.11, 23:40



Rep: (1151)
saturn112 pick a diler search in all fields + in any sequence (not only from the first letter).
But while there is a jamb: the wrong search highlighting. Searches around, and still highlights only the first letters of the name:
Attached Image

What do you mean where:
DialerTabActivity.apk \ smali \ com \ sec \ android \ app \ dialertab \ dialer \ DialerActivity.smali

Lines 8073-8077:
invoke-virtual {v0, v1}, Ljava / lang / String; -> concat (Ljava / lang / String;) Ljava / lang / String;

move-result-object v5

aput-object v5, v7, v3

Replace with:
invoke-virtual {v1, v0}, Ljava / lang / String; -> concat (Ljava / lang / String;) Ljava / lang / String;

move-result-object v5

invoke-virtual {v5, v1}, Ljava / lang / String; -> concat (Ljava / lang / String;) Ljava / lang / String;

move-result-object v6

aput-object v6, v7, v3

Lines 8687-8691 (after the first replacement they are 8691-8695):
invoke-virtual {v0, v1}, Ljava / lang / String; -> concat (Ljava / lang / String;) Ljava / lang / String;

move-result-object v5

aput-object v5, v7, v3

Replace with:
invoke-virtual {v1, v0}, Ljava / lang / String; -> concat (Ljava / lang / String;) Ljava / lang / String;

move-result-object v5

invoke-virtual {v5, v1}, Ljava / lang / String; -> concat (Ljava / lang / String;) Ljava / lang / String;

move-result-object v6

aput-object v6, v7, v3


Information is irrelevant, all problems are fixed. Ready solution fromfguy : go over .

Post has been editedLar3s - 25.03.11, 13:00



Rep: (56)
Lar3s @ 01/08/2011, 14:04*
C: \ Program Files \ Android \ android-sdk-windows \platform-tools \; C: \ Program Files \ Android \ android-sdk-windows \ tools \;


you can clarify, in the first path should be just \ platforms instead of \ platform-tools?
because I have only the add-ons, platforms, tools folders inside the android-sdk-windows folder ...

P.S.
I did everything as in the instructions (after the environment variables I unpacked 2 archives into the Windows folder, unpacked the apk manager and put the correct apk in the others folder), does not want to recognize adb in the command line, it does not write to an external or internal command, executable program or packet data. ..
what did you miss?

Post has been editeduzzzde - 18.01.11, 04:34



Rep: (4013)
saturn112 picked up the search in the diler for all fields + in any sequence (not only from the first letter).
Perhaps someone will have ideas how to bring to mind.

I give a free idea ... even two -
1. the highlighting comes from the first character of the concatenated string ... change the algorithm by writing an additional code to determine the initial position of the search string, and substitute this position at the beginning of the code that draws the highlighting
2. remove the backlight all the fuck .. - it will become easier



Rep: (83)
Pako777 @ 01/18/2011, 08:04*
I give a free idea ... even two -

I have not yet found where this is going.



Rep: (4013)
Saturn112 @ 01/18/2011, 12:02*
I have not yet found where this is going.

I am not you, butLar3s gave ideas ..: D
Well, if you, then it is not clear what you mean by the word "this" .. if the backlight, then try to focus on the "blue" color, which the backlight is drawn .. where it is used - from there and dance .. not the fact that all sitting in smly .. perhaps feel and hml have


Full version    

Help     rules

Now: 07.21.19, 14:57