Monday, January 18, 2010

CrashReporter 0.2f available for testing; iKeyEx 0.3 sneak peak

CrashReporter 0.2f has been available for testing. This version should fully eliminate the crash caused by fat binaries. Also, it has a hidden preference enabling "Email crash report to developer" within CR. But to avoid swarm of emails by stupid users blaming the tertiary suspects without any grounds you're required to read the source code of CR to know how to enable it ;).

Also, I have put up iKeyEx 0.3~beta1 for anyone who needs the new feature to test. 0.3 is an intermediate version between 0.2 and 0.5 to address some keyboard developers' requests, in particular:
  • When the key is a combining character, NFC is automatically applied.

  • variantType = "immediate-accents" (e.g. Thai and Arabic) is available via "text with traits".

  • more-after and shift-after (e.g. Zhuyin keyboard and the apostrophe) can be explicitly turned on and off via the "after" traits.


(0.5 shall support the "image" traits again, and thus keyboard theming; and the "star" operator in .cin IME.)

And, I'd like to point out that, if you want to change the text of Return and Space in your keyboard, you can already do so by strings.plist. This is supported from the start, not a new feature.

Wednesday, January 6, 2010

Two IDA Pro 5.x Scripts for iPhoneOS binaries

If you use IDA Pro to disasseble iPhoneOS binaries (Mach-O/ARM), you may find these scripts useful:
  • dyldinfo: This script lets IDA Pro understands the DYLD_INFO[_ONLY] command introduced in firmware 3.1. Running this recovers some missing symbols.

  • fixobjc2: For binaries built with Objective-C ABI 2, this script can find and label all Objective-C functions and ivar offsets.


The result will look like this:


Because IDA doesn't allow "-" and spaces in names, the Objective-C function names are renamed like this:
  • -[Foo bar:baz:] → Foo.bar:baz:
  • +[Foo bar:baz:] → @Foo.bar:baz:
  • -[Foo(Cat) bar:baz:] → Foo(Cat).bar:baz:


(Note: Try not to run fixobjc2 before dyldinfo, some information cannot be found.)

Tuesday, December 29, 2009

iKeyEx 0.2b, CrashReporter 0.2e, class-dump-z 0.2a released

Change log for iKeyEx 0.2b:

  • iKeyEx now uses postinst triggers to register layouts and input managers (r594). Keyboard makers may leave out the [pre|post][inst|rm] scripts now because the list will be updated as your keyboard is installed or removed. (You still need a postinst script if you want to support automatic purging.) As a side effect, all input modes explicitly deleted by the user (via Mix and Match) will be added back in and activated. If you really don't want that layout, uninstall it from Cydia.

  • Fixed issue 470: iKeyEx left/right arrows don't work in multi-line text input controls (r593).

  • No longer crashes for a layout with different landscape and portrait layout classes (r588). Thanks erik_joya for reporting!



Change log for CrashReporter 0.2e:

  • Fixed issue 481: CrashReport doesn't recognize FAT binaries. (r592)



Change log for class-dump-z 0.2a (except Windows, I need to reinstall VS2008 first):

  • Support for "hints file" (r589). See this wiki page for detail. Thanks rpetrich for suggestion!

Tuesday, December 15, 2009

iKeyEx and 5-Row QWERTY 0.2a will be on Cydia soon.

The minor updates for iKeyEx (r579) and 5-Row QWERTY (r580) are released and will be on the Big Boss repo within 2 days. They can be downloaded from here as usual.

These updates are to address some defects reported after 0.2 is put on the repo, for iKeyEx:
  • Keyboards for Hebrew, Arabic and other right-to-left languages will default to use right-to-left input direction. (r578. Thanks DB42/OpenHebrew for reporting!)

  • Eliminated the built-in keyboard selection list in Settings, which became useless when iKeyEx is installed (it cannot be respected because the keyboard list is not safemode-safe otherwise). (r579)


