Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bbl_screen-patch/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ base.ts: printer_ui.so kexec_ui.so
device_gate_shim.so: workaround_ifaddrs.c link_is_up.cpp mqtt_reroute.cpp
$(TARGET_CXX) -o $@ workaround_ifaddrs.c link_is_up.cpp mqtt_reroute.cpp $(CXXFLAGS) $(LDFLAGS)

forward_shim.so: forward_shim.c
$(TARGET_CXX) -o $@ forward_shim.c $(CXXFLAGS) $(LDFLAGS) ../prebuilt/libdbus-1.so
forward_shim.so: forward_shim.cpp
$(TARGET_CXX) -o $@ forward_shim.cpp $(CXXFLAGS) $(LDFLAGS) ../prebuilt/libdbus-1.so

kexec_ui.so: kexec_ui.ui.o interpose.cpp interpose.moc.h
$(TARGET_CC) -o $@ $< interpose.cpp workaround_ifaddrs.c $(CXXFLAGS) $(LDFLAGS) -I $(QT5_INCL_PATH)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#include <stdarg.h>
#include <pthread.h>

#include <vector>
#include <string>

#ifdef __cplusplus
#define EXTERN_C extern "C"
#else
Expand Down Expand Up @@ -133,3 +136,13 @@ SWIZZLE(ssize_t, write, int fd, const void *buf, size_t count)
}
return next(fd, buf, count);
}

extern std::vector<std::string> eth_list;

extern "C" void __attribute__ ((constructor)) init() {
unsetenv("LD_PRELOAD");
for (auto s : eth_list ) {
printf("forward_shim: adding to network list, started with %s\n", s.c_str());
}
eth_list.push_back("eth0");
}
3 changes: 1 addition & 2 deletions images/cfw/etc/init.d/S92forward_service
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
start() {
printf "Starting forward service: "
/bin/touch /tmp/bbl_crypto
export LD_PRELOAD=/opt/x1plus/lib/forward_shim.so
start-stop-daemon -S -m -b -p /var/run/forward_service.pid \
--exec /usr/bin/forward \
--exec sh -- -c 'LD_PRELOAD=/opt/x1plus/lib/forward_shim.so exec /usr/bin/forward' \
[ $? = 0 ] && echo "OK" || echo "FAIL"
}
stop() {
Expand Down