如何从private header中派生自己的类?

如下面的例子

#import "ViewController.h"
#import <objc/runtime.h>
#import <dlfcn.h>

@interface AADeviceInfo : NSObject
- (id)serialNumber;
@end

@interface MyAADeviceInfo : AADeviceInfo
- (id)serialNumber;
@end

@implementation MyAADeviceInfo
- (id)serialNumber
{
    id sn = [super serialNumber];
    NSLog(@"SN is %@", sn);
    return sn;
}
@end

@interface ViewController ()
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)getSNButtonPressed:(UIButton *)sender
{
    void *openedAA = dlopen("/System/Library/PrivateFrameworks/AppleAccount.framework/AppleAccount", RTLD_NOW);

    if (NULL == openedAA)
    {
        NSLog(@"!!!! Open AppleAccount failed !!!!");
        return;
    }   
}
@end

The errors are:
Undefined symbols for architecture armv7:
OBJC_METACLASS$_AADeviceInfo”, referenced from:
OBJC_METACLASS$_MyAADeviceInfo in ViewController.o
OBJC_CLASS$_AADeviceInfo”, referenced from:
OBJC_CLASS$_MyAADeviceInfo in ViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

如果将framework拖进去,直接提示找不到framework。
ld: framework not found AppleAccount
clang: error: linker command failed with exit code 1 (use -v to see invocation)

是用的Theos还是OpenDev?

都没用,直接和普通app一样。

我刚刚看了下8以后的privateframework,怎么都变成了tbd文件了,mach-o文件跑哪儿去了,只能从手机里获取了吗?

需要decache

谢谢狗神,这个倒不是主要问题,主要问题是这个帖子的标题,呵呵,怎么折腾啊?

学好英语,善用Google

。。。好吧,我继续折腾,话说我对于自己的英语还是有点信心的~~

这个问题后来解决了么?