Commit 57f303d
Updated Analytics Windows to allow multiple DLL hashes, and add usage of Options struct. (#1744)
* Update script and code to handle known hashes for multiple DLLs.
* Fixed issues on Windows with multi-dll-hash code.
* Fix: Link Crypt32.lib for firebase_analytics on Windows
Add Crypt32.lib to the linked libraries for the firebase_analytics
target on Windows. This resolves a linker error LNK2019 for
_CryptBinaryToStringA@20, which was occurring in builds that
included analytics_windows.obj (e.g., firebase_analytics_test).
While CryptBinaryToStringA is not directly called in
analytics_windows.cc, the linker indicates that analytics_windows.obj
requires this symbol, possibly due to an indirect dependency or
other build system interactions. Linking Crypt32.lib provides the
necessary symbol.
* Fix: Link Crypt32.lib for firebase_analytics_test on Windows
I've added Crypt32.lib to the dependencies of the firebase_analytics_test
target in `analytics/tests/CMakeLists.txt` when building on Windows.
This is to resolve a persistent LNK2019 error for
_CryptBinaryToStringA@20, which occurs during the linking phase of
firebase_analytics_test.obj. This change directly links the
required system library at the test executable level.
* Update DLL.
* Remove unused file.
* Remove extra file.
* Initialize Analytics C SDK with AppOptions on desktop
This change updates the desktop analytics initialization to use the
newly required Options struct for the Windows C API.
- In `analytics/src/analytics_desktop.cc`:
- `firebase::analytics::Initialize(const App& app)` now retrieves
`app_id` and `package_name` from `app.options()`.
- It calls `GoogleAnalytics_Options_Create()` to create the options struct.
- Populates `app_id`, `package_name`, and sets a default for
`analytics_collection_enabled_at_first_launch`.
- Calls `GoogleAnalytics_Initialize()` with the populated options struct.
- String lifetimes for `app_id` and `package_name` are handled by
creating local `std::string` copies before passing their `c_str()`
to the C API.
* Update stub generation.
* Format code.
* Fix build issues.
* Update Analytics to use new options struct. (#1745)
* Initialize Analytics C SDK with AppOptions on desktop
This change updates the desktop analytics initialization to use the
newly required Options struct for the Windows C API.
- In `analytics/src/analytics_desktop.cc`:
- `firebase::analytics::Initialize(const App& app)` now retrieves
`app_id` and `package_name` from `app.options()`.
- It calls `GoogleAnalytics_Options_Create()` to create the options struct.
- Populates `app_id`, `package_name`, and sets a default for
`analytics_collection_enabled_at_first_launch`.
- Calls `GoogleAnalytics_Initialize()` with the populated options struct.
- String lifetimes for `app_id` and `package_name` are handled by
creating local `std::string` copies before passing their `c_str()`
to the C API.
* Format code.
* Fix build issues.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
* Format code.
* Only display Analytics warnings if we are not in stub mode.
* Format code.
* Address review comments and add missing copyright notices.
* Remove extraneous commented out code.
* Add another known hash to the list.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 56de502 commit 57f303d
File tree
16 files changed
+534
-528
lines changed- analytics
- src
- windows
- tests
- windows
- include/public
- c
16 files changed
+534
-528
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
107 | 110 | | |
108 | 111 | | |
109 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
65 | 86 | | |
66 | 87 | | |
67 | 88 | | |
| |||
77 | 98 | | |
78 | 99 | | |
79 | 100 | | |
80 | | - | |
| 101 | + | |
81 | 102 | | |
82 | 103 | | |
83 | 104 | | |
| |||
104 | 125 | | |
105 | 126 | | |
106 | 127 | | |
107 | | - | |
| 128 | + | |
108 | 129 | | |
109 | 130 | | |
110 | 131 | | |
| |||
136 | 157 | | |
137 | 158 | | |
138 | 159 | | |
| 160 | + | |
139 | 161 | | |
140 | 162 | | |
141 | 163 | | |
| |||
157 | 179 | | |
158 | 180 | | |
159 | 181 | | |
160 | | - | |
161 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
162 | 186 | | |
163 | 187 | | |
164 | 188 | | |
| |||
178 | 202 | | |
179 | 203 | | |
180 | 204 | | |
181 | | - | |
| 205 | + | |
| 206 | + | |
182 | 207 | | |
183 | 208 | | |
184 | 209 | | |
185 | 210 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
190 | 222 | | |
191 | 223 | | |
192 | 224 | | |
| |||
231 | 263 | | |
232 | 264 | | |
233 | 265 | | |
234 | | - | |
235 | 266 | | |
236 | 267 | | |
237 | 268 | | |
238 | 269 | | |
239 | 270 | | |
240 | | - | |
241 | 271 | | |
242 | 272 | | |
243 | 273 | | |
244 | 274 | | |
245 | 275 | | |
246 | | - | |
247 | 276 | | |
248 | 277 | | |
249 | 278 | | |
250 | 279 | | |
251 | 280 | | |
252 | | - | |
253 | 281 | | |
254 | 282 | | |
255 | 283 | | |
| |||
0 commit comments