超级签功能优化

super_signature
nineven 5 years ago
parent 85a1982129
commit 72d8ebcfd8
  1. 7
      fir_client/src/components/FirAppInfosBase.vue
  2. 3
      fir_client/src/components/FirAppInfossecurity.vue
  3. 11
      fir_client/src/components/FirApps.vue
  4. 9
      fir_client/src/components/FirHeader.vue
  5. 153
      fir_client/src/components/FirSuperSignBase.vue
  6. 2
      fir_client/src/router/index.js
  7. 20
      fir_client/src/utils/index.js
  8. 2
      fir_ser/api/models.py
  9. 66
      fir_ser/api/utils/app/supersignutils.py
  10. 3
      fir_ser/api/views/apps.py
  11. 58
      fir_ser/api/views/supersign.py
  12. 45
      fir_ser/tests/postudid.py

@ -12,6 +12,7 @@
<span><i class="el-icon-cloudy"></i><b class="ng-binding">{{ appinfos.count_hits }}</b></span> <span><i class="el-icon-cloudy"></i><b class="ng-binding">{{ appinfos.count_hits }}</b></span>
<span class="bundleid ng-binding">BundleID<b class="ng-binding">&nbsp;&nbsp;{{ appinfos.bundle_id }}</b></span> <span class="bundleid ng-binding">BundleID<b class="ng-binding">&nbsp;&nbsp;{{ appinfos.bundle_id }}</b></span>
<span class="version ng-scope">{{ master_release.minimum_os_version }}&nbsp; 或者高版本</span> <span class="version ng-scope">{{ master_release.minimum_os_version }}&nbsp; 或者高版本</span>
<span class="short ng-scope" v-if="appinfos.issupersign">已经开启超级签</span>
</div> </div>
<div class="actions"> <div class="actions">
<el-button @click="appDownload" class="download" icon="el-icon-view"> <el-button @click="appDownload" class="download" icon="el-icon-view">
@ -33,7 +34,7 @@
<a class="" ref="combo" @click="combo"><i class="el-icon-copy-document" <a class="" ref="combo" @click="combo"><i class="el-icon-copy-document"
style="transform:rotateX(180deg);"></i>应用合并</a> style="transform:rotateX(180deg);"></i>应用合并</a>
</el-col> </el-col>
<el-col :span="3" v-if="appinfos.type"> <el-col :span="3" v-if="appinfos.type===1 && master_release.release_type ===1 ">
<a class="" ref="devices" @click="devices"><i class="el-icon-mobile-phone"></i>设备列表</a> <a class="" ref="devices" @click="devices"><i class="el-icon-mobile-phone"></i>设备列表</a>
</el-col> </el-col>
@ -111,7 +112,11 @@
}, },
devices(){ devices(){
this.setfunactive('devices',57); this.setfunactive('devices',57);
if(this.appinfos.issupersign){
this.$router.push({"name":'FirSuperSignBase', params: {act: "useddevices"},query:{bundleid:this.appinfos.bundle_id}})
}else {
this.$router.push({name: 'FirAppInfosdevices'}); this.$router.push({name: 'FirAppInfosdevices'});
}
}, },
}, created() { }, created() {

@ -84,7 +84,8 @@
}, },
methods: { methods: {
clean_app(){ clean_app(){
this.saveappinfo({"clean":true}) this.saveappinfo({"clean":true});
this.currentapp.count = 0;
}, },
saveappinfo(data) { saveappinfo(data) {
updateapp(data => { updateapp(data => {

@ -9,13 +9,13 @@
:visible.sync="willDeleteApp" :visible.sync="willDeleteApp"
width="50%"> width="50%">
<span v-if="delapp.issupersign">请先在权限管理页面关闭超级签名</span> <span v-if="delapp.issupersign">该应用开启了超级签名执行删除操作将会删除相关开发者账户下的证书等数据可能会导致已经下载的APP闪退并且删除后不可恢复请谨慎操作</span>
<span v-else>删除后不可恢复请谨慎操作</span> <span v-else>删除后不可恢复请谨慎操作</span>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="willDeleteApp = false"> </el-button> <el-button @click="willDeleteApp = false"> </el-button>
<el-button v-if="delapp.issupersign" type="danger" @click="$router.push({name: 'FirAppInfossecurity', params: {id: delapp.app_id}})"> </el-button> <!-- <el-button v-if="delapp.issupersign" type="danger" @click="$router.push({name: 'FirAppInfossecurity', params: {id: delapp.app_id}})"> </el-button>-->
<el-button v-else type="danger" @click="delApp"> </el-button> <el-button type="danger" @click="delApp"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -651,11 +651,6 @@
this.$store.dispatch("getUser", data.userinfo); this.$store.dispatch("getUser", data.userinfo);
this.searchapps(); this.searchapps();
let upload_domain = data.hdata.upload_domain;
if (!upload_domain) {
upload_domain = location.origin;
}
// this.$store.dispatch('doucurrentapp', {'firapps':1}); // this.$store.dispatch('doucurrentapp', {'firapps':1});
} else { } else {

@ -53,12 +53,6 @@ import {logout} from '../restful'
appName: '', appName: '',
} }
}, methods: { }, methods: {
handleSelect() {
},
checkUrl() {
},
handleCommand(command) { handleCommand(command) {
if (command === 'userinfo') { if (command === 'userinfo') {
this.$router.push({name: 'FirUserProfileInfo'}) this.$router.push({name: 'FirUserProfileInfo'})
@ -67,7 +61,8 @@ import {logout} from '../restful'
}else if (command === 'storage') { }else if (command === 'storage') {
this.$router.push({name: 'FirUserProfileStorage'}) this.$router.push({name: 'FirUserProfileStorage'})
}else if (command === 'supersign') { }else if (command === 'supersign') {
this.$router.push({name: 'FirSuperSignBase'}) this.$router.push({"name":'FirSuperSignBase', params: {act: "iosdeveloper"}})
} }
else if(command === 'exit'){ else if(command === 'exit'){
logout(data => { logout(data => {

@ -45,6 +45,13 @@
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick" tab-position="top"> <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick" tab-position="top">
<el-tab-pane label="开发者账户" name="iosdeveloper"> <el-tab-pane label="开发者账户" name="iosdeveloper">
<el-input
style="width: 30%;margin-right: 30px;margin-bottom: 10px"
v-model="appidseach"
clearable
placeholder="输入用户APPID" />
<el-button type="primary" icon="el-icon-search" @click="handleCurrentChange(pagination.currentPage)">搜索</el-button>
<el-table <el-table
:data="app_developer_lists" :data="app_developer_lists"
border border
@ -102,7 +109,7 @@
<el-button <el-button
size="mini" size="mini"
type="danger" type="danger"
@click="handleDelete(scope.$index, scope.row)">删除</el-button> @click="handleDeleteDeveloper(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -112,6 +119,23 @@
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="添加开发者" name="adddeveloper">添加开发者</el-tab-pane> <el-tab-pane label="添加开发者" name="adddeveloper">添加开发者</el-tab-pane>
<el-tab-pane label="设备消耗" name="useddevices"> <el-tab-pane label="设备消耗" name="useddevices">
<el-input
style="width: 30%;margin-right: 30px;margin-bottom: 10px"
v-model="udidsearch"
clearable
placeholder="输入UDID" />
<el-input
style="width: 20%;margin-right: 30px;margin-bottom: 10px"
v-model="Bundleidsearch"
clearable
placeholder="输入BundleID" />
<el-input
style="width: 20%;margin-right: 30px;margin-bottom: 10px"
v-model="appidseach"
clearable
placeholder="输入用户APPID" />
<el-button type="primary" icon="el-icon-search" @click="handleCurrentChange(pagination.currentPage)">搜索</el-button>
<el-table <el-table
:data="app_devices_lists" :data="app_devices_lists"
border border
@ -164,7 +188,9 @@
v-model="Bundleidsearch" v-model="Bundleidsearch"
clearable clearable
placeholder="输入BundleID" /> placeholder="输入BundleID" />
<el-button type="primary" icon="el-icon-search" @click="iosdevicesudidFun('GET',{udid:udidsearch,bundleid:Bundleidsearch})">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleCurrentChange(pagination.currentPage)">搜索</el-button>
<el-table <el-table
:data="app_udid_lists" :data="app_udid_lists"
border border
@ -222,12 +248,23 @@
<el-button <el-button
size="mini" size="mini"
type="danger" type="danger"
@click="iosdevicesudidFun('DELETE',{id:scope.row.id,aid:scope.row.app_id})">删除</el-button> @click="udidDeleteFun(scope)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<div style="margin-top: 20px" v-if="activeName!== 'adddeveloper'">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pagination.currentPage"
:page-sizes="[10, 20, 50, 100]"
:page-size="pagination.pagesize"
layout="total,sizes, prev, pager, next"
:total="pagination.total">
</el-pagination>
</div>
</el-tabs> </el-tabs>
</el-main> </el-main>
@ -235,7 +272,8 @@
<script> <script>
import {iosdeveloper, iosdevices,iosdevicesudid } from "../restful"; import {iosdeveloper, iosdevices, iosdevicesudid, userinfos} from "../restful";
import {removeAaary} from "../utils";
export default { export default {
name: "FirSuperSignBase", name: "FirSuperSignBase",
@ -247,16 +285,30 @@
activeName:"iosdeveloper", activeName:"iosdeveloper",
udidsearch:"", udidsearch:"",
Bundleidsearch:"", Bundleidsearch:"",
appidseach:"",
dialogaddDeveloperVisible:false, dialogaddDeveloperVisible:false,
title:"", title:"",
editdeveloperinfo:{}, editdeveloperinfo:{},
isedit:false, isedit:false,
placeholder:"", placeholder:"",
codeactiveVisible:false, codeactiveVisible:false,
pagination:{"currentPage":1,"total":0,"pagesize":10}
} }
}, },
methods: { methods: {
udidDeleteFun(scope){
this.iosdevicesudidFun('DELETE',{id:scope.row.id,aid:scope.row.app_id});
this.app_udid_lists=removeAaary(this.app_udid_lists,scope.row)
},
handleSizeChange(val) {
this.pagination.pagesize=val;
this.get_data_from_tabname(this.activeName,{"size":this.pagination.pagesize,"page":this.pagination.currentPage})
},
handleCurrentChange(val) {
this.pagination.currentPage=val;
this.get_data_from_tabname(this.activeName,{"size":this.pagination.pagesize,"page":this.pagination.currentPage})
},
IsNum(s){ IsNum(s){
if(s!=null){ if(s!=null){
var r,re; var r,re;
@ -273,7 +325,7 @@
closeOnClickModal:false, closeOnClickModal:false,
}).then(({ value }) => { }).then(({ value }) => {
if(value.toString().length>5 && this.IsNum(value)){ if(value.toString().length>5 && this.IsNum(value)){
this.iosdeveloperFun({"methods":"PUT","data":{"email":developer.email,"act":"nowactive","code":value}}); this.iosdeveloperFun({"methods":"PUT","data":{"email":developer.email,"act":"nowactive","code":value.replace(/^\s+|\s+$/g, "")}});
} }
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
@ -310,22 +362,42 @@
} }
} }
}, },
handleDelete(b){ handleDeleteDeveloper(developer_info){
// eslint-disable-next-line no-console
console.log(b)
this.$confirm('此操作会删除该苹果开发者账户下面的生成的证书等数据,可能会导致超级签包的闪退, 是否继续?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.iosdeveloperFun({"methods":"DELETE","data":{"email":developer_info.email}});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}, },
handleClick(tab, event) { get_data_from_tabname(tabname,data={}){
// eslint-disable-next-line no-console data.udid=this.udidsearch.replace(/^\s+|\s+$/g, "");
console.log(tab, event); data.bundleid=this.Bundleidsearch.replace(/^\s+|\s+$/g, "");
if(tab.name === "useddevices"){ data.appid=this.appidseach.replace(/^\s+|\s+$/g, "");
this.iosdevicesFun() this.$router.push({"name":'FirSuperSignBase', params: {act: tabname}});
}else if(tab.name === "devicesudid"){ if(tabname === "useddevices"){
this.iosdevicesudidFun('GET') this.iosdevicesFun('GET',data)
}else if(tab.name === "adddeveloper"){ }else if(tabname === "devicesudid"){
this.iosdevicesudidFun('GET',data)
}else if(tabname === "adddeveloper"){
this.title='新增私有开发者账户'; this.title='新增私有开发者账户';
this.dialogaddDeveloperVisible=true; this.dialogaddDeveloperVisible=true;
}else if(tabname === "iosdeveloper"){
this.iosdeveloperFun({"methods":"GET","data":data})
} }
},
// eslint-disable-next-line no-unused-vars
handleClick(tab, event) {
this.pagination={"currentPage":1,"total":0,"pagesize":10};
this.get_data_from_tabname(tab.name);
}, },
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
deviceformatter(row, column){ deviceformatter(row, column){
@ -345,21 +417,21 @@
} else } else
return ''; return '';
}, },
iosdevicesFun(){ iosdevicesFun(methods,data){
iosdevices(data=>{ iosdevices(data=>{
if(data.code === 1000){ if(data.code === 1000){
this.app_devices_lists = data.data; this.app_devices_lists = data.data;
// eslint-disable-next-line no-console this.pagination.total=data.count;
console.log(data)
} }
},{ },{
"methods":"GET" "methods":methods,"data":data
}) })
}, },
iosdeveloperFun(params){ iosdeveloperFun(params){
iosdeveloper(data=>{ iosdeveloper(data=>{
if(data.code === 1000){ if(data.code === 1000){
this.app_developer_lists = data.data; this.app_developer_lists = data.data;
this.pagination.total=data.count;
this.$store.dispatch("getUser",data.userinfo); this.$store.dispatch("getUser",data.userinfo);
this.$store.dispatch('doucurrentapp', {}); this.$store.dispatch('doucurrentapp', {});
if(this.dialogaddDeveloperVisible){ if(this.dialogaddDeveloperVisible){
@ -381,24 +453,43 @@
iosdevicesudidFun(action,data){ iosdevicesudidFun(action,data){
iosdevicesudid(data=>{ iosdevicesudid(data=>{
if(data.code === 1000){ if(data.code === 1000){
if(action !== "DELETE"){
this.app_udid_lists = data.data; this.app_udid_lists = data.data;
this.pagination.total=data.count;
}
} }
},{ },{
"methods":action,"data":data "methods":action,"data":data
}) })
},
getUserInfoFun(){
userinfos(data=>{
if(data.code === 1000){
this.$store.dispatch("getUser",data.data);
}else {
this.$message.error("用户信息获取失败")
} }
},{"methods":"GET"})
}, mounted() {
this.iosdeveloperFun({"methods":"GET"})
}, watch: {
// eslint-disable-next-line no-unused-vars
udidsearch: function (val, oldVal) {
// this.searchapps()
}, },
},filters:{
},computed:{
}, mounted() {
this.getUserInfoFun();
if(this.$route.params.act){
let activeName=this.$route.params.act;
let activeName_list=["useddevices","devicesudid","adddeveloper","iosdeveloper"];
for(let index in activeName_list){
if(activeName_list[index] === activeName){
this.activeName=activeName;
let bundleid=this.$route.query.bundleid;
if(bundleid){
this.Bundleidsearch=bundleid;
}
this.get_data_from_tabname(activeName);
return
}
}
}
this.get_data_from_tabname(this.activeName);
} }
} }
</script> </script>

@ -123,7 +123,7 @@ const router = new VueRouter({
component: FirAppBase, component: FirAppBase,
children: [ children: [
{ {
path: '', path: ':act',
name: 'FirSuperSignBase', name: 'FirSuperSignBase',
component: FirSuperSignBase, component: FirSuperSignBase,
} }

@ -177,3 +177,23 @@ export function uploadlocalstorage(file,certinfo,app,successcallback,processcall
uploadstorage(certinfo,file,successcallback,processcallback) uploadstorage(certinfo,file,successcallback,processcallback)
} }
export function removeAaary(_arr, _obj) {
var length = _arr.length;
for (var i = 0; i < length; i++) {
if (_arr[i] == _obj) {
if (i == 0) {
_arr.shift(); //删除并返回数组的第一个元素
return _arr;
}
else if (i == length - 1) {
_arr.pop(); //删除并返回数组的最后一个元素
return _arr;
}
else {
_arr.splice(i, 1); //删除下标为i的元素
return _arr;
}
}
}
}

@ -114,7 +114,7 @@ class Apps(models.Model):
indexes = [models.Index(fields=['app_id']),models.Index(fields=['id','user_id','type'])] indexes = [models.Index(fields=['app_id']),models.Index(fields=['id','user_id','type'])]
def __str__(self): def __str__(self):
return "%s %s" % (self.name,self.get_type_display()) return "%s %s-%s %s %s" % (self.name,self.get_type_display(),self.short,self.has_combo,self.issupersign)
class AppReleaseInfo(models.Model): class AppReleaseInfo(models.Model):

@ -197,12 +197,14 @@ class IosUtils(object):
} }
#更新已经完成签名状态,设备消耗记录,和开发者已消耗数量 #更新已经完成签名状态,设备消耗记录,和开发者已消耗数量
AppUDID.objects.filter(app_id=self.app_obj, udid=self.udid_info.get('udid')).update(**newdata) AppUDID.objects.filter(app_id=self.app_obj, udid=self.udid_info.get('udid')).update(**newdata)
if APPSuperSignUsedInfo.objects.filter(udid__udid=self.udid_info.get('udid'),developerid=self.developer_obj).count() == 0:
developer_obj = self.developer_obj
developer_obj.use_number=developer_obj.use_number + 1
developer_obj.save()
APPSuperSignUsedInfo.objects.create(app_id=self.app_obj, user_id=self.user_obj, developerid=self.developer_obj, APPSuperSignUsedInfo.objects.create(app_id=self.app_obj, user_id=self.user_obj, developerid=self.developer_obj,
udid=AppUDID.objects.filter(app_id=self.app_obj,udid=self.udid_info.get('udid')).first()) udid=AppUDID.objects.filter(app_id=self.app_obj,udid=self.udid_info.get('udid')).first())
developer_obj = AppIOSDeveloperInfo.objects.filter(user_id=self.user_obj, is_actived=True,
use_number__lte=F("usable_number")).first()
developer_obj.use_number=self.developer_obj.use_number + 1
developer_obj.save()
# 生成新的ipa,然后替换release,或许,binary_file 这个字段已经无用 # 生成新的ipa,然后替换release,或许,binary_file 这个字段已经无用
# AppReleaseInfo.objects.filter(app_id=self.app_obj,is_master=True).update(release_id=random_file_name) # AppReleaseInfo.objects.filter(app_id=self.app_obj,is_master=True).update(release_id=random_file_name)
@ -211,7 +213,7 @@ class IosUtils(object):
#创建 #创建
apptodev_obj=APPToDeveloper.objects.filter(developerid=developer_obj,app_id=self.app_obj).first() apptodev_obj=APPToDeveloper.objects.filter(developerid=self.developer_obj,app_id=self.app_obj).first()
if apptodev_obj: if apptodev_obj:
storage = Storage(self.user_obj) storage = Storage(self.user_obj)
storage.delete_file(apptodev_obj.binary_file, release_obj.release_type) storage.delete_file(apptodev_obj.binary_file, release_obj.release_type)
@ -220,7 +222,7 @@ class IosUtils(object):
apptodev_obj.save() apptodev_obj.save()
else: else:
APPToDeveloper.objects.create(developerid=developer_obj,app_id=self.app_obj,binary_file=random_file_name) APPToDeveloper.objects.create(developerid=self.developer_obj,app_id=self.app_obj,binary_file=random_file_name)
@staticmethod @staticmethod
def disable_udid(udid_obj,app_id): def disable_udid(udid_obj,app_id):
@ -235,8 +237,8 @@ class IosUtils(object):
} }
# 需要判断该设备在同一个账户下 的多个应用,若存在,则不操作 # 需要判断该设备在同一个账户下 的多个应用,若存在,则不操作
udid_lists=APPSuperSignUsedInfo.objects.values_list("udid__udid").filter(developerid=developer_obj) udid_lists=list(APPSuperSignUsedInfo.objects.values_list("udid__udid").filter(developerid=developer_obj))
if len(udid_lists) == len(set(udid_lists)): if udid_lists.count((udid_obj.udid,)) == 1:
app_api_obj = AppDeveloperApi(**auth) app_api_obj = AppDeveloperApi(**auth)
app_api_obj.set_device_status("disable",udid_obj.udid) app_api_obj.set_device_status("disable",udid_obj.udid)
@ -257,10 +259,7 @@ class IosUtils(object):
APPToDeveloper.objects.filter(developerid=developer_obj,app_id_id=app_id).delete() APPToDeveloper.objects.filter(developerid=developer_obj,app_id_id=app_id).delete()
@staticmethod @staticmethod
def clean_udid_by_app_obj(app_obj): def clean_udid_by_app_obj(app_obj,developer_obj):
for SuperSignUsed_obj in APPSuperSignUsedInfo.objects.filter(app_id=app_obj):
udid_obj = SuperSignUsed_obj.udid
developer_obj=SuperSignUsed_obj.developerid
auth = { auth = {
"username": developer_obj.email, "username": developer_obj.email,
@ -268,9 +267,14 @@ class IosUtils(object):
"certid": developer_obj.certid "certid": developer_obj.certid
} }
# 需要判断该设备在同一个账户下 的多个应用,若存在,则不操作 # 需要判断该设备在同一个账户下 的多个应用,若存在,则不操作
udid_lists = APPSuperSignUsedInfo.objects.values_list("udid__udid").filter(developerid=developer_obj) udid_lists = list(APPSuperSignUsedInfo.objects.values_list("udid__udid").filter(developerid=developer_obj))
if len(udid_lists) == len(set(udid_lists)):
for SuperSignUsed_obj in APPSuperSignUsedInfo.objects.filter(app_id=app_obj, developerid=developer_obj):
udid_obj = SuperSignUsed_obj.udid
if udid_lists.count((udid_obj.udid,)) == 1:
app_api_obj = AppDeveloperApi(**auth) app_api_obj = AppDeveloperApi(**auth)
app_api_obj.set_device_status("disable", udid_obj.udid) app_api_obj.set_device_status("disable", udid_obj.udid)
@ -279,7 +283,6 @@ class IosUtils(object):
developer_obj.save() developer_obj.save()
udid_obj.delete() udid_obj.delete()
SuperSignUsed_obj.delete() SuperSignUsed_obj.delete()
@ -299,7 +302,7 @@ class IosUtils(object):
IosUtils.clean_app_by_developer_obj(app_obj,developer_obj) IosUtils.clean_app_by_developer_obj(app_obj,developer_obj)
APPToDeveloper.objects.filter(developerid=developer_obj,app_id=app_obj).delete() APPToDeveloper.objects.filter(developerid=developer_obj,app_id=app_obj).delete()
IosUtils.clean_udid_by_app_obj(app_obj) IosUtils.clean_udid_by_app_obj(app_obj,developer_obj)
@staticmethod @staticmethod
def clean_app_by_developer_obj(app_obj,developer_obj): def clean_app_by_developer_obj(app_obj,developer_obj):
auth = { auth = {
@ -319,18 +322,27 @@ class IosUtils(object):
:param developer_obj: :param developer_obj:
:return: :return:
''' '''
auth = { # auth = {
"username": developer_obj.email, # "username": developer_obj.email,
"password": developer_obj.password, # "password": developer_obj.password,
"certid": developer_obj.certid # "certid": developer_obj.certid
} # }
for SuperSignUsed_obj in APPSuperSignUsedInfo.objects.filter(developerid=developer_obj):
app_obj = SuperSignUsed_obj.app_id for APPToDeveloper_obj in APPToDeveloper.objects.filter(developerid=developer_obj):
app_api_obj = AppDeveloperApi(**auth) app_obj=APPToDeveloper_obj.app_id
app_api_obj.del_profile(app_obj.bundle_id, app_obj.app_id) IosUtils.clean_app_by_developer_obj(app_obj, developer_obj)
app_api_obj2 = AppDeveloperApi(**auth)
app_api_obj2.del_app(app_obj.bundle_id,app_obj.app_id)
APPToDeveloper.objects.filter(developerid=developer_obj, app_id=app_obj).delete() APPToDeveloper.objects.filter(developerid=developer_obj, app_id=app_obj).delete()
IosUtils.clean_udid_by_app_obj(app_obj, developer_obj)
# for SuperSignUsed_obj in APPSuperSignUsedInfo.objects.filter(developerid=developer_obj):
#
# app_obj = SuperSignUsed_obj.app_id
# app_api_obj = AppDeveloperApi(**auth)
# app_api_obj.del_profile(app_obj.bundle_id, app_obj.app_id)
# app_api_obj2 = AppDeveloperApi(**auth)
# app_api_obj2.del_app(app_obj.bundle_id,app_obj.app_id)
# APPToDeveloper.objects.filter(developerid=developer_obj, app_id=app_obj).delete()
@staticmethod @staticmethod
def active_developer(developer_obj,code=None): def active_developer(developer_obj,code=None):

@ -118,6 +118,9 @@ class AppInfoView(APIView):
if app_id: if app_id:
apps_obj = Apps.objects.filter(user_id=request.user, app_id=app_id).first() apps_obj = Apps.objects.filter(user_id=request.user, app_id=app_id).first()
if apps_obj: if apps_obj:
if apps_obj.issupersign:
IosUtils.clean_app_by_user_obj(apps_obj, request.user)
storage = Storage(request.user) storage = Storage(request.user)
has_combo = apps_obj.has_combo has_combo = apps_obj.has_combo
if has_combo: if has_combo:

@ -29,19 +29,20 @@ class DeveloperView(APIView):
res = BaseResponse() res = BaseResponse()
appid = request.query_params.get("appid", None)
developer_obj = AppIOSDeveloperInfo.objects.filter(user_id=request.user) developer_obj = AppIOSDeveloperInfo.objects.filter(user_id=request.user)
if appid:
developer_obj=developer_obj.filter(email=appid)
page_obj = AppsPageNumber() page_obj = AppsPageNumber()
app_page_serializer = page_obj.paginate_queryset(queryset=developer_obj.order_by("-updated_time"), request=request, app_page_serializer = page_obj.paginate_queryset(queryset=developer_obj.order_by("-updated_time"), request=request,
view=self) view=self)
Developer_serializer = DeveloperSerializer(app_page_serializer, many=True,) Developer_serializer = DeveloperSerializer(app_page_serializer, many=True,)
userserializer = UserInfoSerializer(request.user) userserializer = UserInfoSerializer(request.user)
res.userinfo = {} res.userinfo = {}
res.has_next = {}
res.userinfo = userserializer.data res.userinfo = userserializer.data
res.data = Developer_serializer.data res.data = Developer_serializer.data
res.has_next = page_obj.page.has_next() res.count=developer_obj.count()
return Response(res.dict) return Response(res.dict)
def put(self,request): def put(self,request):
@ -49,9 +50,6 @@ class DeveloperView(APIView):
email=data.get("email",None) email=data.get("email",None)
if email: if email:
developer_obj = AppIOSDeveloperInfo.objects.filter(user_id=request.user,email=email).first() developer_obj = AppIOSDeveloperInfo.objects.filter(user_id=request.user,email=email).first()
if developer_obj: if developer_obj:
act = data.get("act", None) act = data.get("act", None)
if act: if act:
@ -101,19 +99,41 @@ class DeveloperView(APIView):
return self.get(request) return self.get(request)
def delete(self,request):
email=request.query_params.get("email",None)
if email:
developer_obj = AppIOSDeveloperInfo.objects.filter(user_id=request.user,email=email).first()
if developer_obj:
IosUtils.clean_developer(developer_obj)
developer_obj.delete()
return self.get(request)
class SuperSignUsedView(APIView): class SuperSignUsedView(APIView):
authentication_classes = [ExpiringTokenAuthentication, ] authentication_classes = [ExpiringTokenAuthentication, ]
def get(self, request): def get(self, request):
res = BaseResponse() res = BaseResponse()
developer_obj = APPSuperSignUsedInfo.objects.filter(user_id=request.user)
udid = request.query_params.get("udid", None)
bundleid = request.query_params.get("bundleid", None)
developerid = request.query_params.get("appid", None)
SuperSignUsed_obj = APPSuperSignUsedInfo.objects.filter(user_id=request.user,)
if developerid:
SuperSignUsed_obj=SuperSignUsed_obj.filter(developerid__email=developerid)
if udid:
SuperSignUsed_obj = SuperSignUsed_obj.filter(udid__udid=udid)
if bundleid:
SuperSignUsed_obj = SuperSignUsed_obj.filter(app_id__bundle_id=bundleid)
page_obj = AppsPageNumber() page_obj = AppsPageNumber()
app_page_serializer = page_obj.paginate_queryset(queryset=developer_obj.order_by("-created_time"), request=request, app_page_serializer = page_obj.paginate_queryset(queryset=SuperSignUsed_obj.order_by("-created_time"), request=request,
view=self) view=self)
app_serializer = SuperSignUsedSerializer(app_page_serializer, many=True, ) app_serializer = SuperSignUsedSerializer(app_page_serializer, many=True, )
res.data = app_serializer.data res.data = app_serializer.data
res.has_next = page_obj.page.has_next() res.count=SuperSignUsed_obj.count()
return Response(res.dict) return Response(res.dict)
class AppUDIDUsedView(APIView): class AppUDIDUsedView(APIView):
@ -124,27 +144,25 @@ class AppUDIDUsedView(APIView):
udid = request.query_params.get("udid", None) udid = request.query_params.get("udid", None)
bundleid = request.query_params.get("bundleid", None) bundleid = request.query_params.get("bundleid", None)
if udid and bundleid: AppUDID_obj = AppUDID.objects.filter(app_id__user_id_id=request.user)
developer_obj = AppUDID.objects.filter(app_id__user_id_id=request.user,app_id__bundle_id=bundleid,udid=udid) if udid:
elif udid: AppUDID_obj = AppUDID_obj.filter(udid=udid)
developer_obj = AppUDID.objects.filter(app_id__user_id_id=request.user,udid=udid) if bundleid:
elif bundleid: AppUDID_obj = AppUDID_obj.filter(app_id__bundle_id=bundleid)
developer_obj = AppUDID.objects.filter(app_id__user_id_id=request.user,app_id__bundle_id=bundleid)
else:
developer_obj = AppUDID.objects.filter(app_id__user_id_id=request.user)
page_obj = AppsPageNumber() page_obj = AppsPageNumber()
app_page_serializer = page_obj.paginate_queryset(queryset=developer_obj.order_by("-created_time"), request=request, app_page_serializer = page_obj.paginate_queryset(queryset=AppUDID_obj.order_by("-created_time"), request=request,
view=self) view=self)
app_serializer = DeviceUDIDSerializer(app_page_serializer, many=True,) app_serializer = DeviceUDIDSerializer(app_page_serializer, many=True,)
res.data = app_serializer.data res.data = app_serializer.data
res.has_next = page_obj.page.has_next() res.count=AppUDID_obj.count()
return Response(res.dict) return Response(res.dict)
def delete(self,request): def delete(self,request):
res = BaseResponse()
id = request.query_params.get("id", None) id = request.query_params.get("id", None)
app_id = request.query_params.get("aid", None) app_id = request.query_params.get("aid", None)
app_udid_obj=AppUDID.objects.filter(app_id__user_id_id=request.user,pk=id) app_udid_obj=AppUDID.objects.filter(app_id__user_id_id=request.user,pk=id)
IosUtils.disable_udid(app_udid_obj.first(),app_id) IosUtils.disable_udid(app_udid_obj.first(),app_id)
app_udid_obj.delete() app_udid_obj.delete()
return self.get(request) return Response(res.dict)

@ -0,0 +1,45 @@
import requests
import random
short=["bgql","wjbu","vnfg","bgql"]
udid_lists=[
"f55df38afe5c1242b8bc478d0182bbd0d7d08929",
"f55df38afe5c1242b8bc478d0182bbd0d7d08929",
"f55df38afe5c1242b8bc478d0182bbd0d7d08922",
"f55df38afe5c1242b8bc478d0182bbd0d7d01129",
"f55df38afe5c1242b8bc478d0182bbd0d723929",
"f55df38afe5c1242b8bc478d0182bbd0d7d118929",
"f55df38afe5c1242b8bc478d0182bbd0d7d08929",
"f55df38afe5c1242b8bc478d0182bbd0daed08929",
"f55df38afe5c1242b8bc478d0182bbd0d7d08929",
"f55df38afe5c1242b8bc478d0182bbdfsdfe7d08929",
"f55df38afe5c1242b8bc478d0182bbdfsdfe7d08929",
"f55df38afe5c1242b8bc478d0182bbdfsdfe7d08929",
"f55df38afe5c1242b8bc478d0182dsfsdd7d08929",
"f55df38afe5c1242b8bc478d0182dsfsdd7d08929",
"f55df38afe5c1242b8bc478d0182dsfsdd7d08929",
"f55df38afe5c1242b8bc478d0182bbdsdfsadf8929",
"f55df38afe5c1242b8bc478d01sdsdfsdd0d7d08929",
"f55df38afe5c1242b8bc478sdfsdffsdafd7d08929",
"f55df38afe5c1242b8bc478sdfsdffsdafd7d08929",
"f55df38afe5c1242b8bc478sdfsdffsdafd7d08929",
"f55df38afe5c1242b8bc478d0182bbd0d7d08929",
"f55df38afe5c1242b8bc478dsdfeasdfbbd0d7d08929",
"f55df38afe5c1242b8bc478dfsdfseasbd0d7d08929",
"f55df38afe5c1242b8bc478d0sdfseafsdbbd0d7d08929",
"f55df38afe5c1242b8asdfae8ds2bbd0d7d118929",
"f55df38afe5c1242b8bc47sfsdf2bbd0d7dd18929",
"f55df38afe5c1242b8bc478d0182bbd0d7d0ae8929",
"f55df38afe5c1242b8bc478d0182bbd0d7dsfe08929",
]
for udid in udid_lists:
data='<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n<dict>\n\t<key>PRODUCT</key>\n\t<string>iPhone9,1</string>\n\t<key>SERIAL</key>\n\t<string>F71YD58GHG74</string>\n\t<key>UDID</key>\n\t<string>%s</string>\n\t<key>VERSION</key>\n\t<string>17E262</string>\n</dict>\n</plist>\n' %(udid)
uri = "https://fly.harmonygames.cn/udid/%s" % (random.choice(short))
# uri = "https://fly.harmonygames.cn/udid/%s" % ("bgql")
req=requests.post(uri,data=data )
print(req.status_code)
Loading…
Cancel
Save