Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't log in using a mobile session #13

Open
Doutuq opened this issue Jul 19, 2024 · 15 comments
Open

I can't log in using a mobile session #13

Doutuq opened this issue Jul 19, 2024 · 15 comments

Comments

@Doutuq
Copy link

Doutuq commented Jul 19, 2024

Hello and thanks for your work!

In your code I added my variables: user id, dc id, auth key.
I received the file: tgnet.dat and then moved it to the Android emulator in the folder /data/data/org.telegram.messenger

But I didn’t get the authorization in telegram, tell me where the problem could be?

@batreller
Copy link
Owner

You need to replace all original files in that directory with all files that AndroidTelePorter created for you, not just tgnet

Just delete all folders from /data/data/org.telegram.web and copy new session files made with AndroidTelePorter to this folder

@Doutuq
Copy link
Author

Doutuq commented Jul 19, 2024

I tested the file placement options:

Added to /data/data/org.telegram.messenger

option 1: I immediately added the “tgnet” folder (in “tgnet” I have 2 folders “files” (here is the “tgnet” file) and “shared_prefs (here is the “userconfing” file”)

option 2: added only the "tgnet" and "userconfing" files

option 3: added two folders "files" and "shared_prefs" with files inside, respectively

Please tell me, did I get everything I needed from AndroidTelePorter?
Perhaps there are some other details?

Thanks for the answer.

@batreller
Copy link
Owner

batreller commented Jul 19, 2024

Option 3 is the one you need, have you tried it? Does it not work?

Did you close Telegram before replacing files?

@Doutuq
Copy link
Author

Doutuq commented Jul 22, 2024

image

Yes of course, I did everything right!
Perhaps I should look towards converting TDATA into a mobile session? but I also entered all the variables correctly there.

I tested this on an Android emulator and on a physical device, no result.

@batreller
Copy link
Owner

In that case I would suggest you making sure that session you are trying to use is valid

@notraiday
Copy link

notraiday commented Oct 27, 2024

Just delete all folders from /data/data/org.telegram.web and copy new session files made with AndroidTelePorter to this folder

Is there any way to ADD session? / Create multiple-session config with AndroidTelePorter

@batreller
Copy link
Owner

Do you mean a few sessions? Like when you open Telegram and there are a few sessions? Yes you can just look at how Telegram stores them and do the same thing, but there is no built-in function that will do that for you

If you read main.py in this repository there will be documentation on how sessions are stored in Telegram. You can just locate sessions this way and it should work, I might think about adding this feature in future though

@notraiday
Copy link

notraiday commented Oct 27, 2024

might think about adding this feature in future though

I think it is more complicated. You can store multiple accounts in telegram desktop as well but nobody had written software to create "tdata" with multiple accounts afaik, It's sad

@batreller
Copy link
Owner

As you can see in main.py
There are 4 locations of tgnet.dat file:
/data/data/org.telegram.messenger.web/files/tgnet.dat
/data/data/org.telegram.messenger.web/files/account1/tgnet.dat
/data/data/org.telegram.messenger.web/files/account2/tgnet.dat
/data/data/org.telegram.messenger.web/files/account3/tgnet.dat

and 4 locations of userconfing.xml file:
/data/data/org.telegram.messenger.web/shared_prefs/userconfing.xml
/data/data/org.telegram.messenger.web/shared_prefs/userconfig1.xml
/data/data/org.telegram.messenger.web/shared_prefs/userconfig2.xml
/data/data/org.telegram.messenger.web/shared_prefs/userconfig3.xml

These are locations you will have if you have 3 accounts.

/data/data/org.telegram.messenger.web/files/tgnet.dat and /data/data/org.telegram.messenger.web/shared_prefs/userconfing.xml are files of session that will be started when you open Telegram app, all other sessions (account1, account2, account3) are used when you switch to another session and they probable replace org.telegram.messenger.web/files/tgnet.dat and /data/data/org.telegram.messenger.web/shared_prefs/userconfing.xml the moment you switch between sessions, but I have not manually tried this but I am almost sure there is nothing else needed apart from these files

About tdata - you can create many sessions with opentele and that's exactly how AndroidTelePorter converts mobile session to tdata

@jolieprince
Copy link

do i need to create API_ID and API_Hash if I need to use .session file with telethon?

@batreller
Copy link
Owner

batreller commented Nov 8, 2024

You can just use official ones

Or you can create yours
But it will be suspicious for telegram that you changed your api_id and api_hash without changing actual session

@jolieprince
Copy link

Can you provide me official id and hash. Or where can I find them? I tried but couldn't find anywhere.

1 similar comment
@jolieprince
Copy link

Can you provide me official id and hash. Or where can I find them? I tried but couldn't find anywhere.

@jolieprince
Copy link

Can you tell me please how to find official api_id and api_hash?

@batreller
Copy link
Owner

Yes of course, you can find all of them in issue #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants