Skip to content

Instantly share code, notes, and snippets.

void startListening()
{
void (*registerCallbacks)(RCTProfileCallbacks *) = dlsym(RTLD_DEFAULT, "RCTProfileRegisterCallbacks");
if(registerCallbacks != NULL)
{
registerCallbacks(&profilerHackedCallbacks);
}
}
char* profileStart()
{
NSLog(@"profile start");
return 0;
}
void profileStop()
{
NSLog(@"profile stop");
}
typedef struct {
const char *key;
int key_len;
const char *value;
int value_len;
} systrace_arg_t;
typedef struct {
char *(*start)(void);
void (*stop)(void);
@aboelbisher
aboelbisher / main.m
Last active March 24, 2019 17:29
Hacking the react-native Profiler
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
@import ObjectiveC;
@import Darwin;