yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] KBanause:
http://code.google.com/p/android-ap...mmary+Uploaded+ReleaseDate+Size+DownloadCount

have fun :D
[G1 Android Development] vgshah78:
@KBanause: thx a lot mate. cheers!! :)
[G1 Android Development] he_stheone64:
I`m having a very strange Problem - I have a Desire HD with 2.2.1 Sense ROM. All system/apps and framework-res compile fine - only with com.htc.resources.apk I have the same issue after trying it 20 times with different approaches - directly in apktool, apkmanager 4.9, transfering compiled resources to original htc framework, compiling with apkmanager 4.9, transfering Manifest and Meta-Inf to the compiled htc resources, basically all the bells and whistles...

The system boots and works fine, but after compiling I loose access to settings. Even if I decompile in a test run and CHANGE NOTHING and compile, same result.

Following warning comes from apktool, but build finishes and boots as mentioned:

aapt: warning: string 'htc_day' has no default translation in C:\apktool\com.htc

.resources-decoded\res; found: zh_HK

aapt: warning: string 'htc_hour' has no default translation in C:\apktool\com.ht

c.resources-decoded\res; found: zh_HK

aapt: warning: string 'htc_minute' has no default translation in C:\apktool\com.

htc.resources-decoded\res; found: zh_HK

aapt: warning: string 'htc_month' has no default translation in C:\apktool\com.h

tc.resources-decoded\res; found: zh_HK

aapt: warning: string 'htc_year' has no default translation in C:\apktool\com.ht

c.resources-decoded\res; found: zh_HK

I: Building apk file...

I understand that there should be no translation there according to the warnings, but it is (in this case Chinese).

The htc resources is completely stock, unthemed, htc framework is installed - app. 15 other htc apps compiled and work fine. Only this is making trouble - I`m using apktool a lot and compiled tons of apk`s, but this problem is new - hope someone has a solution.

Thx a ton...:rolleyes:
[G1 Android Development] :
+1 I can't even get it decompiled :( Anyone knows if it's dependent of any framework jars maybe?
[G1 Android Development] pendo:
extract com.htc.resources.apk from your rom/phone and place in your preset working directory (or type the full path to where ever you put it when using the command below)

run this:

apktool if com.htc.resources.apk htc​

it should say something similar to:

Framework installed to: /home/C0mpu13rFr34k/apktool/framework/1-htc.apk

then run apktool like this (use -f switch to force overwrite if you still have the same output folder)

apktool d -t htc framework-res.apk​

http://code.google.com/p/android-apktool/wiki/FrameworkFiles
[G1 Android Development] he_stheone64:
I don`t have an issue getting it decompiled and compiled, it also boots fine - but as described the settings will not load, since apktool looses some information necessary for the settings init. I even added the missing translation files to strings, again complie went fine, boot to but settings just don`t load.

Asked other guys to replicate the steps - they get exactly the same warning and no access to settings. So obviously this is a general bug for com.htc.resources.apk with latest Sense version, that is on DHD. So if brut reads this, it would be great if you have any ideas or a workaround, since that stops all deeper htc.resources related mods for the Desire HD.

I will donate anyway, since I really appreciate what you have done for us themers.
[G1 Android Development] Brut.all:
@he_stheone64

What do you mean by no access to settings? You get FCs when you try to open them? What's in logcat?
[G1 Android Development] he_stheone64:
There are no FC`s, when you you tap the settings button in menu it simply does not open. Also there is no setting widget anymore. It seems obvious, that some information is lost during the compile process, that is needed for the settings to start due to dependencies to com.htc.resources. I already rcd the same feedback from 3 fellow XDA members, who I asked to reproduce these steps, without changing anything to the code, just decompile and compile in order to ensure consistent procedure and results.

