Skip to content

Commit cf99fd3

Browse files
authored
Merge pull request #56 from flagship-io/xpcBucketing
manage lookup visitor
2 parents c1c38e3 + 721da60 commit cf99fd3

File tree

20 files changed

+254
-150
lines changed

20 files changed

+254
-150
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6+

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>12.0</string>
24+
<string>13.0</string>
2525
</dict>
2626
</plist>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
import lldb
6+
7+
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
8+
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
9+
base = frame.register["x0"].GetValueAsAddress()
10+
page_len = frame.register["x1"].GetValueAsUnsigned()
11+
12+
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
13+
# first page to see if handled it correctly. This makes diagnosing
14+
# misconfiguration (e.g. missing breakpoint) easier.
15+
data = bytearray(page_len)
16+
data[0:8] = b'IHELPED!'
17+
18+
error = lldb.SBError()
19+
frame.GetThread().GetProcess().WriteMemory(base, data, error)
20+
if not error.Success():
21+
print(f'Failed to write into {base}[+{page_len}]', error)
22+
return
23+
24+
def __lldb_init_module(debugger: lldb.SBDebugger, _):
25+
target = debugger.GetDummyTarget()
26+
# Caveat: must use BreakpointCreateByRegEx here and not
27+
# BreakpointCreateByName. For some reasons callback function does not
28+
# get carried over from dummy target for the later.
29+
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
30+
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
31+
bp.SetAutoContinue(True)
32+
print("-- LLDB integration loaded --")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
command script import --relative-to-command-file flutter_lldb_helper.py

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
platform :ios, '12.0'
2+
platform :ios, '13.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ EXTERNAL SOURCES:
3333

3434
SPEC CHECKSUMS:
3535
device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
36-
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
36+
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
3737
path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
3838
shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
3939
sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
4040

41-
PODFILE CHECKSUM: ce13d36744da294d67f8e460dbb7aed7c09bd7f4
41+
PODFILE CHECKSUM: 30517025a2fecca2d72dac25f08abb5b9a8f1a56
4242

4343
COCOAPODS: 1.16.2

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@
342342
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
343343
GCC_WARN_UNUSED_FUNCTION = YES;
344344
GCC_WARN_UNUSED_VARIABLE = YES;
345-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
345+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
346346
MTL_ENABLE_DEBUG_INFO = NO;
347347
SDKROOT = iphoneos;
348348
SUPPORTED_PLATFORMS = iphoneos;
@@ -423,7 +423,7 @@
423423
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
424424
GCC_WARN_UNUSED_FUNCTION = YES;
425425
GCC_WARN_UNUSED_VARIABLE = YES;
426-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
426+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
427427
MTL_ENABLE_DEBUG_INFO = YES;
428428
ONLY_ACTIVE_ARCH = YES;
429429
SDKROOT = iphoneos;
@@ -472,7 +472,7 @@
472472
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
473473
GCC_WARN_UNUSED_FUNCTION = YES;
474474
GCC_WARN_UNUSED_VARIABLE = YES;
475-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
475+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
476476
MTL_ENABLE_DEBUG_INFO = NO;
477477
SDKROOT = iphoneos;
478478
SUPPORTED_PLATFORMS = iphoneos;

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
</Testables>
@@ -45,11 +46,13 @@
4546
buildConfiguration = "Debug"
4647
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4748
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
49+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4850
launchStyle = "0"
4951
useCustomWorkingDirectory = "NO"
5052
ignoresPersistentStateOnLaunch = "NO"
5153
debugDocumentVersioning = "YES"
5254
debugServiceExtension = "internal"
55+
enableGPUValidationMode = "1"
5356
allowLocationSimulation = "YES">
5457
<BuildableProductRunnable
5558
runnableDebuggingMode = "0">

example/lib/Providers/fs_data.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'dart:math';
2-
31
import 'package:flagship/tracking/tracking_manager_config.dart';
42
import 'package:flagship/utils/constants.dart';
53
import 'package:flutter/material.dart';
@@ -65,7 +63,7 @@ class FSData extends ChangeNotifier {
6563
}
6664

6765
class UserData extends ChangeNotifier {
68-
String _visitorId = "flutter_user" + Random().nextInt(10000).toString();
66+
String _visitorId = "anonymousId"; //+ Random().nextInt(10000).toString();
6967

7068
Map<String, Object> context = {
7169
"testing_tracking_manager": true,

example/lib/widgets/configuration.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class _ConfigurationState extends State<Configuration> with ShowDialog {
196196
apiKeyController.text = fsData.apiKey;
197197
timeoutController.text = fsData.timeout.toString();
198198
visitorIdController.text = fsUser.visitorId;
199-
bool isApiMode = (fsData.sdkMode == Mode.DECISION_API) ? true : false;
199+
bool isApiMode = (fsData.sdkMode == Mode.BUCKETING) ? true : false;
200200
pollingTimeController.text = defaultPollingTime.toString();
201201

202202
final mediaQuery = MediaQuery.of(context);

0 commit comments

Comments
 (0)