All Projects → Insfgg99x → Hotfix

Insfgg99x / Hotfix

Licence: mit
一种轻量级的可以通过苹果审核的热修复方案,可以替代JSPatch的热修复方案。

Projects that are alternatives of or similar to Hotfix

Zencash Swing Wallet Ui
ZENCash Desktop GUI Wallet
Stars: ✭ 96 (-15.79%)
Mutual labels:  wallet
Django Cc
Django wallet for Bitcoin and other cryptocurrencies
Stars: ✭ 105 (-7.89%)
Mutual labels:  wallet
Analyzer Of Android For Apache Weex
Stars: ✭ 111 (-2.63%)
Mutual labels:  weex
Amigo
A hotfix library for Android platform, and not just this...
Stars: ✭ 1,350 (+1084.21%)
Mutual labels:  hotfix
Weexjandan
Weex Vue写的解析HTML应用
Stars: ✭ 100 (-12.28%)
Mutual labels:  weex
Beancounter
Utility to audit the balance of Hierarchical Deterministic (HD) wallets. Supports multisig + segwit wallets.
Stars: ✭ 109 (-4.39%)
Mutual labels:  wallet
Guarda Android Wallets
Mobile cryptocurrency wallets for Android
Stars: ✭ 95 (-16.67%)
Mutual labels:  wallet
Desktop
The official Musicoin Desktop Wallet Application
Stars: ✭ 112 (-1.75%)
Mutual labels:  wallet
Hd Wallet Addrs
A command-line tool that performs Bitcoin wallet address discovery.
Stars: ✭ 104 (-8.77%)
Mutual labels:  wallet
Macao Social Wallet
Simple Social Wallet made without javascript using the Freecoin toolkit
Stars: ✭ 110 (-3.51%)
Mutual labels:  wallet
Bitbox Wallet App
The BitBoxApp for desktop and mobile.
Stars: ✭ 98 (-14.04%)
Mutual labels:  wallet
Esteem Surfer
Ecency desktop formerly known as Esteem Surfer - reimagined desktop social wallet, contribute and get rewarded (for Windows, Mac, Linux)
Stars: ✭ 100 (-12.28%)
Mutual labels:  wallet
Weex Analysis Project
Weex源码分析系列文章
Stars: ✭ 110 (-3.51%)
Mutual labels:  weex
Mln
高性能、小巧、易上手的移动跨平台开发框架. A framework for building Mobile cross-platform apps with Lua
Stars: ✭ 1,343 (+1078.07%)
Mutual labels:  weex
Stacks Wallet
Stacks Wallet—Send and receive STX tokens on the Stacks Blockchain.
Stars: ✭ 112 (-1.75%)
Mutual labels:  wallet
Etherwalletkit
Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.
Stars: ✭ 96 (-15.79%)
Mutual labels:  wallet
Fastdex
🚀 加快 apk 的编译速度 🚀
Stars: ✭ 1,457 (+1178.07%)
Mutual labels:  hotfix
Raiwebwallet
Raiblocks raiwallet.com wallet source code
Stars: ✭ 113 (-0.88%)
Mutual labels:  wallet
Weex Android Joke
A joke android app,powered by alibaba's weex.
Stars: ✭ 112 (-1.75%)
Mutual labels:  weex
Easywebpack Cli
A Powerful Cross-platform Webpack CLI Tool
Stars: ✭ 110 (-3.51%)
Mutual labels:  weex

HotFix

一种轻量级的可以通过苹果审核的热修复方案,可以替代JSPatch。


使用 Usage

  • 1.App启动时,用同步的方式调用接口,从服务器请求下发的JavaScript字符串
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //sync downloading js here
    //App启动时,主动同步请求服务端修复脚本,并执行修复方案
    //do something else
    return YES;
}
  • 2.执行修复 下载完成后,同步的方式执行修复:
[[HotFix shared] fix:js];

两步合到一起:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //sync downloading js here
    //App启动时,主动同步请求服务端修复脚本,并执行修复方案
    //这个里的js应该是通过同步的方式请求接口得到的,如:
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://xxxx/hotfix?access_token=xxxx"]];//调用获取修复脚本的接口
    NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
    NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    NSString *js = json[@"hotfix_js"];//这里只是举个例子
    if(js) {
        [[HotFix shared] fix:js];
    }
    //do something else
    return YES;
}

举个栗子🌰 For Example

ViewController里有一个这样的调用,参数为nil时会导致崩溃。

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self join:@"Steve" b:nil];
}
- (void)join:(NSString *)a b:(NSString *)b {
    NSArray *tmp = @[a,b,@"Good Job!"];
    NSString *c = [tmp componentsJoinedByString:@" "];
    printf("%s\n",[c UTF8String]);
}

@end

我们从服务器下发这段脚本来修复这个闪退(替换join🅱️这个方法):

"fixInstanceMethodReplace('ViewController', 'join🅱️', function(instance, originInvocation, originArguments){ 
    if (!originArguments[0] || !originArguments[1]) { 
        console.log('nil goes here'); 
    } else { 
        runInvocation(originInvocation); 
    } 
});"

App重新启动的时候,会以同步的方式加载到该脚本,并执行修复:

[[HotFix shared] fix:js];

这样原来的jion🅱️方法就会被替换,当参数为nil时,就会打印nil gose here,若不为nil则正常执行。这样崩溃就解决了~

由于修复过程所有操作都是native的,所以不会影响苹果审核

安装 Installation

pod repo update
pod `HotFix`
  • 更多信息请参考该链接
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].