For 5-Row QWERTY:
  • The , and . keys are swapped back to their expected position. (Thanks Optimo for noticing!)

  • Reset the special characters won't duplicate the double quote (") anymore. (r580)

  • Changing the layout flushes the cache correctly now. (issue 471)

Friday, December 4, 2009

iKeyEx 0.2~rc1, Cangjie 0.2-3, CrashReporter 0.2d released

O hai, long time no post!

This is because I have posted many material which were to be put here to the "iPhone Development Wiki" created by Dustin Howett. (And also because of "schoolworks and tests" :p) This blog will remain for release notes only.

Back to the main topic, there are 3 major releases today: iKeyEx 0.2~rc1:
  • Different layouts in portrait and landscape orientation is supported again (r509, thanks DB42 for noticing)
  • CrashReporter support (r548)
  • Hooks only UIKit (r548).
  • Config file is now placed in ~/Library/Preferences/hk.kennytm.iKeyEx3.plist (r559).
  • Keyboard settings won't be lost due to Safe mode anymore.
  • .cin IME: Stop radical composition on failure by default.
  • .cin IME: Corrected sorting.
  • Other minor stuff.


Cangjie 0.2-3:
  • The shift key will be disabled in the 倉頡QWERTY鍵盤. If you want to enter English letters in this keyboard layout, long press on a key (e.g. 水 -> [水][E]).


CrashReporter 0.2d:
  • Made UIProgressHUD truly model to avoid crash due to accidental file deletion during symbolication.
  • Smarter suspect identification.
  • Symbolication in command line with the "-s" flag.
  • Complains if you did not install syslogd :)

Monday, September 28, 2009

Sorry Ollie Kett but...

can I sell this scriptlet for $0.99?

javascript:var s=document.documentElement.outerHTML.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"<br/>");document.open();document.write(s);document.close();


Disclaimer: This is not how Source Explore works. I did not even buy, try, pirate, or do anything with this app.

Saturday, September 26, 2009

Compiling iPhoneOS (3.1) apps with Xcode 3.2 without Provisioning Profile

Note: I don't know if this method still works, and I don't care. (And do not use the dd method mentioned in the article. It is extremely fragile to patch a binary file.)

Note 2: Please also check http://iphonedevwiki.howett.net/index.php?title=Xcode#Developing_without_Provisioning_Profile.

I want to compile.


This is easiest to solve. To compile you still need a certificate that can code-sign, but think this as a lip-service. Here is the procedure to create a self-signed code-signing certificate using Keychain Access. Make sure you create the certificate in the "login" (default) keychain, not the "System" keychain. After the certificate is created, perform these steps:
  1. Open /Developer/Platforms/iPhoneOS.platform/Info.plist. (Backup if you want to be safe.)
  2. Go to line 46. Replace the XCiPhoneOSCodeSignContext with XCCodeSignContext
  3. Go to line 79. Replace the XCiPhoneOSCodeSignContext with XCCodeSignContext
  4. Save the file.
  5. Restart Xcode.
  6. Compile!

After doing this, you can't use entitlements with Xcode anymore. But you have ldid -Sxyz.xml that does the same job.

Friday, September 25, 2009

GreenTea devices — You can still use Maps.

I have forcefully enabled GreenTea on my device (with MobileSubstrate) but almost everything behaves normally (iTunes is still accessible, YouTube is not hidden, Maps shows everywhere, etc.). The only difference I've noticed is:
  • There is no Hybrid mode in Maps when GreenTea is on.

Oh well.

Thursday, September 24, 2009

China, no Google Maps for you (maybe)

Today I was making the API for GraphicsServices, and found something... interesting.

