chengyanfang

init

No preview for this file type
  1 +# Xcode
  2 +#
  3 +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
  4 +
  5 +## Build generated
  6 +build/
  7 +DerivedData/
  8 +
  9 +## Various settings
  10 +*.pbxuser
  11 +!default.pbxuser
  12 +*.mode1v3
  13 +!default.mode1v3
  14 +*.mode2v3
  15 +!default.mode2v3
  16 +*.perspectivev3
  17 +!default.perspectivev3
  18 +xcuserdata/
  19 +
  20 +## Other
  21 +*.moved-aside
  22 +*.xccheckout
  23 +*.xcscmblueprint
  24 +
  25 +## Obj-C/Swift specific
  26 +*.hmap
  27 +*.ipa
  28 +*.dSYM.zip
  29 +*.dSYM
  30 +
  31 +## Playgrounds
  32 +timeline.xctimeline
  33 +playground.xcworkspace
  34 +
  35 +# Swift Package Manager
  36 +#
  37 +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
  38 +# Packages/
  39 +# Package.pins
  40 +.build/
  41 +
  42 +# CocoaPods
  43 +#
  44 +# We recommend against adding the Pods directory to your .gitignore. However
  45 +# you should judge for yourself, the pros and cons are mentioned at:
  46 +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
  47 +#
  48 +# Pods/
  49 +
  50 +# Carthage
  51 +#
  52 +# Add this line if you want to avoid checking in source code from Carthage dependencies.
  53 +# Carthage/Checkouts
  54 +
  55 +Carthage/Build
  56 +
  57 +# fastlane
  58 +#
  59 +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
  60 +# screenshots whenever they are needed.
  61 +# For more information about the recommended setup visit:
  62 +# https://docs.fastlane.tools/best-practices/source-control/#source-control
  63 +
  64 +fastlane/report.xml
  65 +fastlane/Preview.html
  66 +fastlane/screenshots
  67 +fastlane/test_output
  1 +Pod::Spec.new do |s|
  2 + s.name = "HHBaseSDK"
  3 + s.version = "4.0.0.112317"
  4 + s.summary = "和缓基础SDK"
  5 +
  6 + s.description = <<-DESC
  7 + 和缓视频医生,连接千万用户和全科医生。
  8 + DESC
  9 +
  10 + s.homepage = 'https://code.hh-medic.com/dev-client/hhsdk.ios.base'
  11 + s.license = "MIT"
  12 + s.author = { 'hh_client@hh-medic.com' => 'chengyanfang@hh-medic.com' }
  13 + s.social_media_url = "https://github.com/515783034"
  14 +
  15 + s.platform = :ios, "9.0"
  16 + s.source = { :git => "http://code.hh-medic.com/hh_public/HHSDKBase.ios.git", :tag => s.version }
  17 + s.default_subspec = 'Base'
  18 +
  19 + # s.dependency 'TXIMSDK_iOS'
  20 +
  21 + s.subspec 'Base' do |base|
  22 + base.vendored_frameworks = 'HHBaseSDK/*.framework'
  23 + base.resources = 'HHBaseSDK/resources/*.bundle'
  24 +
  25 + base.frameworks = 'SystemConfiguration', 'MobileCoreServices', 'AVFoundation', 'CoreTelephony', 'VideoToolbox', 'AudioToolbox', 'CoreMedia'
  26 + base.libraries = 'z', 'sqlite3.0', 'c++', 'resolv.9'
  27 + end
  28 +
  29 +end
  30 +
  31 +
