iOS ipa 文件在线安装

文件目录

index.html

<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
  </head>
  <body>
    <div style="text-align:center;margin-top:200px;">
      <a href="itms-services://?action=download-manifest&url=https://www.liuguofeng.com/uploads/ipa.plist">
        click to install app
      </a>
    </div>
  </body>
</html>
Continue reading iOS ipa 文件在线安装

N个数字可重复的排列组合 PHP

商品有三种价格 8,59,68,卖出不多于10件商品,可以卖出多少种方式

<?php
$a = [8,59,68];
function getList($array,$count,$index = 0,$up =0)
{
    static $result = [];
	for ($i=$index; $i < $count; $i++) {
	    foreach($array as $k => $v){
            $value = $up?$up.'+'.$v:$v;
            $result[]  = $value;
            getList($array,$count,$i+1,$value);
	    }    	
    }
    return $result ;
	
}
var_export(getList($a,10));

结果是 3^10 次方种

PHP 生成微信小程序码 自定义路径及参数

//生成小程序码
public function wx_code($path){
  $appid = 'wxf0000000000000000';
  $secret = '0a4a0000000000000000000000000';
  $token_url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$appid}&secret={$secret}";
  $access = file_get_contents($token_url);
  $access = json_decode($access,true);
  $access_token = $access['access_token'];
  
  // 配置参数
  $url = "https://api.weixin.qq.com/wxa/getwxacode?access_token={$access_token}";
  $method = 'POST';
  $body = array('path'=>$path);
  $headers = array('Content-Type:'.'application/json');

  // 创建连接
  $curl = curl_init($url);
  curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
  curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($curl, CURLOPT_FAILONERROR, false);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($curl, CURLOPT_HEADER, false);
  curl_setopt($curl, CURLOPT_POST, true);
  curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($body));
  curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,FALSE);
  curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,FALSE);//严格校验

  // 发送请求
  $response = curl_exec($curl);
  curl_close($curl);
  $src = 'data:image/jpeg;base64,' . base64_encode($response);
  echo "<img src='{$src}'>";
}

React-Native 报错记录

PS C:\wwwroot\react-native\react_natigation_demo> react-native run-android
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...

FAILURE: Build failed with an exception.

* Where:
Settings file 'C:\wwwroot\react-native\react_natigation_demo\android\settings.gradle' line: 3

* What went wrong:
Could not compile settings file 'C:\wwwroot\react-native\react_natigation_demo\android\settings.gradle'.
> startup failed:
  settings file 'C:\wwwroot\react-native\react_natigation_demo\android\settings.gradle': 3: unexpected char: '\' @ line 3, column 133.
     s\react-native-gesture-handler\android')
                                   ^

  1 error


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Command failed: gradlew.bat installDebug

Error: Command failed: gradlew.bat installDebug
    at checkExecSyncError (child_process.js:600:11)
    at Object.execFileSync (child_process.js:618:13)
    at runOnAllDevices (C:\wwwroot\react-native\react_natigation_demo\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19)
    at buildAndRun (C:\wwwroot\react-native\react_natigation_demo\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12)
    at isPackagerRunning.then.result (C:\wwwroot\react-native\react_natigation_demo\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12)
    at process._tickCallback (internal/process/next_tick.js:68:7)

