根据已有的package name下载官方market应用的页面
$PackageList=../package.list
$WebClient = New-Object System.Net.WebClient
$WebClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
$info = get-content $PackageList
$count=0
foreach ($i in $info) {
$count++
$count+".Package "+$i
$Results = $WebClient.DownloadString("https://market.android.com/details?id="+$i)
$Results | Out-File -filepath $i -append
}
提取出所有的Developer site,依次检查每个页面,若有.apk则记录
$SiteList=officialSite.txt
$resultFile ='officialApk.log'
$Reg='.+/.apk'
$WebClient = New-Object System.Net.WebClient
$WebClient.Encoding = [System.Text.Encoding]::UTF8
$WebClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
$info = get-content $SiteList
$count=0
foreach ($i in $info) {
$count++
$i
$Results = $WebClient.DownloadString($i)
$Results -match $Reg
if($Results){
$i +','+ $matches[0] | Out-File -filepath $resultFile -append
$Results| Out-File -filepath $count -append
}
}