[Android Software Development] Master_T:
Well, I fixed almost everything, but USB still doesn't work.

I used the guide to port usb subsystem, but doing so breaks something else and the resulting services/framework-res make the rom not boot anymore (lots of errors starting services)... damn.

EDIT: the error it gives me is exactly the one that you describe in the last of the "WTF cases":

E/System ( 629): ******************************************
E/System ( 629): ************ Failure starting core service
E/System ( 629): java.lang.NullPointerException
E/System ( 629):	at com.android.server.pm.PackageManagerService.grantPermissionsLPw(PackageManagerService.java:4299)
E/System ( 629):	at com.android.server.pm.PackageManagerService.updatePermissionsLPw(PackageManagerService.java:4247)
E/System ( 629):	at com.android.server.pm.PackageManagerService.<init>(PackageManagerService.java:1170)
E/System ( 629):	at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:858)
E/System ( 629):	at com.android.server.ServerThread.run(SystemServer.java:167)
I/SystemServer( 629): Input Method Service
W/SystemServer( 629): ***********************************************
E/AndroidRuntime( 629): Error reporting WTF
E/AndroidRuntime( 629): java.lang.NullPointerException
E/AndroidRuntime( 629):	at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
E/AndroidRuntime( 629):	at android.util.Log$1.onTerribleFailure(Log.java:103)
E/AndroidRuntime( 629):	at android.util.Log.wtf(Log.java:278)
E/AndroidRuntime( 629):	at com.android.server.ServerThread.reportWtf(SystemServer.java:77)
E/AndroidRuntime( 629):	at com.android.server.ServerThread.run(SystemServer.java:274)
I/SystemServer( 629): Accessibility Manager
W/SystemServer( 629): ***********************************************
E/AndroidRuntime( 629): Error reporting WTF
E/AndroidRuntime( 629): java.lang.NullPointerException
E/AndroidRuntime( 629):	at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
E/AndroidRuntime( 629):	at android.util.Log$1.onTerribleFailure(Log.java:103)
E/AndroidRuntime( 629):	at android.util.Log.wtf(Log.java:278)
E/AndroidRuntime( 629):	at com.android.server.ServerThread.reportWtf(SystemServer.java:77)
E/AndroidRuntime( 629):	at com.android.server.ServerThread.run(SystemServer.java:282)
W/SystemServer( 629): ***********************************************
E/AndroidRuntime( 629): Error reporting WTF
E/AndroidRuntime( 629): java.lang.NullPointerException
E/AndroidRuntime( 629):	at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
E/AndroidRuntime( 629):	at android.util.Log$1.onTerribleFailure(Log.java:103)
E/AndroidRuntime( 629):	at android.util.Log.wtf(Log.java:278)
E/AndroidRuntime( 629):	at com.android.server.ServerThread.reportWtf(SystemServer.java:77)
E/AndroidRuntime( 629):	at com.android.server.ServerThread.run(SystemServer.java:289)
W/SystemServer( 629): ***********************************************
E/AndroidRuntime( 629): Error reporting WTF
E/AndroidRuntime( 629): java.lang.NullPointerException
E/AndroidRuntime( 629):	at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
E/AndroidRuntime( 629):	at android.util.Log$1.onTerribleFailure(Log.java:103)
E/AndroidRuntime( 629):	at android.util.Log.wtf(Log.java:278)
E/AndroidRuntime( 629):	at com.android.server.ServerThread.reportWtf(SystemServer.java:77)
E/AndroidRuntime( 629):	at com.android.server.ServerThread.run(SystemServer.java:295)
E/AndroidRuntime( 629): *** FATAL EXCEPTION IN SYSTEM PROCESS: android.server.ServerThread
E/AndroidRuntime( 629): java.lang.NullPointerException
E/AndroidRuntime( 629):	at com.android.server.ServerThread.run(SystemServer.java:299)
E/AndroidRuntime( 629): Error reporting crash
E/AndroidRuntime( 629): java.lang.NullPointerException
E/AndroidRuntime( 629):	at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:72)
E/AndroidRuntime( 629):	at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
E/AndroidRuntime( 629):	at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)

So... corrupted framework-res? Any idea on how to solve that? I'm on windows... should I go on linux and use linux version of apktool? Does it make any difference? Which version you recommend?