mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-05-08 21:12:26 +00:00
Add ads placeholders
This commit is contained in:
@@ -51,6 +51,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.emanuelef.remote_capture.activities.MainActivity;
|
||||
import com.emanuelef.remote_capture.model.AppDescriptor;
|
||||
import com.emanuelef.remote_capture.model.ConnectionDescriptor;
|
||||
import com.emanuelef.remote_capture.model.Prefs;
|
||||
import com.emanuelef.remote_capture.model.VPNStats;
|
||||
@@ -582,6 +583,15 @@ public class CaptureService extends VpnService implements Runnable {
|
||||
|
||||
public int getAppFilterUid() { return(app_filter_uid); }
|
||||
|
||||
public int getOwnAppUid() {
|
||||
AppDescriptor app = AppsResolver.resolve(getPackageManager(), BuildConfig.APPLICATION_ID);
|
||||
|
||||
if(app != null)
|
||||
return app.getUid();
|
||||
|
||||
return Utils.UID_NO_FILTER;
|
||||
}
|
||||
|
||||
// returns 1 if dumpPcapData should be called
|
||||
public int dumpPcapToJava() {
|
||||
return(((dump_mode == Prefs.DumpMode.HTTP_SERVER) || (dump_mode == Prefs.DumpMode.PCAP_FILE)) ? 1 : 0);
|
||||
|
||||
@@ -105,6 +105,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
setTheme(R.style.AppTheme_NoActionBar);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.main_activity);
|
||||
|
||||
initAppState();
|
||||
checkPermissions();
|
||||
@@ -116,8 +117,6 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
.errorDrawable(R.drawable.ic_app_crash)
|
||||
.apply();
|
||||
|
||||
setContentView(R.layout.main_activity);
|
||||
|
||||
mTabLayout = findViewById(R.id.tablayout);
|
||||
mPager = findViewById(R.id.pager);
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ char* getStringPref(vpnproxy_data_t *proxy, const char *key, char *buf, int bufs
|
||||
|
||||
/* ******************************************************* */
|
||||
|
||||
static u_int32_t getIPv4Pref(JNIEnv *env, jobject vpn_inst, const char *key) {
|
||||
u_int32_t getIPv4Pref(JNIEnv *env, jobject vpn_inst, const char *key) {
|
||||
struct in_addr addr = {0};
|
||||
|
||||
jmethodID midMethod = jniGetMethodID(env, cls.vpn_service, key, "()Ljava/lang/String;");
|
||||
@@ -171,7 +171,7 @@ static u_int32_t getIPv4Pref(JNIEnv *env, jobject vpn_inst, const char *key) {
|
||||
|
||||
/* ******************************************************* */
|
||||
|
||||
static struct in6_addr getIPv6Pref(JNIEnv *env, jobject vpn_inst, const char *key) {
|
||||
struct in6_addr getIPv6Pref(JNIEnv *env, jobject vpn_inst, const char *key) {
|
||||
struct in6_addr addr = {0};
|
||||
|
||||
jmethodID midMethod = jniGetMethodID(env, cls.vpn_service, key, "()Ljava/lang/String;");
|
||||
@@ -194,7 +194,7 @@ static struct in6_addr getIPv6Pref(JNIEnv *env, jobject vpn_inst, const char *ke
|
||||
|
||||
/* ******************************************************* */
|
||||
|
||||
static jint getIntPref(JNIEnv *env, jobject vpn_inst, const char *key) {
|
||||
int getIntPref(JNIEnv *env, jobject vpn_inst, const char *key) {
|
||||
jint value;
|
||||
jmethodID midMethod = jniGetMethodID(env, cls.vpn_service, key, "()I");
|
||||
|
||||
|
||||
@@ -194,7 +194,11 @@ int resolve_uid(vpnproxy_data_t *proxy, const zdtun_5tuple_t *conn_info);
|
||||
void refresh_time(vpnproxy_data_t *proxy);
|
||||
void init_protocols_bitmask(ndpi_protocol_bitmask_struct_t *b);
|
||||
void vpn_protect_socket(vpnproxy_data_t *proxy, socket_t sock);
|
||||
|
||||
char* getStringPref(vpnproxy_data_t *proxy, const char *key, char *buf, int bufsize);
|
||||
int getIntPref(JNIEnv *env, jobject vpn_inst, const char *key);
|
||||
uint32_t getIPv4Pref(JNIEnv *env, jobject vpn_inst, const char *key);
|
||||
struct in6_addr getIPv6Pref(JNIEnv *env, jobject vpn_inst, const char *key);
|
||||
|
||||
int run_proxy(vpnproxy_data_t *proxy);
|
||||
int run_root(vpnproxy_data_t *proxy);
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
android:scrollbarStyle="outsideOverlay"
|
||||
android:id="@+id/apps_stats_view" />
|
||||
android:id="@+id/apps_stats_view"
|
||||
android:fillViewport="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/no_apps"
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
android:scrollbarStyle="outsideOverlay" />
|
||||
android:scrollbarStyle="outsideOverlay"
|
||||
android:fillViewport="true" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
android:background="?attr/colorPrimary"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/AppBarOverlay"
|
||||
app:popupTheme="@style/PopupOverlay"/>
|
||||
app:popupTheme="@style/PopupOverlay" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
@@ -43,7 +43,12 @@
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/adContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -1,9 +1,16 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/settings"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/adContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
@@ -74,7 +74,7 @@
|
||||
<string name="cannot_write_file">Impossibile scrivere il file</string>
|
||||
<string name="share">Condividi</string>
|
||||
<string name="delete">Elimina</string>
|
||||
<string name="ok">Ok</string>
|
||||
<string name="ok">OK</string>
|
||||
<string name="pcap_file_action">Traffico salvato nel file %1$s (%2$s).</string>
|
||||
<string name="delete_error">Impossibile eliminare il file</string>
|
||||
<string name="capture_running">Cattura in esecuzione</string>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<string name="cannot_write_file">Cannot write file</string>
|
||||
<string name="share">Share</string>
|
||||
<string name="delete">Delete</string>
|
||||
<string name="ok">Ok</string>
|
||||
<string name="ok">OK</string>
|
||||
<string name="pcap_file_action">Traffic saved to file %1$s (%2$s).</string>
|
||||
<string name="delete_error">Could not delete file</string>
|
||||
<string name="capture_running">Capture running</string>
|
||||
|
||||
Reference in New Issue
Block a user