Since 3.0 it was "well known" that there is a mysterious capability called as "Green Tea". Nothing was known except for this funny name. Things start to get clear in the 3.1 firmware. The GraphicsServices of 3.1 has a new set of API for querying some properties of Maps and MapKit. Strangely, in the disassembly of these functions, the mysterious "Green Tea" capability was refered, e.g.
Boolean GSMapKitUserShifting() {
static CFStringRef gtDefault = CFSTR("MapKitUserShiftingGreenTea");
static CFStringRef ngtDefault = CFSTR("MapKitUserShiftingNonGreenTea");
if (GSSystemHasCapability(CFSTR("green-tea")))
return GetMapsDefault(gtDefault);
else
return GetMapsDefault(ngtDefault);
}

It means the "Green Tea" capability is related to Maps, and takes different default values. No big deal right?

Sunday, September 20, 2009

class-dump-z 0.2-0 released.

(The version jump is mainly because every other project is moving to 0.2 era.)

Download: http://code.google.com/p/networkpx/downloads/detail?name=class-dump-z_0.2-0.tar.gz.

Note: Mac OS X 10.6 is required in this version.

What's changed:
  • Universal binary is supported. You can choose different architectures with the -u switch. (Not -arch or --arch because I didn't use getopt_long.)
  • Completely recognizes the new __LINKEDIT format. XXUnknownSuperclass shall no longer appears for 3.1 binaries.
  • __attribute__((visibility("hidden"))) will be included as well when the class is not exported (e.g. UIKeyboardLayoutStar).
  • Options to hide categories and protocols.
  • Sort class alphabetically, but keep class methods and -init methods on top (suggested by ashikase)
  • Option to choose between +(void)foo; and + (void)foo;. (suggested by ashikase)
  • Fixes a minor bug where timeOut:(int)out was written instead of timeOut:(int)anOut.

About the LC_DYLD_INFO[_ONLY] command.

With the introduction of the new __LINKEDIT format in iPhoneOS 3.1, many tools in the open toolchain are broken. This is all due to the unknown new commands LC_DYLD_INFO[_ONLY]. Although it's known to exist by many now, I found no useful documentation about this new format. Therefore, I'll outline what it is. Alternatively, you can study the source code of dyldinfo which contains every information here.

Friday, September 18, 2009

QuickScroll 2.2a should be available on Cydia soon.

QuickScroll 2.2 2.2a is released, and this marks the completion (so far) of the QuickScroll project. Thanks to the gdb for 3.1 I've finally squashed the "HiCalc" bug. I have already submitted it to BigBoss and should be available in a day. If you can't wait, you can still download from here.

Change log from 2.1a:
  • The scrolling indicator is no longer visible when scrollbar is used.
  • You should be able to use the scroller in HiCalc and other apps that canCancelContentTouches.

Change log from 2.2:
  • Fixed an obscure bug that causes crashing when the scroll view disappears. Thanks Optimo for discovering.

Porting the SDK's gdb for 3.1

The gdb on Cydia currently doesn't work on 3.1 because of the new Mach-O format. We could compile gdb from source (which I've failed to do so), wait for someone else to compile from source (which I'm still waiting), or just use the gdb in the SDK.

Update: saurik has updated the gdb package that works in 3.1, which will be available tomorrow. You can download it now from http://apt.saurik.com/debs/gdb_1128-8_iphoneos-arm.deb.


The SDK's gdb is in /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gdb/gdb-arm-apple-darwin. While you can run it directly on your Mac, it is in fact a fat binary with 3 architectures:

file gdb-arm-apple-darwin

gdb-arm-apple-darwin: Mach-O universal binary with 3 architectures
gdb-arm-apple-darwin (for architecture ppc): Mach-O executable ppc
gdb-arm-apple-darwin (for architecture i386): Mach-O executable i386
gdb-arm-apple-darwin (for architecture armv5): Mach-O executable arm


The ARMv5 portion is what we want. But this gdb is useless to run on the iPhoneOS because it lacks all the essential entitlements. While entitlements can be inserted using ldid, there is a limitation needs to be worked-around: ldid doesn't support the armv5 architecture. We have to modify the source code of ldid to allow it:
@@ -557,6 +557,7 @@
case 12: switch (framework->cpusubtype) {
case 0: arch = "arm"; break;
case 6: arch = "armv6"; break;
+ case 7: arch = "armv5"; break;
default: arch = NULL; break;
} break;

(I have also lipo -thin-ed the gdb before ldid-ing to make everything smooth.) After applying this patch, the ldid should recognize armv5 correctly. Now, save this portion of text as an XML file (e.g. gdb.xml):
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.springboard.debugapplications</key>
<true/>
<key>get-task-allow</key>
<true/>
<key>task_for_pid-allow</key>
<true/>
<key>run-unsigned-code</key>
<true/>
</dict>
</plist>

and then run:
ldid -Sgdb.xml gdb

, and the gdb should now be completely usable on the iPhoneOS.

Thursday, September 17, 2009

iKeyEx 0.1-99j released, now works in 3.1

Download: http://code.google.com/p/networkpx/downloads/detail?name=hk.kennytm.iKeyEx3-0.1-99j.deb

This version is an emergency release to make it work in 3.1 (r497, r498). Along with it there are also these changes:
  1. Fixed a crash when uninstalling the Chinese Phrase Tables package (r491)
  2. Fixed a crash when phrases longer than 2 characters are processed (r499)
  3. Fixed a bug in characters sorting, that the sorted array is incorrect (r499).

Wednesday, September 16, 2009

QuickScroll 2.1a.

Download: http://code.google.com/p/networkpx/downloads/detail?name=hk.kennytm.quickscroll2-0.2-1a.deb.

New features:
  • QuickScroll can be disabled for each particular app, including SpringBoard.
  • Activate by scrolling. (This is off by default since you can't have smooth scrolling with QuickScroll. Oh you have 3GS? Forget I what say then...)
  • New icon design by Sagitt.
  • Localizations.


After this release all features will be frozen. That is, no new features will be accepted, no matter how ingenious it is. (Ya know, this thing gotta be pushed out some day). Only bug fix and new localizations will be allowed for 2.2 (the public version).

Tuesday, September 15, 2009

QuickScroll 2.1.

Download: http://code.google.com/p/networkpx/downloads/detail?name=hk.kennytm.quickscroll2-0.2-1.deb

Changes:
  • The scrollers should now be easier to grab and move around.
  • Duration now really defaults to 2 seconds on first install. Thanks fusen for noticing.
  • Scrollbars can be chosen to jump on spot instead of next page. Thanks Sagitt for suggestion.


(If there're no other bugs I'll submit this version to BigBoss.)

Monday, September 14, 2009

QuickScroll 2 released

With a 333% size increase*, QuickScroll 2 is released to improve the scrolling experience.


  • QuickScroll 2 now introduces scrollbars, which is the default.

  • Besides PDF files, scroll views that explicitly allowed for paging can also be targeted.

  • The old scroller is still accessible, but you can now move it around (and occupies much less space).

  • (To jump to a page, tap the 123 icon at the lower right corner in scroll bar mode, or tap the ← arrow button in scroller dialog mode.)

  • These configuration can be set in Settings.

  • As you can see, there are 2 more gestures you can choose. The two-finger tap should allow you activate QuickScroll in a table view easier.

  • I've eliminated the close button. The scrollers will disappear in 2 seconds of inactivity.

  • QuickScroll's scrollers are now actually a subview of the scrolling view, while in the 1st version it is an alert box. This change allows QuickScroll to be used in very high-level windows like those in SBSettings and GriP.

  • I don't know how to localize PreferenceLoader entries yet. So no localizations in this version, sorry.




*: 24 KiB → 104 KiB on disk.

Friday, September 11, 2009

Get UIView hierarchy, take 3.

The previous post about dumping UIView hierarchy is actually over-complicated. Actually all you need is one command (in gdb):

po [[[UIApplication sharedApplication] keyWindow] scriptingInfoWithChildren]


The result will be very verbose, make sure your terminal has enough scrollback.

Thursday, September 10, 2009

iKeyEx 0.1-99i released.

Download = here.

Changes:
  • Fixed issue 313. In an alt (numbers) plane, pressing the space key will go back to the main (alphabets) plane.
  • Typing the apostrophe (') in the main plane no longer auto-switch to the alt plane.
  • Fixed issue 312, and many other auto-shift related quirks.
  • .cin IME:
    • Number of candidates is limited to avoid near-infinite loop. 64.0 candidates should be enough for everyone.
    • Multi-radical continuation works again.
    • Fixed cases where blank candidates appear.
    • Candidate searching now operates in serial for reliability. You may experience some degrade in performance.
    • A progress indicator is added when the Patricia tree dump for the IME was first generated. This is essential for some huge IME like 輕鬆輸入法, which takes nearly 2 minutes for the first launch.


(Chinese Users: 倉頡輸入法及額外字頻表及詞庫亦更新至 0.2-1 版,這與 0.2-0 版內容上其實沒分別,只是製作 deb 時改用了 gnutar,從而避免因含非 ASCII 檔名而導致安裝失敗。若果你正在使用這些軟件,則不用更新。)

By the way, if you find any bugs, please report at Issues in the project page. If you leave a comment here or the wiki I can't guarantee I can dig and fix that.

Preemptive Warning: Comments not related to this content will be ignored.

Monday, September 7, 2009

Introducing Subjective-C, an objc_msgSend[_[st|fp]ret]? logger.

Time ago I logged calls to objc_msgSend to understand how to construct UIKBKeyboards. But that logger is known to cause problems due to asserting the arguments use less than 1024 bytes. I needed to log calls again for issue 312, but the old buggy behavior leads me to rewriting it more reliably.

The result is the dynamic library called Subjective-C. It has the following new features:
  • Stack-safe. No arguments will be lost due to this logger.
  • Call tree construction.
  • Filtering.

along with the old features:
  • Print and format all arguments, and the return value.


Note:
  • Due to licensing, only the ARM version is released, although the x86 version works perfectly.
  • If your product depends on Subjective-C (why?), please note that it is GPLv3.
  • (No, it won't help even if I BSD everything.)


Sample output




+[UIScroller _registerForNotifications]
+[NSString alloc] {
+[NSString allocWithZone:] (0x0)
}
+[NSBundle mainBundle] {
-[NSRecursiveLock lock] <0x1007540>
-[NSRecursiveLock unlock] <0x1007540>
} = <NSBundle 0x100db50>
-[NSBundle bundleIdentifier] <0x100db50> {
-[NSBundle infoDictionary] <0x100db50> {
-[NSBundle _cfBundle] <0x100db50> = 0x1009d60
} = <NSCFDictionary 0x100af10>
-[NSCFDictionary objectForKey:] <0x100af10> (@"CFBundleIdentifier") = @"com.yourcompany.Untitled4"
} = @"com.yourcompany.Untitled4"
-[NSPlaceholderString initWithFormat:] <0x100cf70> (@"%@.UIKit.migserver") {
-[NSPlaceholderString initWithFormat:locale:arguments:] <0x100cf70> (@"%@.UIKit.migserver", nil, "∞≠") {
-[NSCFString respondsToSelector:] <0x100adb0> (@selector(descriptionWithLocale:)) {
-[NSCFString class] <0x100adb0> = NSCFString
+[NSCFString resolveInstanceMethod:] (@selector(descriptionWithLocale:)) = NO
} = NO
-[NSCFString description] <0x100adb0> = /*self*/ @"com.yourcompany.Untitled4"
} = @"com.yourcompany.Untitled4.UIKit.migserver"
} = @"com.yourcompany.Untitled4.UIKit.migserver"