They all get the same warnings about 5 missing default translations. I tried in one run to fix it by adding these to the default strings, again compiled and booted fine, but settings does not start. I will check logcat later, once I`m at home.
[G1 Android Development] MrLuje:
I have a similar issue but with framework-res.apk from DHD 2.2.1

I can decompile & compile it back fine (without modifications), it boots fine till unlock screen where it goes back to bootanimation

Logcat :

W/ActivityManager( 370): Permission Denial: cancelIntentSender() from pid=370, uid=1000 is not allowed to cancel packges android
E/AndroidRuntime( 370): *** FATAL EXCEPTION IN SYSTEM PROCESS: android.server.ServerThread
E/AndroidRuntime( 370): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.CONFIGURATION_CHANGED flg=0x60000000 } in com.android.server.AppWidgetService$1@478b1cd8
E/AndroidRuntime( 370):	at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:981)
E/AndroidRuntime( 370):	at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 370):	at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 370):	at android.os.Looper.loop(Looper.java:143)
E/AndroidRuntime( 370):	at com.android.server.ServerThread.run(SystemServer.java:613)
E/AndroidRuntime( 370): Caused by: java.lang.SecurityException: Permission Denial: cancelIntentSender() from pid=370, uid=1000 is not allowed to cancel packges android
E/AndroidRuntime( 370):	at com.android.server.am.ActivityManagerService.cancelIntentSender(ActivityManagerService.java:6643)
E/AndroidRuntime( 370):	at android.app.PendingIntent.cancel(PendingIntent.java:389)
E/AndroidRuntime( 370):	at com.android.server.AppWidgetService.cancelBroadcasts(AppWidgetService.java:328)
E/AndroidRuntime( 370):	at com.android.server.AppWidgetService.updateProvidersForPackageLocked(AppWidgetService.java:1202)
E/AndroidRuntime( 370):	at com.android.server.AppWidgetService$1.onReceive(AppWidgetService.java:1091)
E/AndroidRuntime( 370):	at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:964)
[G1 Android Development] pendo:
you know...now that you mention it, I've seen this same thing. Someone had contacted me about a compilation error, and I noticed this....I didn't look at it very closely at all, and thought it might've been from one of the miui roms that are so ubiquitous nowadays.

All I did was transfer over the sigs and manifest and sent it back. But I haven't heard about this error your getting. I'll get in touch with the guy and find out if he had similar problems.

<edit>

Sorry, didn't pay close enough attention...the file that I had the missing translations was a framework-res NOT com.htc.resources.apk Strange that I had the same errors though...
[G1 Android Development] he_stheone64:
I have no issues with framework-res or other apk`s from DHD, I compiled and installed nearly all apk`s and as always with apktool no issues. Only the new htcresources delivers problems and as mentioned exactly the same with multiple themers on different PC`s.

Do you get any error message? Did you compile with apkmanager or directly with apktool? In apkmanager sometimes you don`t get warnings (even if it uses apktool), if you compile directly with apktool this is more detailed.
[G1 Android Development] he_stheone64:
Thx for your answer - if you compile with apkmanager, you don`t need to transfer sig and Manifest anymore due to the keep folder. Anyway since I was desparate enough I certainly also tried this old procedure, when you compile directly with apktool - same result.
[G1 Android Development] Brut.all:
What's in the logcat when you click on settings button? It seems Settings isn't installed - most probably it was rejected at boot time. Try to find any related warnings/exceptions at boot time.

How did you installed modified framework? I think some of your system apps have lost permissions to run Android internals and this is usually caused by problems during installation of modified bits.
[G1 Android Development] pendo:
I much prefer using apktool directly, but I'm aware of that feature of apkmanager from all the folks that have contacted me for help with super circle mods.

I guess I just like using it the way I learned it last summer :) Thanks again brut.all
[G1 Android Development] he_stheone64:
This is logcat, when I touch settings in menu:

D/Rosie ( 1504): can't start activity: android.settings.SETTINGS

I/ActivityManager( 1301): Starting activity: Intent { act=android.settings.SETTI

NGS flg=0x10200000 }

V/WindowManager( 1301): Remove Window{477c9838 AtchDlg:com.htc.launcher/com.htc.

launcher.Launcher paused=false}: mSurface=Surface(name=AtchDlg:com.htc.launcher/

com.htc.launcher.Launcher, identity=16) mExiting=false isAnimating=false app-ani

mation=null inPendingTransaction=false mDisplayFrozen=false

E/WindowManager( 1301): return in removeWindowLocked

D/InputManagerService( 1301): Window already focused, ignoring focus gain of: co

m.android.internal.view.IInputMethodClient$Stub$Proxy@47a4d1b8

D/CSUtil ( 1731): serverTime = 1293383969443

D/CSUtil ( 1731): serverTime = 62936

D/CSUtil ( 1731): curGMTTime = 37575142

I looked in my catlog app on top - it says:

Setting android_id has moved from android.provider.Settings.System to android.provider.Settings.Secure, returning read-only value
[G1 Android Development] Brut.all:
Hmm.. and how it looks on the same ROM, but before recompilation (when it works properly)? I get this line on CM:

