#include <substrate.h>
+#define WTF_USE_JSC 1
+
#import <GraphicsServices/GraphicsServices.h>
#import <UIKit/UIKit.h>
#import <AddressBook/AddressBook.h>
#include <WebCore/WebCoreThread.h>
#include <WebKit/WebPreferences-WebPrivate.h>
+#include "wtf/Platform.h"
+#include "CString.h"
+#include "ScriptElement.h"
+#include "ScriptSourceCode.h"
+
@interface WebView (UICaboodle)
- (void) setScriptDebugDelegate:(id)delegate;
- (void) _setFormDelegate:(id)delegate;
_disused static unsigned trace_;
+#define _assert(test) do { \
+ if (!(test)) { \
+ NSLog(@"_assert(%u)@%s:%u[%s]\n", \
+ trace_++, __FILE__, __LINE__, __FUNCTION__\
+ ); \
+ } \
+} while (false)
+
#define _trace() do { \
NSLog(@"_trace(%u)@%s:%u[%s]\n", \
trace_++, __FILE__, __LINE__, __FUNCTION__\
subrect.size.height -= extra;
[scroller_ setScrollerIndicatorSubrect:subrect];
+#undef NSSize
NSSize visible(NSMakeSize(subrect.size.width, subrect.size.height));
[document_ setValue:[NSValue valueWithSize:visible] forGestureAttribute:UIGestureAttributeVisibleSize];
@end
+WebCore::String (*__ZNK7WebCore6String15stripWhiteSpaceEv)(WebCore::String *);
+extern "C" WebCore::String _ZNK7WebCore6String15stripWhiteSpaceEv(WebCore::String *_this) {
+ return __ZNK7WebCore6String15stripWhiteSpaceEv(_this); }
+WebCore::String (*__ZNK7WebCore6String5lowerEv)(WebCore::String *);
+extern "C" WebCore::String _ZNK7WebCore6String5lowerEv(WebCore::String *_this) {
+ return __ZNK7WebCore6String5lowerEv(_this); }
+WebCore::CString (*__ZNK7WebCore6String4utf8Ev)(WebCore::String *);
+extern "C" WebCore::CString _ZNK7WebCore6String4utf8Ev(WebCore::String *_this) {
+ return __ZNK7WebCore6String4utf8Ev(_this); }
+const char *(*__ZNK7WebCore7CString4dataEv)(WebCore::CString *);
+extern "C" const char *_ZNK7WebCore7CString4dataEv(WebCore::CString *_this) {
+ return __ZNK7WebCore7CString4dataEv(_this); }
+
+MSHook(void, _ZN7WebCore17ScriptElementData14evaluateScriptERKNS_16ScriptSourceCodeE, WebCore::ScriptElementData *_this, const WebCore::ScriptSourceCode &code) {
+ WebCore::String type(_this->m_scriptElement->typeAttributeValue());
+ type = type.stripWhiteSpace().lower();
+ NSLog(@"type:%s", type.utf8().data());
+ __ZN7WebCore17ScriptElementData14evaluateScriptERKNS_16ScriptSourceCodeE(_this, code);
+}
+
+template <typename Type_>
+static void nlset(Type_ &function, struct nlist *nl, size_t index) {
+ struct nlist &name(nl[index]);
+ uintptr_t value(name.n_value);
+ _assert(value != 0);
+ if ((name.n_desc & N_ARM_THUMB_DEF) != 0)
+ value |= 0x00000001;
+ function = reinterpret_cast<Type_>(value);
+}
+
@implementation WebCycriptLockScreenController
++ (void) initialize {
+ struct nlist nl[6];
+ memset(nl, 0, sizeof(nl));
+ nl[0].n_un.n_name = (char *) "__ZN7WebCore17ScriptElementData14evaluateScriptERKNS_16ScriptSourceCodeE";
+ nl[1].n_un.n_name = (char *) "__ZNK7WebCore6String15stripWhiteSpaceEv";
+ nl[2].n_un.n_name = (char *) "__ZNK7WebCore6String5lowerEv";
+ nl[3].n_un.n_name = (char *) "__ZNK7WebCore6String4utf8Ev";
+ nl[4].n_un.n_name = (char *) "__ZNK7WebCore7CString4dataEv";
+ nlist("/System/Library/PrivateFrameworks/WebCore.framework/WebCore", nl);
+ void (*_ZN7WebCore17ScriptElementData14evaluateScriptERKNS_16ScriptSourceCodeE)(WebCore::ScriptElementData *, const WebCore::ScriptSourceCode &);
+ nlset(_ZN7WebCore17ScriptElementData14evaluateScriptERKNS_16ScriptSourceCodeE, nl, 0);
+ nlset(__ZNK7WebCore6String15stripWhiteSpaceEv, nl, 1);
+ nlset(__ZNK7WebCore6String5lowerEv, nl, 2);
+ nlset(__ZNK7WebCore6String4utf8Ev, nl, 3);
+ nlset(__ZNK7WebCore7CString4dataEv, nl, 4);
+ MSHookFunction(_ZN7WebCore17ScriptElementData14evaluateScriptERKNS_16ScriptSourceCodeE, MSHake(_ZN7WebCore17ScriptElementData14evaluateScriptERKNS_16ScriptSourceCodeE));
+}
+
+ (id) rootViewController {
return [[[self alloc] init] autorelease];
}
flags := -framework UIKit -framework AddressBook
base := $(shell cd ~; pwd)/menes/tweaks
include $(base)/tweak.mk
+webcore := WebCore-514
+jscore := JavaScriptCore-521
all: WebCycriptLockScreen
WebCycriptLockScreen: LockScreen.mm makefile $(base)/../mobilesubstrate/substrate.h
- $(target)g++ -bundle -mthumb -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -lobjc -I$(base)/../mobilesubstrate $(link) $(flags) -framework CoreGraphics -framework QuartzCore -framework SpringBoardUI -framework WebCore -framework GraphicsServices -framework TelephonyUI
+ $(target)g++ -bundle -mthumb -g0 -O2 -Wall -Werror -o $@ $(filter %.mm,$^) -lobjc -I$(base)/../mobilesubstrate $(link) $(flags) -framework CoreGraphics -framework QuartzCore -framework SpringBoardUI -framework WebCore -framework JavaScriptCore -framework GraphicsServices -framework TelephonyUI -I$(jscore) -iquote$(webcore)/{bindings/js,dom,loader,platform{,/animation,/cf,/network{,/cf},/text},/rendering/style} -iquote$(jscore)/{jit,runtime}
ldid -S $@
extra: