How to make micro-channel can download the APK file package, 366api resolve micro-channel built-in browser can not open the download link solutions APP

Do micro-channel marketing or promotion when downloading APK, domain names are often sealed, so that the micro-channel in normal use it? It is necessary to use some of the tools to achieve efficient operation.

First to understand the principles of micro-channel shielding. According to the principle one by one break, I do believe handy anti-seal from a year are summarized as follows: micro-channel shielding principle first automatic detection system, manual inspection is the second micro-channel staff.

 
Solution principle

this is to use some of the micro-letters BUG, Android phone, then by clicking on the link to jump directly to a micro-channel. The phone automatically opens the default browser. However, this method IOS system does not work. I can only judge wrote. Android mobile phone users click directly open the default browser or download marketing activities APK. IOS, then the first method with the above said!
Free test interface: 366API

source code can refer to:

<?php
function get_ticket($code){
    //初始化
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // https请求 不验证证书和hosts
    $headers = array();
    $headers[] = 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_1_2 like Mac OS X; zh-CN) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/15B202 UCBrowser/11.7.7.1031 Mobile  AliApp(TUnionSDK/0.1.20)';
    $headers[] = 'Referer: https://m.mall.qq.com/release/?busid=mxd2&ADTAG=jcp.h5.index.dis';
    $headers[] = 'Content-Type:application/x-www-form-urlencoded; charset=UTF-8';
 
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    $content = curl_exec($ch);
    curl_close($ch);
    //$arr = json_decode($content,1);
    //if($arr['success'] == '1'){
    //    $shotCode = $arr['shotCode'];
    //}else{
    //    $shotCode = '';
    //}
    //preg_match('/openlink\":\"(.*?)\"}/',$content,$result);
    //$url = $result[1];
     
    preg_match('/href=\"(.*?)#wechat/',$content,$result);
    $url = $result[1];
    return $url;
}
    $time = time()-$info['ticket_time'];
    $minute=floor($time/60);
    query_update ( "jump_logs", "count=count+1". " where code='" . $code . "'" );
    if($minute >= 59){
        //如果超过1小时,更新ticket
        $url = get_ticket($w_url_code);
        if($url){
        query_update ( "jump_logs", "ticket_time='".time()."', ticket='" . $url . "' where code='" . $code . "'" );
        $ticket_url = $url.'#';
        if(strpos($_SERVER['HTTP_USER_AGENT'],'baiduboxapp') || the strpos ($ _ SERVER [ 'the HTTP_USER_AGENT'], 'baiduboxapp')) { Andrews Baidu mobile APP//
            echo '<script>window.location.href = "bdbox://utils?action=sendIntent&minver=7.4¶ms=%7b%22intent%22%3a%22'.$url.'%23wechat_redirect%23wechat_redirect%23Intent%3bend%22%7d";</script>';
            }else{
                echo '<script>window.location.href = "'.$ticket_url.'";</script>';
            }
        }
    }else{
        $ticket_url = $info['ticket'].'#';
        if(strpos($_SERVER['HTTP_USER_AGENT'], 'baiduboxapp')||strpos($_SERVER['HTTP_USER_AGENT'], 'baiduboxapp')) { Andrews Baidu mobile APP//
            echo '<script>window.location.href = "bdbox://utils?action=sendIntent&minver=7.4&params=%7b%22intent%22%3a%22'.$info['ticket'].'%23wechat_redirect%23wechat_redirect%23Intent%3bend%22%7d";</script>';
            }else{
                echo '<script>window.location.href = "'.$ticket_url.'";</script>';
            }
    }
}
?>
<!详情可参考:http://www.366api.cn--> 

 

Guess you like

Origin www.cnblogs.com/oppis/p/10956774.html