in order to get a mod to work in my theme i need to add a couple strings to my public.xml thats found in my framework-res.apk. i used ultracompare to compare 2 different xml files and i know what needs to be added to my xml file. i use notepad ++ to edit values but never added strings.
1. can i use notepad++ to add the strings to my public.xml?
2. does it matter what line they end up on?
I use Open XML Editor, but I am sure you can use whatever works best for you. Notepad would hurt my brain though.
As far as the Public.XML, I don't think you can just remove and add lines to it...
The way it was explained to me was that any extra or new pngs added to a theme will be added into the Public.xml by way of "aapt". So there is no need to add. As far as removing items... well the entries are all coded a specific way so if you remove line 100... then everything from 101 to the end will be off by 1 and cause a lot of problems. An example...
<public type="attr" name="exported" id="0x01010010" />
<public type="attr" name="process" id="0x01010011" />
<public type="attr" name="taskAffinity" id="0x01010012" />
<public type="attr" name="multiprocess" id="0x01010013" />
<public type="attr" name="finishOnTaskLaunch" id="0x01010014" />
So as you can see the id used increases and then is associated with a specific item from within your apk. So as far as I know the best way to modify something (like a theme or etc) is to work with a Public.XML that has less in it so you can add to it... or just keep all those items in there (pngs, etc) and just make them a 1x1 image. Not the best way... but from what I have seen it has been done by many a theme maker and ROM builder.
Hope that answers your question.
** edit **
I just realized that I may had confused you (not knowing your knowledge level) so... The items are added to the Public.XML when you build the APK back together after editing it. This can be done with the apktool, which uses the aapt to do it's job. At least that is how it has all been explained to me so far. I also need to modify a Public.XML for my framework-res.apk and ran into problems here.
You don't need to worry about adding pngs to the public.xml. just put the pngs in place in the decompiled apk along with the xml that's using the pngs. You can't add pngs that aren't being used, which is the only requirement.
Run 'apktool b' to rebuild the apk and the pngs should be added to the public.xml. that data will be in the resources.arsc file in the new apk if you had no errors. Copy that to your original apk and you're set.
You can decompile your recompiled apk if you want to see the newly added entries to the public xml. But that's just for fun.
Note; I found in the framework 21 for backflip that there was no more room for draw9.png images, just regular pngs.
Also, if you copy any1 else draw9.pngs from their apk make sure you copy the png from an unzipped apk and not a decompiled apk. Decompiles adds the 1 pixel ring around the image that wont go away unless recompiled. And you can't replace draw9 images to recompile or apktool will try to add it as a new draw9.png to public xml and error out. Just insert to your original apk.
That should cover all bases.
Im sorry, the second post threw me off. You said strings specifically. I would think the rule should apply the same. Use the string in an xml and the string is declared in another xml in the values folder, I think its strings xml. The compiled string resources will be in the resources.arsc file in the new apk.
djstaid said:
I use Open XML Editor, but I am sure you can use whatever works best for you. Notepad would hurt my brain though.
As far as the Public.XML, I don't think you can just remove and add lines to it...
The way it was explained to me was that any extra or new pngs added to a theme will be added into the Public.xml by way of "aapt". So there is no need to add. As far as removing items... well the entries are all coded a specific way so if you remove line 100... then everything from 101 to the end will be off by 1 and cause a lot of problems. An example...
<public type="attr" name="exported" id="0x01010010" />
<public type="attr" name="process" id="0x01010011" />
<public type="attr" name="taskAffinity" id="0x01010012" />
<public type="attr" name="multiprocess" id="0x01010013" />
<public type="attr" name="finishOnTaskLaunch" id="0x01010014" />
So as you can see the id used increases and then is associated with a specific item from within your apk. So as far as I know the best way to modify something (like a theme or etc) is to work with a Public.XML that has less in it so you can add to it... or just keep all those items in there (pngs, etc) and just make them a 1x1 image. Not the best way... but from what I have seen it has been done by many a theme maker and ROM builder.
Hope that answers your question.
** edit **
I just realized that I may had confused you (not knowing your knowledge level) so... The items are added to the Public.XML when you build the APK back together after editing it. This can be done with the apktool, which uses the aapt to do it's job. At least that is how it has all been explained to me so far. I also need to modify a Public.XML for my framework-res.apk and ran into problems here.
Click to expand...
Click to collapse
I am getting same problem as OP. You said that new PNGs or something are automatically added in public.xml right? But I am not able to see them. Actually, i added 5 more indeterminate progress bars and edited the animator xml for it too. The app compiled with apkmanager, but after decompiling the same, I don't see the new indeterminate PNGs declared in the public.xml.!! Plz. help me! I can't just flash and test immediately!! cause i don't have that phone!!
No they are not added automatically you have to add it yourself.
Only add or change lines don't remove.
For public.xml
Everything is grouped
Each group has an order
Drawable will be
0x7......00
0x7......01
................
0x7......ff
Remember they use letters also
You can add a new item
0x7.......g0
They have to be in order by resource type
String would start with ex...
0x6......00
Find the last string id that was used and add the next id.
Remember they are not always in order so actually use the text search to be sure.
Not sure if you already added the string to the strings.xml
That has to be done also.
For that open strings.xml
Copy the last line
Paste it to next line
Change string name (must match public.xml) and than value (what text is displayed)
Let me know if you need more help.
Sent from my PG86100 using Tapatalk
Here is a write up i was planning on doing for my site
decided to start it now.
Add resources to an android apk
Its just a start but should be able to do it with out problems
wes342 said:
Here is a write up i was planning on doing for my site
decided to start it now.
Add resources to an android apk
Its just a start but should be able to do it with out problems
Click to expand...
Click to collapse
Oh mahhnn!! Thanks a lot for that!! Now I don't need to depend on crappy tools for adding resources any more!!!
Once again, thanks a lot for that!!
So when i understand it right i made it like that.
I wanna add "ab_bottom_solid_dark_holo.9.png" to mms.apk.
I copy it to "drawable-xhdpi". I open "public.xml" and scroll to the end of "<public type="drawable" ". Last string is:
"<public type="drawable" name="stat_notify_sms_9" id="0x7f020254" />"
Click to expand...
Click to collapse
So i make a line under that and that would be that:
<public type="drawable" name="ab_bottom_solid_dark_holo" id="0x7f020255" />
Click to expand...
Click to collapse
In the whole xml is no other "7f020255". So that would be all? No other changes to do?
Basian Mile said:
So when i understand it right i made it like that.
I wanna add "ab_bottom_solid_dark_holo.9.png" to mms.apk.
I copy it to "drawable-xhdpi". I open "public.xml" and scroll to the end of "<public type="drawable" ". Last string is:
So i make a line under that and that would be that:
In the whole xml is no other "7f020255". So that would be all? No other changes to do?
Click to expand...
Click to collapse
Everytime I've added a drawable, or a string, to my apps, I've never had to put them into public.xml
All I do is compile and they're added automatically. The only time I need to touch public.xml is if I want to remove something.
That would be nice. iam on JellyBean on my Galaxy Nexus and use apktool cmd. And it just gave me errors.
What do u use to compile. Maybe its a nice Tool with more Functions.
Hey all, this would probably be only interesting to those who are receiving 2kb, 160x120 MMS messages. Using TMO-USA as an example, the X10 received large MMS images with 1.6, but I'm guessing it doesn't recognize the uaprofile of 2.1 and now are getting tiny mms images. This could also help others on other networks that have the same problem.
Cyanogenmod has an option to switch the profile. Someone else on XDA has posted some of the changes, and those can be found here.
I'm thinking that since I don't think we can compile a new mms.apk, maybe it's possible to edit the current mms.apk with the uaprofile from a different phone (probably the t717/equinox for the tmo users)? Hopefully it's not encrypted or anything either...
So off I go into root explorer and I can't find any mms.apk in my x10. hmm, so i adb shell into it and still no mms.apk. I can't get too far if I can't find the mms application, lol.
so does anyone know what SE uses for mms? or if I'm just simply not seeing it?
obviously, i'm new to working with android, i'll pick up more as time goes on thanks for any help!
Bah! Just in case anyone else looks, I think I found it... sigh.
I searched through the /data/data/ folder and found a reference to 'ericssson' (part of what would be the normal uaprofile text) in com.sonyericsson.converstations_preferences.xml... converstations, eh? makes sense... and yes, there's a converstations.apk
so far i've unzipped it and found 'mms_config.xml' that has max file size and dimensions... but i think this might be only for outgoing mms...
I could be wrong, but isn't it conversations.apk
EDIT: nevermind, looks like you already found it lol
Curious
Thanks for trying to work on it. I would love to have a fix to these small picture messages on T-mo US. But is it possible that the small picture sizes have something to do with T-mo's services somehow???
motibbs96 said:
Thanks for trying to work on it. I would love to have a fix to these small picture messages on T-mo US. But is it possible that the small picture sizes have something to do with T-mo's services somehow???
Click to expand...
Click to collapse
It was working fine with 1.6 but when the X10 jumped up to 2.1, mms images were small. So to me, that means that the tmobile no longer recognizes the phone and it goes automatically downsizing all incoming images.
What I'm not sure is if TMO checks the url of the phone's uaprof or if it just looks at the url and just checks it against their own database. I'm thinking the latter.
Another thought might be if TMO just looks at the specs that the phone gives. The reason for this last question is because X10 1.6 had a max size of 640x480 (not sure if this was receiving or sending) at 1 meg (tmo only handles 300k max). with X10 2.1, it states a max size of 1600x1200 and a max size of 1 meg. Maybe it thinks 1600x1200 is too big and it hits some trigger on TMO's side to only send the fallback size (160x120)
I would recommend emailing customer service (and for anyone else having the same issue with their respective provider) and seeing if they can add the uaprof of the x10i (url) to their database. I know this UAprof is from the v24 update. I'm not sure if it's any different for the DT update or the first 2.1 update. It's not a permanent solution but it's all we have for now.
I thought I'd also post an update, in case if anyone has any thoughts on what I might be doing wrong or helpful tips.
I searched the entire system directory for any text within the files that might relate to uaprof or udp or anything like that. Nothing. I think in 'normal' Android builds have a mm_property.conf file where we can change the uaprof info. So for now, I'm concentrating on converstations.apk and that specific file isn't located there (or anywhere). SE has to store this info somewhere so I think it's in a different conf file. But for the hell of it, I did a hex search for anything that might be related to uaprof (just in case a text search missed something). Again, nothing.
SE encrypted converstations.apk. So if it's in there somewhere, we have to decrypt it first. I'm looking into and reading on decrypting and repackaging the apk. Seems easy enough - I just need to learn a little more.
APN Settings
Name: T-Mobile US
APN: epc.tmobile.com
Proxy: 216.155.165.050
Port: 8080
Username: (leave this blank)
Password: (leave this blank)
Server: (leave this blank)
MMSC: http://mms.msg.eng.t-mobile.com/mms/wapenc
MMS Proxy: 216.155.165.050
MMS Port: 8080
MMS Protocol: WAP 2.0 (don't know if this is important)
MCC: 310
MNC: 260
APN Type: (leave this blank)
To create APN settings for your Xperia.
1. Go to 'Settings'
2. Select 'Wireless & networks'
3. Browse down to 'Mobile networks'
4. Browse down to 'Access Point Names'
5. Click the Menu (Left) button
6. Select 'New APN'
7. Key in the detail relating to your provider or carrier
8. Then press the radio button to select it
9. Save settings, reboot phone.
To test your network dial the following on your phone dial keypad to get into test mode: *#*#4636#*#*
Thanks for the help, but the issue isn't an APN setting. Just for giggles, I went ahead and changed the default APN settings to this and can confirm that it still receives small images.
So far I've decompiled the apk but haven't found the settings I need to change
Alright. So I've *properly* decompiled the apk (I'm working on the newest X10i build, v435). It references the UXprof url from framework-res.apk. I found where the url is in that file and changed it to the url for the Tmobile G2 (just to see if that change will work). Unfortunately, I need to recompile framework-res.apk and from everything I've read, it's recommended not to do that.
I'll keep on reading to see if I can do it, but has anyone recompiled framework-res.apk for the x10?
totalundone said:
Alright. So I've *properly* decompiled the apk (I'm working on the newest X10i build, v435). It references the UXprof url from framework-res.apk. I found where the url is in that file and changed it to the url for the Tmobile G2 (just to see if that change will work). Unfortunately, I need to recompile framework-res.apk and from everything I've read, it's recommended not to do that.
I'll keep on reading to see if I can do it, but has anyone recompiled framework-res.apk for the x10?
Click to expand...
Click to collapse
I've dealt with framework-res.apk before. It was just to add the Super Circle Battery, but I can tell you what works.
Compiling the APK seems to encrypt the XML files one by one. If you change any of the resources (like adding images), then you also need to compile a new resources.asrc. Fortunately, since it's a system file, you don't need to sign the APK.
Check this thread for lots of good info on modifying framework-res.apk (thanks to _calum_ and MrRusch):
http://forum.xda-developers.com/showthread.php?t=834806
Important points:
- The XML files and resources.asrc need to be compiled.
- The APK doesn't need to be signed.
- You can compile the XML and resources.asrc with APK Manager, then extract them from the "unsigned" APK it creates, and then reinsert them into a copy of the original APK using WinRAR (or your favorite zip tool).
- Compression should be set to "store" (a.k.a. no compression).
Be sure to have a backup copy of your original framework-res.apk. It's best to leave a copy on your SD card somewhere.
Be careful when replacing framework-res.apk. Copying it with Root Explorer isn't a good idea. I think the permissions get screwed up or something, and you don't have time to change it because it reboots right away. It's better to copy it onto your SD card and use the dd command through ADB.
adb shell dd if=/sdcard/framework-res.apk of=/system/framework/framework-res.apk
Click to expand...
Click to collapse
If you mess up, then you may not be able to boot the phone. Don't panic. ADB is still available even when it hasn't booted yet, so just use dd to replace it with your old one.
wow, i never would've thought the picture sizes had to do with my phone. hope you find a fix for this!
Thanks Grospolina! That info should help me a lot.
I actually tried to use root explorer at first... LOL. Stuck at the SE screen and I thought I bricked the phone but found out that my USB port on the monitor has quit working... Wasted a couple hours there. Sigh, lol.
I was using apktool since it's supposed to be framework-res.apk friendly but it kept on compressing the apk. I tried to adb push the file but it kept on saying I didn't have permissions. So I ended up using xrecovery to 'restore' the file in update.zip. I did a test mms but it was still small so I went ahead an cleared the davlik cache. I checked the file size of the modified framework-res.apk but either clearing the cache brought the original apk back or xrecovery update didn't work because the file size was the same as the original (apktools shrunk it down to nearly half).
anyways, I'll try it with that adb line.
There is one issue though. If I open up the original framework-res.apk file in 7zip, the file I need to edit doesn't appear. I'll try this but am not sure what to do if the xml file I need to replace doesn't appear.
bah, i can't ever get adb to replace a file. it always says that it's not writeable and then when i get su permission set, some other error happens. I'll figure it out... still reading... typical adb newbie issue, haha.
I don't have enough time right now (or in the next day) to keep on working on this but if anyone on tmobile usa with an xperia x10 wants to give it a shot, I've linked the apk below. The only change I've done so far is change a couple lines in style.xml. I'm not sure this is it for sure, but I can't rule it out yet.
sorry not trying to be rude or nething but i think you should say that this post is about the picture size...cuz a lot of times iv noticed that when you flash it erases your apn settings which is what you need to receive mms messeges in in the first place... just a thought
No offense taken!
I edited the title to reflect that it's to fix incoming picture mms size.
I hope you don't take offense, but this ISN'T an APN settings issue. I explained it several times earlier and it's been brought up before. It's a problem that been mitigated with custom roms because they have the ability to change their uaprof to something the network recognizes.
Several networks, one of which includes TMobile USA, default to a MMS picture size of 160x120 if it doesn't recognize the phone. This project's intention is to change the default uaprof in order for Tmobile USA (and eventually any other providers) to a uaprof of a supported handset.
mms - framework-res.apk - custom
I was totally on the wrong track with APN settings. Admit I saw MMS and jumped the gun without searching on anything. Had just been through all the baseband compatibility issues and APN setting seemed related
http://forum.xda-developers.com/showthread.php?t=830102 - theeedy - good job working with the settings on the Semc Camera Application, related in the compression of images taken by the default camera.
http://forum.xda-developers.com/attachment.php?attachmentid=355818&d=1278461264
This is MMS.apk - it's an interesting modification, couldn't find it easily within my phone.. decompiling it broke with Unknown Resources, which of course is referencing - /system/framework/framework-res.apk
I think it's related to someone's custom Framework-res.apk and used the default Android MMS app for ease of modifications. I'd say that could be the way to go about this and using the Android SDK in Eclipse or Netbeans is probably the right track.. not APN settings... sheesh! - Grospolina is on the money
package="com.android.mms"
Here are permission sections - might make sense..
Code:
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECEIVE_MMS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.WRITE_SMS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_DRM" />
<uses-permission android:name="com.sonyericsson.android.permission.SEMC_BACKUP_SERVICE" />
<uses-permission android:name="com.sonyericsson.android.permission.SEMC_CUSTOM_SETTINGS" />
<uses-permission android:name="android.permission.RECEIVE_WAP_PUSH" />
<uses-permission android:name="com.android.mms.wap.permission.READ_PUSH" />
<uses-permission android:name="com.android.mms.wap.permission.WRITE_PUSH" />
<permission android:name="com.android.mms.wap.permission.READ_PUSH" android:protectionLevel="signatureOrSystem" />
<permission android:name="com.android.mms.wap.permission.WRITE_PUSH" android:protectionLevel="signatureOrSystem" />
Now your creating your own Framework-res, you need to know the parts that your looking for and what to do with them.. roughly..
Code:
<service android:name="MmsService" android:permission="com.sonyericsson.android.permission.SEMC_CUSTOM_SETTINGS">
<intent-filter>
<action android:name="com.android.mms.MMS_CUSTOM" />
<action android:name="com.android.mms.MMS_SERVICE" />
</intent-filter>
</service>
From here you can define the properties that you need in the RES layout.. you need something along the lines of this in a file called - image_attachment_view.xml - which would define the image properties you are discussing.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<com.android.mms.ui.ImageAttachmentView android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/image_attachment_view" android:background="@drawable/attachment_editor_bg" android:paddingRight="5.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:id="@id/image_content" android:layout_width="fill_parent" android:layout_height="150.0dip" android:layout_weight="1.0" />
<LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content">
<Button android:id="@id/view_image_button" android:layout_width="100.0dip" android:layout_height="50.0dip" android:text="@string/view" style="\?android:attr/buttonStyleSmall" />
<Button android:id="@id/replace_image_button" android:layout_width="100.0dip" android:layout_height="50.0dip" android:text="@string/replace" style="\?android:attr/buttonStyleSmall" />
<Button android:id="@id/remove_image_button" android:layout_width="100.0dip" android:layout_height="50.0dip" android:text="@string/remove" style="\?android:attr/buttonStyleSmall" />
</LinearLayout>
</com.android.mms.ui.ImageAttachmentView>
EDIT: There are also some better MMS applications out there.. before reinventing the wheel perhaps a bit of window shopping?
No problem! Thanks for the info MrHassell. I enjoy reading your posts (chop full of interesting info, haha)
I'll definitely look into your tips there! SE mucked around with the messaging and they don't use mms.apk but conversations.apk. After decompiling conversations.apk, it references outside of converstions.apk (I'm 95% sure of that) for the uaprof. This (I think) makes sense in that the system needs to tell the network its uaprof.
Other MMS applications depend on this system uaprof to receive images and they too, receive small images. Custom roms get around this because they allow changing the uaprof. However, since SE changed the location of some of the interesting strings, I haven't been able to use AOSP or anything like that as a template to find the strings specifically.
I could use a custom rom, but I'm waiting until a stable, feature filled one is available without having to download X, Y, and Z to get features to work. I like messing with my phone but don't want to mess around with an entire rom (yet, I already did that with a Samsung i7500, lol).
So far, the interesting lines (2) is in framework-res.apk. /res/values/strings.xml
>> <string name="config_useragentprofile_url">http://wap.sonyericsson.com/UAprof/%R202.xml</string> (something like this) and h ttp://wap.sonyericsson.com/UAprof/%R101.xml
Which I changed to
>> <string name="config_useragentprofile_url">http://www.htcmms.com.tw/Android/TMO/Hero/ua-profile.xml</string>
Which is the uaprof for the Tmobile G2.
And just for background...
How I think this all works (if anyone works for tmobile usa and knows, please correct me!)
Phone connects to the network OR when the phone receives an MMS
Advertises it's uaprof capabilities to the network
Network looks at the url and either:
goes to the url and assigns those capbilities to that registered phone
or
looks at the url and looks for that url in a local database. Network finds info and assigns MMS values OR doesn't find it and assigns default 160x120 values. Doesn't go to the internet to find those values.
The X10 worked under 1.6. Why? It was rumored to come to the USA and 1.6 would have had the uaprof on their database for testing reasons. 2.1 comes and TMobile USA has already decided not to carry it so they don't add the new url to their database.
totalundone said:
bah, i can't ever get adb to replace a file. it always says that it's not writeable and then when i get su permission set, some other error happens. I'll figure it out... still reading... typical adb newbie issue, haha.
Click to expand...
Click to collapse
The /system directory is read-only by default. You need to mount it as read/write:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
Click to expand...
Click to collapse
If that doesn't work, you could try this:
adb shell
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
exit
exit
Click to expand...
Click to collapse
Also, don't forget to check your phone for a "SuperUser" popup and allow it. In the SuperUser app, this shows up as "Unknown".
Thanks again Grospolina!
Evidently I didn't have it approved by superuser. I thought I did... but forgot that I lost it when I had to reflash a few days ago.
I tried the new framework-res.apk. It didn't crash my phone and it was the new size! unfortunately incoming mms photo sizes are still 160x120 max.
Well... I guess I need to get back to searching ...
just want to say thank you for looking into this. i really want to have the mms picture issues worked out.
thanks again
Hi everyone,
I've created a GO SMS Pro theme using their webtool,
but it appears to have yet to implement various common aspects of functionality. I want to be able to modify the AndroidManifest.xml file myself, primarily to add Airpush (the presence of which I let people know of from the beginning), but the formatting is quite garbled. I'm guessing this may be due to the localization to Chinese that the Google Play developer console reports. Does anyone have a functional, readily editable version in English with all the required information for a GO SMS Pro Theme? I want to be assured I have all the required information, rather than hacking together another xml file with Eclipse. I figured I'd install the Chinese language on my computer, but it appears Microsoft did not include such functionality in Windows 7 Premium (64-bit). I've download other GO SMS Pro themes with Airpush, figuring I could use their AndroidManifest.xml and mail.xml files as templates, but found the same formatting / editability issue. Thank you for your help!
I've since found kantbstopped519's post at the end of page 3 in the following thread: http://forum.xda-developers.com/showthread.php?t=1125626&page=3
and used what was posted:
<?xml version="1.0" encoding="UTF-8"?>
<manifest android:versionCode="5" android:versionName="1.0" android:installLocation="auto" package="com.jb.gosms.theme.kxnt.dark"
xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="@string/app_name" android:icon="@drawable/jb_smsmms">
<activity android:theme="@android:style/Theme.Dialog" android:label="@string/app_name_desc" android:name=".GoSmsInstallDialog" android:excludeFromRecents="true" android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.INFO" />
</intent-filter>
<intent-filter>
<action android:name="com.jb.mms.theme.others" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>
Click to expand...
Click to collapse
It appears this functioned for kantbstopped519.
I used this as a template (made no additions of Airpush or anything such) and made the supposedly appropriate changes, also changing anything referencing @string to plain text directly in AndroidManifest.xml. Now I'm getting that informative "The server could not process your apk. Try again."
I've been making various changes, deletions, and resigning after each change, to repeatedly the same message. Only re-adding my original garbled-de-goop AndroidManifest.xml file and resigning has thus far resulted in a successful processing upon upload. Could this have something to do with the resources.arsc and/or classes.dex files in the root of the apk?
If the APK is already compiled then you will need to decompile it with apktool to get the XML readable.
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?