Starting activity: Intent { act=android.settings.SETTINGS flg=0x10200000 cmp=com.android.settings/.Settings }

"My" intent is targeted at specific component and your is not. This may be a reason, why Settings doesn't run, but it's nearly impossible to remove that component by accident - it's probably stored in the app code, not resources. So I think that component was removed by HTC, but we need to check this.

Also could you run:

adb shell pm list packages | grep set
[G1 Android Development] MrLuje:
I tried with apkmanager4.9, apktool 1.3.1 & 1.3.2.

None of them throw any warning or error.

Mostly by adb push, I also tried with update.zip but I got the same behavior.

Does the "fix permission" (or fix uid mismatch) entry of clockworkmod can do something about it ?

Edit: BTW, I just add pictures in drawable-en, modify a xml in layout-hdpi and I reference these new files in ids.xml & public.xml
[G1 Android Development] he_stheone64:
+1

the apkmanager script uses apktool anyway...
[G1 Android Development] he_stheone64:
This is what I get with working htcresources

Starting activity: Intent { act=android.settings.SETTI

NGS flg=0x10200000 cmp=com.android.settings/.framework.activity.HtcSettings }

C:\AndroidSDK\android-sdk-windows\tools>adb shell

$ pm list packages | grep set

pm list packages | grep set

package:com.android.settings

package:com.android.providers.settings

package:com.htc.settings.accountsync

package:com.htc.android.htcsetupwizard

package:com.htc.htcsettingwidgets

package:com.android.setupwizard

package:com.htc.OnlineAssetDetails

package:com.htc.provider.settings

package:com.google.android.partnersetup

$
[G1 Android Development] kurniawan77:
and this is what i get:

ActivityManager( 186): Starting activity: Intent { act=android.settings.SETTINGS flg=0x10200000 cmp=com.android.settings/.framework.activity.HtcSettings }
[G1 Android Development] ihtfp69:
This sounds like a signature mismatch problem with the main platform shared uid. Start with a working system and push the new file while booted and capture everything in the logcat. I'll bet you'll get a signature is not the same as the previous one message.

The translation warnings are not causing your problem, though. I get those all the time and never have an issue.
[G1 Android Development] he_stheone64:
Thx for the comment, but shouldn`t it then work, if I use old Meta-INF from working com.htc.resources? I`ve done that too and same issue.
[G1 Android Development] ihtfp69:
Are you sure you did not mess with framework-res.apk?

Anytime the system is getting permission denied messages or things like Settings disappears, the signature in one of system apks has been changed or is not valid.

If you have only changed one file, it's a good bet that one is the culprit. I'll also bet if you wipe, the phone will boot loop.

