Telegram-iOS icon indicating copy to clipboard operation
Telegram-iOS copied to clipboard

What is APP_CONFIG_DATA ?

Open shivanraptor opened this issue 7 years ago • 14 comments

In version Telegram 5.5, I saw from BuildConfig.m in Telegram-iOS that it reads a constant called APP_CONFIG_DATA in line 277. It is added at commit f5880c1a3c63a77179f1c4790716da0bc7e3a6c0.

What should be the value of it? Thanks.

shivanraptor avatar Mar 26 '19 06:03 shivanraptor

What is format ?

Rdxer avatar Mar 26 '19 06:03 Rdxer

from BuildConfig.m, it seems it's a meaningful HEX string. See line 277:

https://github.com/peter-iakovlev/Telegram-iOS/blob/master/Telegram-iOS/BuildConfig.m

I added the APP_CONFIG_DATA with empty string value to the config file, under GLOBAL_CONSTANT field. The App can be compiled but caught dead with the assert() at line 291.

shivanraptor avatar Mar 26 '19 07:03 shivanraptor

Do u find the solution? @shivanraptor

visoon avatar Mar 29 '19 05:03 visoon

Not yet. Totally no clue on how to solve it. Compared with previous commits, it is related to API Level 23, and it should not and could not be skipped.

shivanraptor avatar Mar 29 '19 07:03 shivanraptor

Further investigation: If I comment out the related lines (line 277 - 332) in BuildConfig.m regarding the APP_CONFIG_DATA, the app can be loaded without problems (well, kind of), except for no new message can be received or sent. The status says "Updating..." forever. It's believed that the APP_CONFIG_DATA plays an important role in the latest API / App version 5.5.

p.s. if the repo author saw this issue, he probably thinks I'm so dumb to keep trying things to bypass the value.

Updating forever

shivanraptor avatar Apr 01 '19 06:04 shivanraptor

Hi Shiva, have you tried to add the APP_CONFIG_DATA in the global constants? Set up It to = 0.

spectreDeveloper avatar Apr 01 '19 06:04 spectreDeveloper

I think APP_CONFIG_DATA is bytes contain your app_id and api_hash, maybe "hockeyAppId" also, so you can set these variables directly.

ghost avatar Apr 01 '19 08:04 ghost

How can I combine app_id, api_hash and hockeyAppId into a HEX string? I have already set the APP_CONFIG_API_ID and APP_CONFIG_API_HASH obtained from Telegram Core portal into Config-Fork.xcconfig.

shivanraptor avatar Apr 01 '19 08:04 shivanraptor

you don't have to make a HEX string, just delete those codes, then add _app_id = xxxx;
_api_hash = @"xxxxx"; _hockeyAppid = nil;

ghost avatar Apr 01 '19 08:04 ghost

Can you specify which lines to comment out / delete? And is there any side effects doing so? Thanks for your help.

shivanraptor avatar Apr 01 '19 09:04 shivanraptor

line 275 to 331 No side effects

ghost avatar Apr 01 '19 09:04 ghost

Thanks. The exact codes are:

_apiId = 123456;
_apiHash = @"aaaabbbbccccddddeeeeffffededeeee";
_hockeyAppId = nil;

shivanraptor avatar Apr 01 '19 09:04 shivanraptor

Shiva, Can you Say me What version of xcode you use and what simulator? Thanks

spectreDeveloper avatar Apr 01 '19 12:04 spectreDeveloper

I'm using Xcode 10.2 (10E125). I didn't use Simulator; use my iPhone XR instead.

shivanraptor avatar Apr 03 '19 03:04 shivanraptor