PS C:\wwwroot\react-native\react_natigation_demo> react-native upgrade
You should consider using the new upgrade tool based on Git. It makes upgrades easier by resolving most conflicts automatically.
To use it:
- Go back to the old version of React Native
- Run "npm install -g react-native-git-upgrade"
- Run "react-native-git-upgrade"
See https://facebook.github.io/react-native/docs/upgrading.html
Upgrading project to react-native v0.58.6
Check out the release notes and breaking changes: https://github.com/facebook/react-native/releases/tag/v0.58.0
android\app\build.gradle has changed in the new version.
Do you want to keep your android\app\build.gradle or replace it with the latest version?
If you ever made any changes to this file, you'll probably want to keep it.
You can see the new version here: C:\wwwroot\react-native\react_natigation_demo\node_modules\react-native\local-cli\templates\HelloWorld\android\app\build.gradle
Do you want to replace android\app\build.gradle? Answer y to replace, n to keep your version:
y
Replacing android\app\build.gradle
android\app\src\main\java\com\react_natigation_demo\MainApplication.java has changed in the new version.
Do you want to keep your android\app\src\main\java\com\react_natigation_demo\MainApplication.java or replace it with the latest version?
If you ever made any changes to this file, you'll probably want to keep it.
You can see the new version here: C:\wwwroot\react-native\react_natigation_demo\node_modules\react-native\local-cli\templates\HelloWorld\android\app\src\main\java\com\helloworld\MainApplication.java
Do you want to replace android\app\src\main\java\com\react_natigation_demo\MainApplication.java? Answer y to replace, n to keep your version:
y
Replacing android\app\src\main\java\com\react_natigation_demo\MainApplication.java
android\settings.gradle has changed in the new version.
Do you want to keep your android\settings.gradle or replace it with the latest version?
If you ever made any changes to this file, you'll probably want to keep it.
You can see the new version here: C:\wwwroot\react-native\react_natigation_demo\node_modules\react-native\local-cli\templates\HelloWorld\android\settings.gradle
Do you want to replace android\settings.gradle? Answer y to replace, n to keep your version:
y
Replacing android\settings.gradle
ios\react_natigation_demo.xcodeproj\project.pbxproj has changed in the new version.
Do you want to keep your ios\react_natigation_demo.xcodeproj\project.pbxproj or replace it with the latest version?
If you ever made any changes to this file, you'll probably want to keep it.
You can see the new version here: C:\wwwroot\react-native\react_natigation_demo\node_modules\react-native\local-cli\templates\HelloWorld\ios\HelloWorld.xcodeproj\project.pbxproj
Do you want to replace ios\react_natigation_demo.xcodeproj\project.pbxproj? Answer y to replace, n to keep your version:
y
Replacing ios\react_natigation_demo.xcodeproj\project.pbxproj
Successfully upgraded this project to react-native v0.58.6
PS C:\wwwroot\react-native\react_natigation_demo> react-native run-android
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...

> Configure project :app
WARNING: The specified Android SDK Build Tools version (28.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.2.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '28.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:installDebug
10:18:46 V/ddms: execute: running am get-config
10:18:46 V/ddms: execute 'am get-config' on 'TA39200H1V' : EOF hit. Read: -1
10:18:46 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'XT1572 - 7.0' for app:debug
10:18:46 D/app-debug.apk: Uploading app-debug.apk onto device 'TA39200H1V'
10:18:46 D/Device: Uploading file onto device 'TA39200H1V'
10:18:46 D/ddms: Reading file permision of C:\wwwroot\react-native\react_natigation_demo\android\app\build\outputs\apk\debug\app-debug.apk as: rwx------
10:18:48 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
10:18:51 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'TA39200H1V' : EOF hit. Read: -1
10:18:51 V/ddms: execute: returning
10:18:51 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
10:18:51 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'TA39200H1V' : EOF hit. Read: -1
10:18:51 V/ddms: execute: returning
Installed on 1 device.

BUILD SUCCESSFUL in 46s
28 actionable tasks: 28 executed
Running C:\Users\imfon\AppData\Local\Android\Sdk/platform-tools/adb -s TA39200H1V reverse tcp:8081 tcp:8081
adb server version (32) doesn't match this client (40); killing...
* daemon started successfully
Starting the app on TA39200H1V (C:\Users\imfon\AppData\Local\Android\Sdk/platform-tools/adb -s TA39200H1V shell am start -n com.react_natigation_demo/com.react_natigation_demo.MainActivity)...
Starting: Intent { cmp=com.react_natigation_demo/.MainActivity }