[LG Optimus 2x] pastime1971:
@ mateorod,

i think i figured out how to get preloaded-classes. i extract it from framework.jar and patch it. (see my pdroid_patcher script)

as for your comment on apktool, that is just a wrapper for java -jar apktool.jar anyway. therefore, you still need java to run it. beside, it doesn't support -b or -a options in baksmali.jar

i made a pdroid patcher script based on your patch files. the script itself seems to work.

however, when it test it for cm9-p990.zip, patching fails a few times. also, it looks like there is non-pdroid-related patch in there as well.

patching file smali/com/android/server/am/ActivityManagerService.smali
Hunk #1 succeeded at 13066 with fuzz 1 (offset -27 lines).
Hunk #2 succeeded at 19194 (offset -13 lines).
Hunk #3 succeeded at 19292 (offset -13 lines).
Hunk #4 succeeded at 19326 (offset -13 lines).
Hunk #5 succeeded at 19343 (offset -13 lines).
Hunk #6 succeeded at 19379 (offset -13 lines).
Hunk #7 succeeded at 19422 (offset -13 lines).
Hunk #8 succeeded at 19430 (offset -13 lines).
Hunk #9 succeeded at 19560 (offset -13 lines).
Hunk #10 succeeded at 19574 (offset -13 lines).
Hunk #11 succeeded at 19602 (offset -13 lines).
Hunk #12 succeeded at 19706 (offset -13 lines).
Hunk #13 succeeded at 19719 (offset -13 lines).
Hunk #14 succeeded at 19750 (offset -13 lines).
Hunk #15 succeeded at 19877 (offset -13 lines).
Hunk #16 succeeded at 19928 (offset -13 lines).
Hunk #17 succeeded at 19947 (offset -13 lines).
Hunk #18 succeeded at 19968 (offset -13 lines).
Hunk #19 succeeded at 19990 (offset -13 lines).
Hunk #20 succeeded at 20042 (offset -13 lines).
Hunk #21 succeeded at 20073 (offset -13 lines).
Hunk #22 succeeded at 20110 (offset -13 lines).
Hunk #23 succeeded at 20125 (offset -13 lines).
Hunk #24 succeeded at 20239 (offset -13 lines).
Hunk #25 succeeded at 20258 (offset -13 lines).
patching file smali/com/android/server/ServerThread.smali
Hunk #2 FAILED at 198.
Hunk #3 FAILED at 209.
Hunk #4 FAILED at 245.
Hunk #5 FAILED at 321.
Hunk #6 FAILED at 376.
Hunk #7 FAILED at 388.
Hunk #8 FAILED at 397.
Hunk #9 FAILED at 406.
Hunk #10 FAILED at 423.
Hunk #11 FAILED at 440.
Hunk #12 FAILED at 455.
Hunk #13 FAILED at 481.
Hunk #14 FAILED at 496.
Hunk #15 FAILED at 535.
Hunk #16 FAILED at 569.
Hunk #17 FAILED at 611.
Hunk #18 FAILED at 619.
Hunk #19 FAILED at 635.
Hunk #20 FAILED at 691.
Hunk #21 FAILED at 705.
Hunk #22 FAILED at 734.
Hunk #23 FAILED at 769.
Hunk #24 FAILED at 791.
Hunk #25 FAILED at 820.
Hunk #26 FAILED at 849.
Hunk #27 FAILED at 867.
Hunk #28 FAILED at 883.
Hunk #29 FAILED at 910.
Hunk #30 FAILED at 943.
Hunk #31 FAILED at 966.
Hunk #32 FAILED at 993.
Hunk #33 FAILED at 1020.
Hunk #34 FAILED at 1041.
Hunk #35 FAILED at 1059.
Hunk #36 FAILED at 1088.
Hunk #37 FAILED at 1104.
Hunk #38 FAILED at 1135.
Hunk #39 FAILED at 1148.
Hunk #40 FAILED at 1172.
Hunk #41 FAILED at 1191.
Hunk #42 FAILED at 1207.
Hunk #43 FAILED at 1234.
Hunk #44 FAILED at 1263.
Hunk #45 FAILED at 1287.
Hunk #46 FAILED at 1303.
Hunk #47 FAILED at 1332.
Hunk #48 FAILED at 1348.
Hunk #49 FAILED at 1364.
Hunk #50 FAILED at 1380.
Hunk #51 FAILED at 1407.
Hunk #52 FAILED at 1427.
Hunk #53 FAILED at 1443.
Hunk #54 FAILED at 1470.
Hunk #55 FAILED at 1490.
Hunk #56 FAILED at 1508.
Hunk #57 FAILED at 1524.
Hunk #58 FAILED at 1574.
Hunk #59 FAILED at 1592.
Hunk #60 FAILED at 1625.
Hunk #61 FAILED at 1662.
Hunk #62 FAILED at 1722.
Hunk #63 FAILED at 1730.
Hunk #64 FAILED at 1741.
Hunk #65 FAILED at 1780.
Hunk #66 FAILED at 1795.
Hunk #67 FAILED at 1822.
Hunk #68 FAILED at 1876.
Hunk #69 FAILED at 1895.
Hunk #70 FAILED at 1931.
Hunk #71 FAILED at 1958.
Hunk #72 FAILED at 1971.
Hunk #73 FAILED at 1984.
Hunk #74 FAILED at 1997.
Hunk #75 FAILED at 2011.
Hunk #76 FAILED at 2025.
Hunk #77 FAILED at 2038.
Hunk #78 FAILED at 2051.
Hunk #79 FAILED at 2065.
Hunk #80 FAILED at 2079.
Hunk #81 FAILED at 2095.
Hunk #82 FAILED at 2109.
Hunk #83 FAILED at 2123.
Hunk #84 FAILED at 2137.
Hunk #85 FAILED at 2151.
Hunk #86 FAILED at 2164.
Hunk #87 FAILED at 2178.
Hunk #88 FAILED at 2192.
Hunk #89 FAILED at 2205.
Hunk #90 FAILED at 2218.
Hunk #91 FAILED at 2232.
Hunk #92 FAILED at 2246.
Hunk #93 FAILED at 2259.
Hunk #94 FAILED at 2272.
Hunk #95 FAILED at 2286.
Hunk #96 FAILED at 2299.
Hunk #97 FAILED at 2312.
Hunk #98 FAILED at 2325.
Hunk #99 FAILED at 2339.
Hunk #100 FAILED at 2352.
Hunk #101 FAILED at 2365.
Hunk #102 FAILED at 2379.
Hunk #103 FAILED at 2392.
Hunk #104 FAILED at 2405.
Hunk #105 FAILED at 2418.
Hunk #106 FAILED at 2431.
Hunk #107 FAILED at 2453.
Hunk #108 FAILED at 2466.
Hunk #109 FAILED at 2479.
Hunk #110 FAILED at 2492.
Hunk #111 FAILED at 2630.
Hunk #112 FAILED at 2641.
Hunk #113 FAILED at 2670.
Hunk #114 FAILED at 2690.
113 out of 114 hunks FAILED -- saving rejects to file smali/com/android/server/ServerThread.smali.rej
patching file smali/java/lang/PrivacyInputStream.smali
patching file 'smali/java/lang/PrivacyProcessManager$PrivacyFileReader.smali'
patching file smali/java/lang/PrivacyProcessManager.smali
patching file 'smali/java/lang/ProcessManager$ProcessImpl.smali'
patching file smali/android/accounts/AccountAuthenticatorCache.smali
patching file 'smali/android/accounts/AccountManager$AmsTask.smali'
patching file 'smali/android/accounts/AccountManager$Future2Task.smali'
patching file smali/android/accounts/AccountManagerService.smali
patching file smali/android/app/ActivityThread.smali
patching file 'smali/android/app/backup/BackupAgent$BackupServiceBinder.smali'
patching file smali/android/app/backup/RestoreSession.smali
patching file 'smali/android/app/ContextImpl$18.smali'
patching file 'smali/android/app/ContextImpl$26.smali'
patching file 'smali/android/app/ContextImpl$36.smali'
patching file 'smali/android/app/ContextImpl$3.smali'
patching file smali/android/app/ContextImpl.smali
Hunk #2 succeeded at 404 (offset -8 lines).
Hunk #3 succeeded at 446 (offset -8 lines).
Hunk #4 succeeded at 502 (offset -8 lines).
Hunk #5 succeeded at 973 (offset -8 lines).
Hunk #6 succeeded at 4111 (offset -8 lines).
patching file smali/android/app/DownloadManager.smali
patching file 'smali/android/app/WallpaperManager$Globals.smali'
patching file smali/android/bluetooth/BluetoothSocket.smali
patching file 'smali/android/content/AbstractThreadedSyncAdapter$SyncThread.smali'
patching file smali/android/content/ContentResolver.smali
patching file smali/android/content/CursorLoader.smali
patching file 'smali/android/content/SyncManager$InitializerServiceConnection.smali'
patching file smali/android/content/SyncStorageEngine.smali
patching file smali/android/database/BulkCursorToCursorAdaptor.smali
patching file smali/android/database/sqlite/SQLiteCursor.smali
patching file smali/android/database/sqlite/SQLiteDatabase.smali
patching file smali/android/database/sqlite/SQLiteStatement.smali
patching file smali/android/location/Location.smali
patching file smali/android/media/MediaPlayer.smali
patching file smali/android/net/VpnService.smali
patching file smali/android/net/wifi/WifiConfigStore.smali
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
36 out of 36 hunks ignored -- saving rejects to file smali/android/net/wifi/WifiConfigStore.smali.rej
patching file smali/android/net/wifi/WifiStateMachine.smali
patching file 'smali/android/opengl/GLSurfaceView$GLThread.smali'
patching file smali/android/os/Looper.smali
Hunk #2 FAILED at 590.
Hunk #3 FAILED at 607.
Hunk #4 FAILED at 624.
Hunk #5 FAILED at 664.
Hunk #6 FAILED at 704.
5 out of 6 hunks FAILED -- saving rejects to file smali/android/os/Looper.smali.rej
patching file 'smali/android/os/StrictMode$AndroidBlockGuardPolicy.smali'
patching file smali/android/os/StrictMode.smali
patching file smali/android/privacy/IPrivacySettingsManager.smali
patching file 'smali/android/privacy/IPrivacySettingsManager$Stub$Proxy.smali'
patching file 'smali/android/privacy/IPrivacySettingsManager$Stub.smali'
patching file smali/android/privacy/PrivacyFileObserver.smali
patching file smali/android/privacy/PrivacyPersistenceAdapter.smali
patching file 'smali/android/privacy/PrivacySettings$1.smali'
patching file smali/android/privacy/PrivacySettingsManagerService.smali
patching file smali/android/privacy/PrivacySettingsManager.smali
patching file smali/android/privacy/PrivacySettings.smali
patching file 'smali/android/privacy/surrogate/PrivacyAccountManager$PrivacyAccountManagerFuture.smali'
patching file smali/android/privacy/surrogate/PrivacyAccountManager.smali
patching file smali/android/privacy/surrogate/PrivacyActivityManagerService.smali
patching file smali/android/privacy/surrogate/PrivacyContentResolver.smali
patching file smali/android/privacy/surrogate/PrivacyCursor.smali
patching file 'smali/android/privacy/surrogate/PrivacyLocationManager$PrivacyLocationUpdater.smali'
patching file smali/android/privacy/surrogate/PrivacyLocationManager.smali
patching file smali/android/privacy/surrogate/PrivacyTelephonyManager.smali
patching file smali/android/server/BluetoothService.smali
Hunk #1 succeeded at 2401 (offset 34 lines).
Hunk #2 succeeded at 2430 (offset 34 lines).
Hunk #3 succeeded at 2473 (offset 34 lines).
Hunk #4 succeeded at 2508 (offset 34 lines).
Hunk #5 succeeded at 2625 (offset 34 lines).
Hunk #6 succeeded at 2702 (offset 34 lines).
Hunk #7 succeeded at 2739 (offset 34 lines).
Hunk #8 succeeded at 2801 (offset 34 lines).
Hunk #9 succeeded at 3178 (offset 34 lines).
Hunk #10 succeeded at 3207 (offset 34 lines).
Hunk #11 succeeded at 3234 (offset 34 lines).
Hunk #12 succeeded at 3279 (offset 34 lines).
Hunk #13 succeeded at 3784 (offset 30 lines).
Hunk #14 succeeded at 3824 (offset 30 lines).
Hunk #15 succeeded at 3877 (offset 30 lines).
Hunk #16 succeeded at 3897 (offset 30 lines).
Hunk #17 succeeded at 4849 (offset 30 lines).
Hunk #18 succeeded at 4862 (offset 30 lines).
patching file 'smali/android/service/textservice/SpellCheckerService$InternalISpellCheckerSession.smali'
patching file 'smali/android/telephony/PhoneStateListener$1.smali'
patching file smali/android/telephony/PhoneStateListener.smali
patching file smali/android/view/accessibility/AccessibilityManager.smali
patching file smali/android/view/SurfaceView.smali
patching file 'smali/android/view/ViewRootImpl$AccessibilityInteractionController.smali'
patching file 'smali/android/view/ViewRootImpl$W.smali'
patching file 'smali/android/webkit/HTML5VideoViewProxy$PosterDownloader.smali'
patching file 'smali/android/webkit/WebIconDatabase$EventHandler.smali'
patching file 'smali/android/webkit/WebView$6.smali'
patching file 'smali/android/webkit/WebView$7.smali'
patching file 'smali/android/widget/ActivityChooserModel$HistoryLoader.smali'
patching file 'smali/android/widget/ActivityChooserModel$HistoryPersister.smali'
patching file 'smali/android/widget/Filter$RequestHandler.smali'
patching file smali/android/widget/GridView.smali
patching file smali/android/widget/ListView.smali
patching file smali/android/widget/TextView.smali
patching file smali/com/android/internal/os/BatteryStatsImpl.smali
patching file smali/com/android/internal/telephony/BaseCommands.smali
Hunk #1 succeeded at 541 (offset -14 lines).
Hunk #2 succeeded at 561 (offset -14 lines).
Hunk #3 succeeded at 605 (offset -14 lines).
Hunk #4 succeeded at 630 (offset -14 lines).
patching file smali/com/android/internal/telephony/cdma/EriManager.smali
patching file smali/com/android/internal/telephony/IccRecords.smali
patching file smali/com/android/internal/telephony/SMSDispatcher.smali
patching file preloaded-classes

please take a look at the attached file, see if it works.

edit: i haven't flashed the result to see if it actually works yet. i will test other ROMs, and see if they do.