No preview for this file type
No preview for this file type
  1 +MIT License
  2 +
  3 +Copyright (c) 2018 _Ashen
  4 +
  5 +Permission is hereby granted, free of charge, to any person obtaining a copy
  6 +of this software and associated documentation files (the "Software"), to deal
  7 +in the Software without restriction, including without limitation the rights
  8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9 +copies of the Software, and to permit persons to whom the Software is
  10 +furnished to do so, subject to the following conditions:
  11 +
  12 +The above copyright notice and this permission notice shall be included in all
  13 +copies or substantial portions of the Software.
  14 +
  15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21 +SOFTWARE.
  1 +#!/usr/bin/env bash
  2 +
  3 +#
  4 +# Steps:
  5 +#
  6 +# 1. Download corresponding html file for some README.md:
  7 +# curl -s $1
  8 +#
  9 +# 2. Discard rows where no substring 'user-content-' (github's markup):
  10 +# awk '/user-content-/ { ...
  11 +#
  12 +# 3.1 Get last number in each row like ' ... </span></a>sitemap.js</h1'.
  13 +# It's a level of the current header:
  14 +# substr($0, length($0), 1)
  15 +#
  16 +# 3.2 Get level from 3.1 and insert corresponding number of spaces before '*':
  17 +# sprintf("%*s", substr($0, length($0), 1)*3, " ")
  18 +#
  19 +# 4. Find head's text and insert it inside "* [ ... ]":
  20 +# substr($0, match($0, /a>.*<\/h/)+2, RLENGTH-5)
  21 +#
  22 +# 5. Find anchor and insert it inside "(...)":
  23 +# substr($0, match($0, "href=\"[^\"]+?\" ")+6, RLENGTH-8)
  24 +#
  25 +
  26 +gh_toc_version="0.5.0"
  27 +
  28 +gh_user_agent="gh-md-toc v$gh_toc_version"
  29 +
  30 +#
  31 +# Download rendered into html README.md by its url.
  32 +#
  33 +#
  34 +gh_toc_load() {
  35 + local gh_url=$1
  36 +
  37 + if type curl &>/dev/null; then
  38 + curl --user-agent "$gh_user_agent" -s "$gh_url"
  39 + elif type wget &>/dev/null; then
  40 + wget --user-agent="$gh_user_agent" -qO- "$gh_url"
  41 + else
  42 + echo "Please, install 'curl' or 'wget' and try again."
  43 + exit 1
  44 + fi
  45 +}
  46 +
  47 +#
  48 +# Converts local md file into html by GitHub
  49 +#
  50 +# ➥ curl -X POST --data '{"text": "Hello world github/linguist#1 **cool**, and #1!"}' https://api.github.com/markdown
  51 +# <p>Hello world github/linguist#1 <strong>cool</strong>, and #1!</p>'"
  52 +gh_toc_md2html() {
  53 + local gh_file_md=$1
  54 + URL=https://api.github.com/markdown/raw
  55 + TOKEN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/token.txt"
  56 + if [ -f "$TOKEN" ]; then
  57 + URL="$URL?access_token=$(cat $TOKEN)"
  58 + fi
  59 + curl -s --user-agent "$gh_user_agent" \
  60 + --data-binary @"$gh_file_md" -H "Content-Type:text/plain" \
  61 + $URL
  62 +}
  63 +
  64 +#
  65 +# Is passed string url
  66 +#
  67 +gh_is_url() {
  68 + case $1 in
  69 + https* | http*)
  70 + echo "yes";;
  71 + *)
  72 + echo "no";;
  73 + esac
  74 +}
  75 +
  76 +#
  77 +# TOC generator
  78 +#
  79 +gh_toc(){
  80 + local gh_src=$1
  81 + local gh_src_copy=$1
  82 + local gh_ttl_docs=$2
  83 + local need_replace=$3
  84 +
  85 + if [ "$gh_src" = "" ]; then
  86 + echo "Please, enter URL or local path for a README.md"
  87 + exit 1
  88 + fi
  89 +
  90 +
  91 + # Show "TOC" string only if working with one document
  92 + if [ "$gh_ttl_docs" = "1" ]; then
  93 +
  94 + echo "Table of Contents"
  95 + echo "================="
  96 + echo ""
  97 + gh_src_copy=""
  98 +
  99 + fi
  100 +
  101 + if [ "$(gh_is_url "$gh_src")" == "yes" ]; then
  102 + gh_toc_load "$gh_src" | gh_toc_grab "$gh_src_copy"
  103 + if [ "$need_replace" = "yes" ]; then
  104 + echo
  105 + echo "!! '$gh_src' is not a local file"
  106 + echo "!! Can't insert the TOC into it."
  107 + echo
  108 + fi
  109 + else
  110 + local toc=`gh_toc_md2html "$gh_src" | gh_toc_grab "$gh_src_copy"`
  111 + echo "$toc"
  112 + if [ "$need_replace" = "yes" ]; then
  113 + local ts="<\!--ts-->"
  114 + local te="<\!--te-->"
  115 + local dt=`date +'%F_%H%M%S'`
  116 + local ext=".orig.${dt}"
  117 + local toc_path="${gh_src}.toc.${dt}"
  118 + local toc_footer="<!-- Added by: `whoami`, at: `date --iso-8601='minutes'` -->"
  119 + # http://fahdshariff.blogspot.ru/2012/12/sed-mutli-line-replacement-between-two.html
  120 + # clear old TOC
  121 + sed -i${ext} "/${ts}/,/${te}/{//!d;}" "$gh_src"
  122 + # create toc file
  123 + echo "${toc}" > "${toc_path}"
  124 + echo -e "\n${toc_footer}\n" >> "$toc_path"
  125 + # insert toc file
  126 + if [[ "`uname`" == "Darwin" ]]; then
  127 + sed -i "" "/${ts}/r ${toc_path}" "$gh_src"
  128 + else
  129 + sed -i "/${ts}/r ${toc_path}" "$gh_src"
  130 + fi
  131 + echo
  132 + echo "!! TOC was added into: '$gh_src'"
  133 + echo "!! Origin version of the file: '${gh_src}${ext}'"
  134 + echo "!! TOC added into a separate file: '${toc_path}'"
  135 + echo
  136 + fi
  137 + fi
  138 +}
  139 +
  140 +#
  141 +# Grabber of the TOC from rendered html
  142 +#
  143 +# $1 — a source url of document.
  144 +# It's need if TOC is generated for multiple documents.
  145 +#
  146 +gh_toc_grab() {
  147 + # if closed <h[1-6]> is on the new line, then move it on the prev line
  148 + # for example:
  149 + # was: The command <code>foo1</code>
  150 + # </h1>
  151 + # became: The command <code>foo1</code></h1>
  152 + sed -e ':a' -e 'N' -e '$!ba' -e 's/\n<\/h/<\/h/g' |
  153 + # find strings that corresponds to template
  154 + grep -E -o '<a.*id="user-content-[^"]*".*</h[1-6]' |
  155 + # remove code tags
  156 + sed 's/<code>//' | sed 's/<\/code>//' |
  157 + # now all rows are like:
  158 + # <a id="user-content-..." href="..."><span ...></span></a> ... </h1
  159 + # format result line
  160 + # * $0 — whole string
  161 + echo -e "$(awk -v "gh_url=$1" '{
  162 + print sprintf("%*s", substr($0, length($0), 1)*3, " ") "* [" substr($0, match($0, /a>.*<\/h/)+2, RLENGTH-5)"](" gh_url substr($0, match($0, "href=\"[^\"]+?\" ")+6, RLENGTH-8) ")"}' | sed 'y/+/ /; s/%/\\x/g')"
  163 +}
  164 +
  165 +#
  166 +# Returns filename only from full path or url
  167 +#
  168 +gh_toc_get_filename() {
  169 + echo "${1##*/}"
  170 +}
  171 +
  172 +#
  173 +# Options hendlers
  174 +#
  175 +gh_toc_app() {
  176 + local app_name="gh-md-toc"
  177 + local need_replace="no"
  178 +
  179 + if [ "$1" = '--help' ] || [ $# -eq 0 ] ; then
  180 + echo "GitHub TOC generator ($app_name): $gh_toc_version"
  181 + echo ""
  182 + echo "Usage:"
  183 + echo " $app_name [--insert] src [src] Create TOC for a README file (url or local path)"
  184 + echo " $app_name - Create TOC for markdown from STDIN"
  185 + echo " $app_name --help Show help"
  186 + echo " $app_name --version Show version"
  187 + return
  188 + fi
  189 +
  190 + if [ "$1" = '--version' ]; then
  191 + echo "$gh_toc_version"
  192 + return
  193 + fi
  194 +
  195 + if [ "$1" = "-" ]; then
  196 + if [ -z "$TMPDIR" ]; then
  197 + TMPDIR="/tmp"
  198 + elif [ -n "$TMPDIR" -a ! -d "$TMPDIR" ]; then
  199 + mkdir -p "$TMPDIR"
  200 + fi
  201 + local gh_tmp_md
  202 + gh_tmp_md=$(mktemp $TMPDIR/tmp.XXXXXX)
  203 + while read input; do
  204 + echo "$input" >> "$gh_tmp_md"
  205 + done
  206 + gh_toc_md2html "$gh_tmp_md" | gh_toc_grab ""
  207 + return
  208 + fi
  209 +
  210 + if [ "$1" = '--insert' ]; then
  211 + need_replace="yes"
  212 + shift
  213 + fi
  214 +
  215 + for md in "$@"
  216 + do
  217 + echo ""
  218 + gh_toc "$md" "$#" "$need_replace"
  219 + done
  220 +
  221 + echo ""
  222 + echo "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)"
  223 +}
  224 +
  225 +#
  226 +# Entry point
  227 +#
  228 +gh_toc_app "$@"
  1 +
  2 + // 多人呼叫不能选自己和非独立子账户
  3 + if isMultCall() {
  4 + let member = members?[indexPath.row]
  5 + if member?.uuid == AccountManager.default.getUUid() {
  6 + let alert = UIAlertController(title: nil, message: "不能邀请自己视频", preferredStyle: .alert)
  7 + alert.addAction(UIAlertAction(title: "我知道了", style: .default, handler: nil))
  8 +
  9 + topviewController()?.present(alert, animated: true, completion: nil)
  10 + removeSelf()
  11 + return
  12 + } else if !(member?.isAccount ?? false) {
  13 + let alert = UIAlertController(title: nil, message: "该成员需要开通独立登录的功能才能一起视频", preferredStyle: .alert)
  14 + alert.addAction(UIAlertAction(title: "去开通", style: .default, handler: { (_) in
  15 + let aVC = HHAddMemberVC.create()
  16 + aVC.addState = .supplyMulty
  17 + aVC.model = member
  18 + topviewController()?.navigationController?.pushViewController(aVC, animated: true)
  19 + }))
  20 + alert.addAction(UIAlertAction(title: "取消", style: .default, handler: nil))
  21 + topviewController()?.present(alert, animated: true, completion: nil)
  22 + removeSelf()
  23 + return
  24 + }
  25 +
  26 + let callInfo = HHCallerInfo()
  27 + callInfo.uuid = member?.uuid
  28 + callInfo.photourl = member?.photourl
  29 + callInfo.name = member?.name
  30 + HHMSDK.default.startTeamCall(.adult, callee: callInfo)
  31 + removeSelf()
  32 + return
  33 + }
  1 +git status
  2 +git add .
  3 +git commit -m "sdk upgrade"
  4 +git pull
  5 +git push
  6 +
  7 +echo '---------------------'
  8 +echo 'feature/rescue'
  9 +echo 'SDK product upgrade success'
  10 +echo '---------------------'