I would suggest only using apktool by itself and only use the original files for delivery. Delete resources.arsc and the res folder from the original file. Then copy in the new ones from apktool's output. Leave AndroidManifest.xml and the META-INF folder intact. Then capture the logcat as the phone boots the first time after you push the file in recovery.
[G1 Android Development] :
Never mind this. Apktool doesn't work for me at all. I tried 1.3.1 and .2 but no luck with anything. Worked fine on Ubuntu 64bit but now it's all messed up in Linux Mint 64bit... It's really odd. Never had this before. It decompiles just fine but when I try to compile again it gives me a crap load of errors (terminal cuts it so I can't see all the errors).
[G1 Android Development] he_stheone64:
Thx again - but I`ve done all that. I compiled directly with apktool and pushed ONLY com.htc.resources to ensure, this is the reason. I certainly used a 100% stock com.htc.resources - I`ve done many themes in the past, so that is a non brainer. I also tried only leaving manifest and meta-Inf, alway the same results. There are many ways to Rome and I tried them (as far as I know) all. As mentioned - fellow members did the same and achieved the same results, so it`s not an isolated issue.

I just hope, that brut can see something relevant in the latest logs...
[G1 Android Development] he_stheone64:
You have also still same result with com.htc.resources, that settings do not load after pushing the compiled apk?
[G1 Android Development] :
Okay did some testing. This only happens with framework but as far as I remember no special needs are required to (de)compile framework. This happens in both AOSP ROMs, Sense ROMs, com.htc.resources.apk and framework-res.apk. Besides it haven't been needed for me in the past to do anything special so this is really odd :confused: I'm totally lost here :(
[G1 Android Development] MrLuje:
Just a quick question : if I use apktool directly (not apkmanager), which aapt is advised to use? platform-tools or the one in android-8\tools? (or another one)

Thanks
[G1 Android Development] kurniawan77:
Worse... i get bootloops! second trial and i get the same error:

I: Loading resource table...
I: Decoding resources...
I: Loading resource table from file: C:\Users\HP DV7-4030ed\apktool\framework\1.apk
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'htc_day' has no default translation in C:\Users\HP DV7-4030ed\Desktop\Irwan\apk_manager_4.9\other\..\projects\com.htc.resources.apk\res; found: zh_HK
aapt: warning: string 'htc_hour' has no default translation in C:\Users\HP DV7-4030ed\Desktop\Irwan\apk_manager_4.9\other\..\projects\com.htc.resources.apk\res; found: zh_HK
aapt: warning: string 'htc_minute' has no default translation in C:\Users\HP DV7-4030ed\Desktop\Irwan\apk_manager_4.9\other\..\projects\com.htc.resources.apk\res; found: zh_HK
aapt: warning: string 'htc_month' has no default translation in C:\Users\HP DV7-4030ed\Desktop\Irwan\apk_manager_4.9\other\..\projects\com.htc.resources.apk\res; found: zh_HK
aapt: warning: string 'htc_year' has no default translation in C:\Users\HP DV7-4030ed\Desktop\Irwan\apk_manager_4.9\other\..\projects\com.htc.resources.apk\res; found: zh_HK
I: Building apk file...

done it with apkmanger, after compile set Y for system apk, and N for copy over files, once it was done i manually copied over manifest and meta-inf...

o and btw.... i only de- and recompiled without any mods.....
[G1 Android Development] pendo:
you want to use one from sdk 2.2 for sure. the aapt from sdk 2.3 does not work afaik
[G1 Android Development] :
Fixed it. Took aapt from android 2.2 :)

EDIT: Is it apktool or aapt that deletes META-INF cause that is pretty damn annoying when you are only dealing with framework? :confused:

EDIT2: **** I know the issue now. Never mind any of these things.

EDIT3: Okay I take back "EDIT2"...

EDIT4: I'm way to used to APK Manager *sigh*... Never mind. ...again... :)
[G1 Android Development] nugroho2:
~~ retracted ~~
[G1 Android Development] pendo:
Assigning ids can be tricky, particularly if you have a net loss of resources. Its usually better to place dummies in any gaps created by removing resources. That way resources that you do keep retain their same id's
[G1 Android Development] nugroho2:
Thanks... but I have found the problem. Had not noticed the arrays in other directory (values-hdpi)...
[G1 Android Development] nugroho2:
@Pendo: I tried to change the wallpaper images in Launcher2.apk (Eclair, mod by Leshak, Samdroid).

I ran the apktool, delete the unused images, got rid of unused images in values-hdpi/array.xml and public.xml, and recompile. No error in compilation. Signed it and put it back. But it just won't work; hangs. Any idea ?

EDIT 1: Use previous version of apktool (1.3.1) and all seemed to work OK. Put it back to the phone. But all apps connected to the internet (except native browser and gmail) must be reinstalled from my backup. After that all seems to be OK. What internet setting was changed by the new build, I wonder ?
[G1 Android Development] MrLuje:
I "solved" my issue. If I apply framework-res.apk from recovery (adb push or update.zip), I got permission denial errors. But if I push it while the phone is running, everything is fine after a reboot :confused:

Any explanation?

Thanks
[G1 Android Development] KBanause:
Is there any ETA for a new version which has issue 100 fixed?
[G1 Android Development] SXUsr:
Hi.

I'm getting the same error with the packages installed, I've been round the houses trying to get it to work but still keep getting the same error.
[G1 Android Development] SXUsr:
Hi.

Two days ago I had no issues, and now I haven't got a clue what's happening. I can decompile ok, but when trying to rebuild I get the following...

...any help greatly appreciated.
[G1 Android Development] TMartin:
Hey Brut.all,

I've been having issues with version 1.3.1. I will decompile a framework-res.apk, change nothing, and it will rebuild without any errors. If I were to swap out one image with an image of the exact same name then rebuild, it will tell me that the image is defined in public.xml but not defined in my drawables folder. I also tried version 1.3.2, just in case. Any ideas??
[G1 Android Development] ihtfp69:
Most likely its because you pulled the file from a rom where the dev thought they would save space by removing images from it. Find the one from the ruu and compare the two.
[G1 Android Development] :
How do you manage to build com.htc.resources? I got Rosie and framework-res compiled but I just get a crap load of errors with com.htc.resources :confused:

EDIT: Must be an error I made. It (de)compiled fine fresh. Anyone knows how I can output the terminal text in a text file cause it cuts it :(

EDIT2: Never mind.
[G1 Android Development] TMartin:
I can grab a stock framework-res.apk and it will do the same thing.
[G1 Android Development] ihtfp69:
Then there are drawables defined that are missing. Look at the error output to find out which ones. You may have to put dummy ones in to get it to compile without removing them from public.xml.
[G1 Android Development] TMartin:
No...Somehow apktool is overlooking them. For example, I replace default_wallpaper.jpg with another image that I have named default_wallpaper.jpg. It will say that default_wallpaper.jpg is missing from my drawable's even tho it is clearly there.
[G1 Android Development] pendo:
yeah, that does not sound right. From my experience, it doesn't matter what the substance of the file is...as long as it has the right name (and correctly formed 9patch if it's 9patch) it will compile.

Is it happening from different roms as well?
[G1 Android Development] MontAlbert:
I am trying to edit the gingerbread keyboard-

so i perform the command:

sudo apktool -v d -s LatinIME_GB_green_white.apk GreenWhiteIME

which works fine. Then i open up /res/values and go into colors.xml and styles.xml. I edit what i want to edit and it works and recompiles no problems.

sudo apktool -v b GreenWhiteIME GreenWhiteIME.apk

Problem is that when i push the keyboard across i get a couple of errors:

So i opened up the APKtooled folder and saw in /res/values/strings.xml that it had:

<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="alternates_for_a">àáâãäåæ</string>
<string name="alternates_for_e">èéêë</string>
<string name="alternates_for_i">ìíîï</string>
<string name="alternates_for_o">òóôõöœø</string>
<string name="alternates_for_u">ùúûü</string>
<string name="alternates_for_s">§ß</string>
<string name="alternates_for_n">ñ</string>
<string name="alternates_for_c">ç</string>
<string name="alternates_for_y">ýÿ</string>
<string name="alternates_for_q">1</string>
<string name="alternates_for_w">2</string>
<string name="alternates_for_d" />
<string name="alternates_for_r">4</string>
<string name="alternates_for_t">5</string>
<string name="alternates_for_z" />
<string name="alternates_for_l" />
<string name="alternates_for_g" />
<string name="alternates_for_p">0</string>
<string name="alternates_for_v" />
<string name="alternates_for_ae" />
<string name="alternates_for_oe" />
<string name="alternates_for_cyrillic_e" />
<string name="alternates_for_cyrillic_soft_sign" />
<string name="alternates_for_a_umlaut" />
<string name="alternates_for_o_umlaut" />
<string name="word_separators">.	,;:!?\n()[]*[COLOR="Magenta"]&[/COLOR]@{}/[COLOR="Magenta"]<[/COLOR]>_+=|\"</string>
<string name="sentence_separators">.,!?)</string>

so, being a total noob and nuffie when it comes to java (and well, basically any coding language) I asked around and it seems that the & is the html entity for ampersand (&), and < is the html entity for < .

So i tried to replace these in the xml file with java source codes for them: "\u0026" and "\u003C" respectively. I also tried the HTML decimal entities: & and < and this did nothing to fix it either....

doesnt fix it. Makes it worse if anything.

Any ideas on what to do here? Is there an apktool command/option i can use to stop it doing this?
[G1 Android Development] Droidzone:
How is re/decompiling .jar files different from doing it on .apks?

Could someone post the commands/steps required?
[G1 Android Development] ihtfp69:
You need to use the following without the periods and it works fine.

&.amp.;
&.lt.;
[G1 Android Development] Droidzone:
Guys,

Can anyone tell me the method to properly decompile and recompile android.policy.jar? I ask b/c after recompiling, the system rebooted. I was trying to mod the reboot button behavior..

Installing the original android.policy.jar on top of my modded file, did what I was originally trying to do
[G1 Android Development] pendo:
no difference...you use the same commands.

You also need to go fix a few xml's in the in the xml folder. If you've got access to aosp, one thing that I did that worked very well was to just copy from there. That way I knew didn't "over-edit" parts of them.