feat(mobile): connect Android and IDE to browser account login
This commit is contained in:
1 parent
b66daed07a
commit
c1929957a2
8 files changed
+109
-8
No files matched your search
+10
@@ -26,6 +26,16 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
public class MobileSecretsPlugin extends Plugin {
|
||||
private static final String ALIAS = "aiturk.mobile.account.v1";
|
||||
private final AtomicInteger requests = new AtomicInteger();
|
||||
@PluginMethod public void openLogin(PluginCall call) {
|
||||
String url = call.getString("url", "");
|
||||
if (!url.matches("https://turkservis\\.online/account/aiturk/mobile-login/[0-9a-f-]{36}")) {
|
||||
call.reject("Geçersiz giriş adresi."); return;
|
||||
}
|
||||
try {
|
||||
getActivity().startActivity(new android.content.Intent(android.content.Intent.ACTION_VIEW, android.net.Uri.parse(url)));
|
||||
call.resolve();
|
||||
} catch (Exception error) { call.reject("Tarayıcı açılamadı."); }
|
||||
}
|
||||
@PluginMethod public void request(PluginCall call) {
|
||||
String path = call.getString("path", "");
|
||||
String method = call.getString("method", "GET");
|
||||
|
||||
Reference in new issue
Block a user