This commit is contained in:
Your Name
2024-03-03 23:05:09 -06:00
parent 90b66d646b
commit bbfe32da05
3131 changed files with 113292 additions and 3 deletions

View File

@@ -0,0 +1,13 @@
/**
* Automatically generated file. DO NOT MODIFY
*/
package hanson.xyz.vpnhotspotmod;
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "hanson.xyz.vpnhotspotmod";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "freedom";
public static final int VERSION_CODE = 1005;
public static final String VERSION_NAME = "2.16.5";
}

View File

@@ -0,0 +1,7 @@
package androidx.databinding;
public class DataBinderMapperImpl extends MergedDataBinderMapper {
DataBinderMapperImpl() {
addMapper(new hanson.xyz.vpnhotspotmod.DataBinderMapperImpl());
}
}

View File

@@ -0,0 +1,4 @@
package androidx.databinding;
public interface DataBindingComponent {
}

View File

@@ -0,0 +1,19 @@
package androidx.databinding.library.baseAdapters;
public class BR {
public static final int _all = 0;
public static final int addresses = 1;
public static final int client = 2;
public static final int data = 3;
public static final int rate = 4;
public static final int serviceStarted = 5;
public static final int switchEnabled = 6;
public static final int title = 7;
}

View File

@@ -0,0 +1,19 @@
package hanson.xyz.vpnhotspotmod;
public class BR {
public static final int _all = 0;
public static final int addresses = 1;
public static final int client = 2;
public static final int data = 3;
public static final int rate = 4;
public static final int serviceStarted = 5;
public static final int switchEnabled = 6;
public static final int title = 7;
}

View File

@@ -0,0 +1,143 @@
package hanson.xyz.vpnhotspotmod;
import android.util.SparseArray;
import android.util.SparseIntArray;
import android.view.View;
import androidx.databinding.DataBinderMapper;
import androidx.databinding.DataBindingComponent;
import androidx.databinding.ViewDataBinding;
import hanson.xyz.vpnhotspotmod.databinding.ListitemClientBindingImpl;
import hanson.xyz.vpnhotspotmod.databinding.ListitemInterfaceBindingImpl;
import hanson.xyz.vpnhotspotmod.databinding.ListitemManageBindingImpl;
import hanson.xyz.vpnhotspotmod.databinding.ListitemRepeaterBindingImpl;
import java.lang.IllegalArgumentException;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.RuntimeException;
import java.lang.String;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class DataBinderMapperImpl extends DataBinderMapper {
private static final int LAYOUT_LISTITEMCLIENT = 1;
private static final int LAYOUT_LISTITEMINTERFACE = 2;
private static final int LAYOUT_LISTITEMMANAGE = 3;
private static final int LAYOUT_LISTITEMREPEATER = 4;
private static final SparseIntArray INTERNAL_LAYOUT_ID_LOOKUP = new SparseIntArray(4);
static {
INTERNAL_LAYOUT_ID_LOOKUP.put(hanson.xyz.vpnhotspotmod.R.layout.listitem_client, LAYOUT_LISTITEMCLIENT);
INTERNAL_LAYOUT_ID_LOOKUP.put(hanson.xyz.vpnhotspotmod.R.layout.listitem_interface, LAYOUT_LISTITEMINTERFACE);
INTERNAL_LAYOUT_ID_LOOKUP.put(hanson.xyz.vpnhotspotmod.R.layout.listitem_manage, LAYOUT_LISTITEMMANAGE);
INTERNAL_LAYOUT_ID_LOOKUP.put(hanson.xyz.vpnhotspotmod.R.layout.listitem_repeater, LAYOUT_LISTITEMREPEATER);
}
@Override
public ViewDataBinding getDataBinder(DataBindingComponent component, View view, int layoutId) {
int localizedLayoutId = INTERNAL_LAYOUT_ID_LOOKUP.get(layoutId);
if(localizedLayoutId > 0) {
final Object tag = view.getTag();
if(tag == null) {
throw new RuntimeException("view must have a tag");
}
switch(localizedLayoutId) {
case LAYOUT_LISTITEMCLIENT: {
if ("layout/listitem_client_0".equals(tag)) {
return new ListitemClientBindingImpl(component, view);
}
throw new IllegalArgumentException("The tag for listitem_client is invalid. Received: " + tag);
}
case LAYOUT_LISTITEMINTERFACE: {
if ("layout/listitem_interface_0".equals(tag)) {
return new ListitemInterfaceBindingImpl(component, view);
}
throw new IllegalArgumentException("The tag for listitem_interface is invalid. Received: " + tag);
}
case LAYOUT_LISTITEMMANAGE: {
if ("layout/listitem_manage_0".equals(tag)) {
return new ListitemManageBindingImpl(component, view);
}
throw new IllegalArgumentException("The tag for listitem_manage is invalid. Received: " + tag);
}
case LAYOUT_LISTITEMREPEATER: {
if ("layout/listitem_repeater_0".equals(tag)) {
return new ListitemRepeaterBindingImpl(component, view);
}
throw new IllegalArgumentException("The tag for listitem_repeater is invalid. Received: " + tag);
}
}
}
return null;
}
@Override
public ViewDataBinding getDataBinder(DataBindingComponent component, View[] views, int layoutId) {
if(views == null || views.length == 0) {
return null;
}
int localizedLayoutId = INTERNAL_LAYOUT_ID_LOOKUP.get(layoutId);
if(localizedLayoutId > 0) {
final Object tag = views[0].getTag();
if(tag == null) {
throw new RuntimeException("view must have a tag");
}
switch(localizedLayoutId) {
}
}
return null;
}
@Override
public int getLayoutId(String tag) {
if (tag == null) {
return 0;
}
Integer tmpVal = InnerLayoutIdLookup.sKeys.get(tag);
return tmpVal == null ? 0 : tmpVal;
}
@Override
public String convertBrIdToString(int localId) {
String tmpVal = InnerBrLookup.sKeys.get(localId);
return tmpVal;
}
@Override
public List<DataBinderMapper> collectDependencies() {
ArrayList<DataBinderMapper> result = new ArrayList<DataBinderMapper>(1);
result.add(new androidx.databinding.library.baseAdapters.DataBinderMapperImpl());
return result;
}
private static class InnerBrLookup {
static final SparseArray<String> sKeys = new SparseArray<String>(8);
static {
sKeys.put(0, "_all");
sKeys.put(1, "addresses");
sKeys.put(2, "client");
sKeys.put(3, "data");
sKeys.put(4, "rate");
sKeys.put(5, "serviceStarted");
sKeys.put(6, "switchEnabled");
sKeys.put(7, "title");
}
}
private static class InnerLayoutIdLookup {
static final HashMap<String, Integer> sKeys = new HashMap<String, Integer>(4);
static {
sKeys.put("layout/listitem_client_0", hanson.xyz.vpnhotspotmod.R.layout.listitem_client);
sKeys.put("layout/listitem_interface_0", hanson.xyz.vpnhotspotmod.R.layout.listitem_interface);
sKeys.put("layout/listitem_manage_0", hanson.xyz.vpnhotspotmod.R.layout.listitem_manage);
sKeys.put("layout/listitem_repeater_0", hanson.xyz.vpnhotspotmod.R.layout.listitem_repeater);
}
}
}

View File

@@ -0,0 +1,282 @@
package hanson.xyz.vpnhotspotmod.databinding;
import hanson.xyz.vpnhotspotmod.R;
import hanson.xyz.vpnhotspotmod.BR;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.View;
@SuppressWarnings("unchecked")
public class ListitemClientBindingImpl extends ListitemClientBinding {
@Nullable
private static final androidx.databinding.ViewDataBinding.IncludedLayouts sIncludes;
@Nullable
private static final android.util.SparseIntArray sViewsWithIds;
static {
sIncludes = null;
sViewsWithIds = null;
}
// views
@NonNull
private final android.widget.LinearLayout mboundView0;
@NonNull
private final android.widget.ImageView mboundView1;
@NonNull
private final hanson.xyz.vpnhotspotmod.widget.LinkTextView mboundView2;
@NonNull
private final hanson.xyz.vpnhotspotmod.widget.AutoCollapseTextView mboundView4;
// variables
// values
// listeners
// Inverse Binding Event Handlers
public ListitemClientBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
this(bindingComponent, root, mapBindings(bindingComponent, root, 5, sIncludes, sViewsWithIds));
}
private ListitemClientBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
super(bindingComponent, root, 4
, (hanson.xyz.vpnhotspotmod.widget.AutoCollapseTextView) bindings[3]
);
this.description.setTag(null);
this.mboundView0 = (android.widget.LinearLayout) bindings[0];
this.mboundView0.setTag(null);
this.mboundView1 = (android.widget.ImageView) bindings[1];
this.mboundView1.setTag(null);
this.mboundView2 = (hanson.xyz.vpnhotspotmod.widget.LinkTextView) bindings[2];
this.mboundView2.setTag(null);
this.mboundView4 = (hanson.xyz.vpnhotspotmod.widget.AutoCollapseTextView) bindings[4];
this.mboundView4.setTag(null);
setRootTag(root);
// listeners
invalidateAll();
}
@Override
public void invalidateAll() {
synchronized(this) {
mDirtyFlags = 0x20L;
}
requestRebind();
}
@Override
public boolean hasPendingBindings() {
synchronized(this) {
if (mDirtyFlags != 0) {
return true;
}
}
return false;
}
@Override
public boolean setVariable(int variableId, @Nullable Object variable) {
boolean variableSet = true;
if (BR.rate == variableId) {
setRate((hanson.xyz.vpnhotspotmod.client.ClientsFragment.TrafficRate) variable);
}
else if (BR.client == variableId) {
setClient((hanson.xyz.vpnhotspotmod.client.Client) variable);
}
else {
variableSet = false;
}
return variableSet;
}
public void setRate(@Nullable hanson.xyz.vpnhotspotmod.client.ClientsFragment.TrafficRate Rate) {
updateRegistration(0, Rate);
this.mRate = Rate;
synchronized(this) {
mDirtyFlags |= 0x1L;
}
notifyPropertyChanged(BR.rate);
super.requestRebind();
}
public void setClient(@Nullable hanson.xyz.vpnhotspotmod.client.Client Client) {
this.mClient = Client;
synchronized(this) {
mDirtyFlags |= 0x10L;
}
notifyPropertyChanged(BR.client);
super.requestRebind();
}
@Override
protected boolean onFieldChange(int localFieldId, Object object, int fieldId) {
switch (localFieldId) {
case 0 :
return onChangeRate((hanson.xyz.vpnhotspotmod.client.ClientsFragment.TrafficRate) object, fieldId);
case 1 :
return onChangeClientTitleSelectable((androidx.lifecycle.LiveData<java.lang.Boolean>) object, fieldId);
case 2 :
return onChangeClientDescription((androidx.lifecycle.LiveData<java.lang.CharSequence>) object, fieldId);
case 3 :
return onChangeClientTitle((androidx.lifecycle.LiveData<android.text.SpannableStringBuilder>) object, fieldId);
}
return false;
}
private boolean onChangeRate(hanson.xyz.vpnhotspotmod.client.ClientsFragment.TrafficRate Rate, int fieldId) {
if (fieldId == BR._all) {
synchronized(this) {
mDirtyFlags |= 0x1L;
}
return true;
}
return false;
}
private boolean onChangeClientTitleSelectable(androidx.lifecycle.LiveData<java.lang.Boolean> ClientTitleSelectable, int fieldId) {
if (fieldId == BR._all) {
synchronized(this) {
mDirtyFlags |= 0x2L;
}
return true;
}
return false;
}
private boolean onChangeClientDescription(androidx.lifecycle.LiveData<java.lang.CharSequence> ClientDescription, int fieldId) {
if (fieldId == BR._all) {
synchronized(this) {
mDirtyFlags |= 0x4L;
}
return true;
}
return false;
}
private boolean onChangeClientTitle(androidx.lifecycle.LiveData<android.text.SpannableStringBuilder> ClientTitle, int fieldId) {
if (fieldId == BR._all) {
synchronized(this) {
mDirtyFlags |= 0x8L;
}
return true;
}
return false;
}
@Override
protected void executeBindings() {
long dirtyFlags = 0;
synchronized(this) {
dirtyFlags = mDirtyFlags;
mDirtyFlags = 0;
}
java.lang.Boolean clientTitleSelectableGetValue = null;
hanson.xyz.vpnhotspotmod.client.ClientsFragment.TrafficRate rate = mRate;
int clientIcon = 0;
androidx.lifecycle.LiveData<java.lang.Boolean> clientTitleSelectable = null;
androidx.lifecycle.LiveData<java.lang.CharSequence> clientDescription = null;
hanson.xyz.vpnhotspotmod.client.Client client = mClient;
java.lang.CharSequence clientDescriptionGetValue = null;
androidx.lifecycle.LiveData<android.text.SpannableStringBuilder> clientTitle = null;
java.lang.String rateToString = null;
boolean androidxDatabindingViewDataBindingSafeUnboxClientTitleSelectableGetValue = false;
android.text.SpannableStringBuilder clientTitleGetValue = null;
if ((dirtyFlags & 0x21L) != 0) {
if (rate != null) {
// read rate.toString()
rateToString = rate.toString();
}
}
if ((dirtyFlags & 0x3eL) != 0) {
if ((dirtyFlags & 0x30L) != 0) {
if (client != null) {
// read client.icon
clientIcon = client.getIcon();
}
}
if ((dirtyFlags & 0x32L) != 0) {
if (client != null) {
// read client.titleSelectable
clientTitleSelectable = client.getTitleSelectable();
}
updateLiveDataRegistration(1, clientTitleSelectable);
if (clientTitleSelectable != null) {
// read client.titleSelectable.getValue()
clientTitleSelectableGetValue = clientTitleSelectable.getValue();
}
// read androidx.databinding.ViewDataBinding.safeUnbox(client.titleSelectable.getValue())
androidxDatabindingViewDataBindingSafeUnboxClientTitleSelectableGetValue = androidx.databinding.ViewDataBinding.safeUnbox(clientTitleSelectableGetValue);
}
if ((dirtyFlags & 0x34L) != 0) {
if (client != null) {
// read client.description
clientDescription = client.getDescription();
}
updateLiveDataRegistration(2, clientDescription);
if (clientDescription != null) {
// read client.description.getValue()
clientDescriptionGetValue = clientDescription.getValue();
}
}
if ((dirtyFlags & 0x38L) != 0) {
if (client != null) {
// read client.title
clientTitle = client.getTitle();
}
updateLiveDataRegistration(3, clientTitle);
if (clientTitle != null) {
// read client.title.getValue()
clientTitleGetValue = clientTitle.getValue();
}
}
}
// batch finished
if ((dirtyFlags & 0x34L) != 0) {
// api target 1
androidx.databinding.adapters.TextViewBindingAdapter.setText(this.description, clientDescriptionGetValue);
}
if ((dirtyFlags & 0x30L) != 0) {
// api target 1
hanson.xyz.vpnhotspotmod.util.UtilsKt.setImageResource(this.mboundView1, clientIcon);
}
if ((dirtyFlags & 0x38L) != 0) {
// api target 1
androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView2, clientTitleGetValue);
}
if ((dirtyFlags & 0x32L) != 0) {
// api target 11
if(getBuildSdkInt() >= 11) {
this.mboundView2.setTextIsSelectable(androidxDatabindingViewDataBindingSafeUnboxClientTitleSelectableGetValue);
}
}
if ((dirtyFlags & 0x21L) != 0) {
// api target 1
androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView4, rateToString);
}
}
// Listener Stub Implementations
// callback impls
// dirty flag
private long mDirtyFlags = 0xffffffffffffffffL;
/* flag mapping
flag 0 (0x1L): rate
flag 1 (0x2L): client.titleSelectable
flag 2 (0x3L): client.description
flag 3 (0x4L): client.title
flag 4 (0x5L): client
flag 5 (0x6L): null
flag mapping end*/
//end
}

View File

@@ -0,0 +1,166 @@
package hanson.xyz.vpnhotspotmod.databinding;
import hanson.xyz.vpnhotspotmod.R;
import hanson.xyz.vpnhotspotmod.BR;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.View;
@SuppressWarnings("unchecked")
public class ListitemInterfaceBindingImpl extends ListitemInterfaceBinding {
@Nullable
private static final androidx.databinding.ViewDataBinding.IncludedLayouts sIncludes;
@Nullable
private static final android.util.SparseIntArray sViewsWithIds;
static {
sIncludes = null;
sViewsWithIds = null;
}
// views
@NonNull
private final android.widget.LinearLayout mboundView0;
@NonNull
private final android.widget.ImageView mboundView1;
@NonNull
private final android.widget.TextView mboundView2;
@NonNull
private final com.google.android.material.materialswitch.MaterialSwitch mboundView4;
// variables
// values
// listeners
// Inverse Binding Event Handlers
public ListitemInterfaceBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
this(bindingComponent, root, mapBindings(bindingComponent, root, 5, sIncludes, sViewsWithIds));
}
private ListitemInterfaceBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
super(bindingComponent, root, 1
, (hanson.xyz.vpnhotspotmod.widget.AutoCollapseTextView) bindings[3]
);
this.mboundView0 = (android.widget.LinearLayout) bindings[0];
this.mboundView0.setTag(null);
this.mboundView1 = (android.widget.ImageView) bindings[1];
this.mboundView1.setTag(null);
this.mboundView2 = (android.widget.TextView) bindings[2];
this.mboundView2.setTag(null);
this.mboundView4 = (com.google.android.material.materialswitch.MaterialSwitch) bindings[4];
this.mboundView4.setTag(null);
this.text.setTag(null);
setRootTag(root);
// listeners
invalidateAll();
}
@Override
public void invalidateAll() {
synchronized(this) {
mDirtyFlags = 0x2L;
}
requestRebind();
}
@Override
public boolean hasPendingBindings() {
synchronized(this) {
if (mDirtyFlags != 0) {
return true;
}
}
return false;
}
@Override
public boolean setVariable(int variableId, @Nullable Object variable) {
boolean variableSet = true;
if (BR.data == variableId) {
setData((hanson.xyz.vpnhotspotmod.manage.Data) variable);
}
else {
variableSet = false;
}
return variableSet;
}
public void setData(@Nullable hanson.xyz.vpnhotspotmod.manage.Data Data) {
updateRegistration(0, Data);
this.mData = Data;
synchronized(this) {
mDirtyFlags |= 0x1L;
}
notifyPropertyChanged(BR.data);
super.requestRebind();
}
@Override
protected boolean onFieldChange(int localFieldId, Object object, int fieldId) {
switch (localFieldId) {
case 0 :
return onChangeData((hanson.xyz.vpnhotspotmod.manage.Data) object, fieldId);
}
return false;
}
private boolean onChangeData(hanson.xyz.vpnhotspotmod.manage.Data Data, int fieldId) {
if (fieldId == BR._all) {
synchronized(this) {
mDirtyFlags |= 0x1L;
}
return true;
}
return false;
}
@Override
protected void executeBindings() {
long dirtyFlags = 0;
synchronized(this) {
dirtyFlags = mDirtyFlags;
mDirtyFlags = 0;
}
java.lang.CharSequence dataText = null;
java.lang.CharSequence dataTitle = null;
boolean dataActive = false;
boolean dataSelectable = false;
hanson.xyz.vpnhotspotmod.manage.Data data = mData;
int dataIcon = 0;
if ((dirtyFlags & 0x3L) != 0) {
if (data != null) {
// read data.text
dataText = data.getText();
// read data.title
dataTitle = data.getTitle();
// read data.active
dataActive = data.getActive();
// read data.selectable
dataSelectable = data.getSelectable();
// read data.icon
dataIcon = data.getIcon();
}
}
// batch finished
if ((dirtyFlags & 0x3L) != 0) {
// api target 1
hanson.xyz.vpnhotspotmod.util.UtilsKt.setImageResource(this.mboundView1, dataIcon);
androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView2, dataTitle);
androidx.databinding.adapters.CompoundButtonBindingAdapter.setChecked(this.mboundView4, dataActive);
androidx.databinding.adapters.TextViewBindingAdapter.setText(this.text, dataText);
// api target 11
if(getBuildSdkInt() >= 11) {
this.text.setTextIsSelectable(dataSelectable);
}
}
}
// Listener Stub Implementations
// callback impls
// dirty flag
private long mDirtyFlags = 0xffffffffffffffffL;
/* flag mapping
flag 0 (0x1L): data
flag 1 (0x2L): null
flag mapping end*/
//end
}

View File

@@ -0,0 +1,134 @@
package hanson.xyz.vpnhotspotmod.databinding;
import hanson.xyz.vpnhotspotmod.R;
import hanson.xyz.vpnhotspotmod.BR;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.View;
@SuppressWarnings("unchecked")
public class ListitemManageBindingImpl extends ListitemManageBinding {
@Nullable
private static final androidx.databinding.ViewDataBinding.IncludedLayouts sIncludes;
@Nullable
private static final android.util.SparseIntArray sViewsWithIds;
static {
sIncludes = null;
sViewsWithIds = null;
}
// views
@NonNull
private final android.widget.LinearLayout mboundView0;
// variables
// values
// listeners
// Inverse Binding Event Handlers
public ListitemManageBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
this(bindingComponent, root, mapBindings(bindingComponent, root, 2, sIncludes, sViewsWithIds));
}
private ListitemManageBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
super(bindingComponent, root, 1
, (android.widget.TextView) bindings[1]
);
this.mboundView0 = (android.widget.LinearLayout) bindings[0];
this.mboundView0.setTag(null);
this.offloadEnabled.setTag(null);
setRootTag(root);
// listeners
invalidateAll();
}
@Override
public void invalidateAll() {
synchronized(this) {
mDirtyFlags = 0x2L;
}
requestRebind();
}
@Override
public boolean hasPendingBindings() {
synchronized(this) {
if (mDirtyFlags != 0) {
return true;
}
}
return false;
}
@Override
public boolean setVariable(int variableId, @Nullable Object variable) {
boolean variableSet = true;
if (BR.data == variableId) {
setData((hanson.xyz.vpnhotspotmod.manage.ManageBar.Data) variable);
}
else {
variableSet = false;
}
return variableSet;
}
public void setData(@Nullable hanson.xyz.vpnhotspotmod.manage.ManageBar.Data Data) {
updateRegistration(0, Data);
this.mData = Data;
synchronized(this) {
mDirtyFlags |= 0x1L;
}
notifyPropertyChanged(BR.data);
super.requestRebind();
}
@Override
protected boolean onFieldChange(int localFieldId, Object object, int fieldId) {
switch (localFieldId) {
case 0 :
return onChangeData((hanson.xyz.vpnhotspotmod.manage.ManageBar.Data) object, fieldId);
}
return false;
}
private boolean onChangeData(hanson.xyz.vpnhotspotmod.manage.ManageBar.Data Data, int fieldId) {
if (fieldId == BR._all) {
synchronized(this) {
mDirtyFlags |= 0x1L;
}
return true;
}
return false;
}
@Override
protected void executeBindings() {
long dirtyFlags = 0;
synchronized(this) {
dirtyFlags = mDirtyFlags;
mDirtyFlags = 0;
}
boolean dataOffloadEnabled = false;
hanson.xyz.vpnhotspotmod.manage.ManageBar.Data data = mData;
if ((dirtyFlags & 0x3L) != 0) {
if (data != null) {
// read data.offloadEnabled
dataOffloadEnabled = data.getOffloadEnabled();
}
}
// batch finished
if ((dirtyFlags & 0x3L) != 0) {
// api target 1
hanson.xyz.vpnhotspotmod.util.UtilsKt.setVisibility(this.offloadEnabled, dataOffloadEnabled);
}
}
// Listener Stub Implementations
// callback impls
// dirty flag
private long mDirtyFlags = 0xffffffffffffffffL;
/* flag mapping
flag 0 (0x1L): data
flag 1 (0x2L): null
flag mapping end*/
//end
}

View File

@@ -0,0 +1,285 @@
package hanson.xyz.vpnhotspotmod.databinding;
import hanson.xyz.vpnhotspotmod.R;
import hanson.xyz.vpnhotspotmod.BR;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.View;
@SuppressWarnings("unchecked")
public class ListitemRepeaterBindingImpl extends ListitemRepeaterBinding implements hanson.xyz.vpnhotspotmod.generated.callback.OnClickListener.Listener {
@Nullable
private static final androidx.databinding.ViewDataBinding.IncludedLayouts sIncludes;
@Nullable
private static final android.util.SparseIntArray sViewsWithIds;
static {
sIncludes = null;
sViewsWithIds = null;
}
// views
@NonNull
private final android.widget.LinearLayout mboundView0;
@NonNull
private final android.widget.LinearLayout mboundView1;
@NonNull
private final android.widget.TextView mboundView2;
@NonNull
private final com.google.android.material.materialswitch.MaterialSwitch mboundView4;
@NonNull
private final android.widget.LinearLayout mboundView5;
// variables
@Nullable
private final android.view.View.OnClickListener mCallback1;
@Nullable
private final android.view.View.OnClickListener mCallback2;
// values
// listeners
// Inverse Binding Event Handlers
public ListitemRepeaterBindingImpl(@Nullable androidx.databinding.DataBindingComponent bindingComponent, @NonNull View root) {
this(bindingComponent, root, mapBindings(bindingComponent, root, 6, sIncludes, sViewsWithIds));
}
private ListitemRepeaterBindingImpl(androidx.databinding.DataBindingComponent bindingComponent, View root, Object[] bindings) {
super(bindingComponent, root, 1
, (hanson.xyz.vpnhotspotmod.widget.AutoCollapseTextView) bindings[3]
);
this.addresses.setTag(null);
this.mboundView0 = (android.widget.LinearLayout) bindings[0];
this.mboundView0.setTag(null);
this.mboundView1 = (android.widget.LinearLayout) bindings[1];
this.mboundView1.setTag(null);
this.mboundView2 = (android.widget.TextView) bindings[2];
this.mboundView2.setTag(null);
this.mboundView4 = (com.google.android.material.materialswitch.MaterialSwitch) bindings[4];
this.mboundView4.setTag(null);
this.mboundView5 = (android.widget.LinearLayout) bindings[5];
this.mboundView5.setTag(null);
setRootTag(root);
// listeners
mCallback1 = new hanson.xyz.vpnhotspotmod.generated.callback.OnClickListener(this, 1);
mCallback2 = new hanson.xyz.vpnhotspotmod.generated.callback.OnClickListener(this, 2);
invalidateAll();
}
@Override
public void invalidateAll() {
synchronized(this) {
mDirtyFlags = 0x20L;
}
requestRebind();
}
@Override
public boolean hasPendingBindings() {
synchronized(this) {
if (mDirtyFlags != 0) {
return true;
}
}
return false;
}
@Override
public boolean setVariable(int variableId, @Nullable Object variable) {
boolean variableSet = true;
if (BR.data == variableId) {
setData((hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data) variable);
}
else {
variableSet = false;
}
return variableSet;
}
public void setData(@Nullable hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data Data) {
updateRegistration(0, Data);
this.mData = Data;
synchronized(this) {
mDirtyFlags |= 0x1L;
}
notifyPropertyChanged(BR.data);
super.requestRebind();
}
@Override
protected boolean onFieldChange(int localFieldId, Object object, int fieldId) {
switch (localFieldId) {
case 0 :
return onChangeData((hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data) object, fieldId);
}
return false;
}
private boolean onChangeData(hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data Data, int fieldId) {
if (fieldId == BR._all) {
synchronized(this) {
mDirtyFlags |= 0x1L;
}
return true;
}
else if (fieldId == BR.title) {
synchronized(this) {
mDirtyFlags |= 0x2L;
}
return true;
}
else if (fieldId == BR.addresses) {
synchronized(this) {
mDirtyFlags |= 0x4L;
}
return true;
}
else if (fieldId == BR.serviceStarted) {
synchronized(this) {
mDirtyFlags |= 0x8L;
}
return true;
}
else if (fieldId == BR.switchEnabled) {
synchronized(this) {
mDirtyFlags |= 0x10L;
}
return true;
}
return false;
}
@Override
protected void executeBindings() {
long dirtyFlags = 0;
synchronized(this) {
dirtyFlags = mDirtyFlags;
mDirtyFlags = 0;
}
java.lang.CharSequence dataTitle = null;
boolean dataSwitchEnabled = false;
boolean dataServiceStartedWifiP2pManagerHelperGetStartWpsJavaLangObjectNullBooleanFalse = false;
boolean dataServiceStarted = false;
hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data data = mData;
java.lang.CharSequence dataAddresses = null;
if ((dirtyFlags & 0x3fL) != 0) {
if ((dirtyFlags & 0x23L) != 0) {
if (data != null) {
// read data.title
dataTitle = data.getTitle();
}
}
if ((dirtyFlags & 0x31L) != 0) {
if (data != null) {
// read data.switchEnabled
dataSwitchEnabled = data.getSwitchEnabled();
}
}
if ((dirtyFlags & 0x29L) != 0) {
if (data != null) {
// read data.serviceStarted
dataServiceStarted = data.getServiceStarted();
}
if((dirtyFlags & 0x29L) != 0) {
if(dataServiceStarted) {
dirtyFlags |= 0x80L;
}
else {
dirtyFlags |= 0x40L;
}
}
// read data.serviceStarted ? WifiP2pManagerHelper.getStartWps() != null : false
dataServiceStartedWifiP2pManagerHelperGetStartWpsJavaLangObjectNullBooleanFalse = ((dataServiceStarted) ? ((hanson.xyz.vpnhotspotmod.net.wifi.WifiP2pManagerHelper.getStartWps()) != (null)) : (false));
}
if ((dirtyFlags & 0x25L) != 0) {
if (data != null) {
// read data.addresses
dataAddresses = data.getAddresses();
}
}
}
// batch finished
if ((dirtyFlags & 0x25L) != 0) {
// api target 1
androidx.databinding.adapters.TextViewBindingAdapter.setText(this.addresses, dataAddresses);
}
if ((dirtyFlags & 0x20L) != 0) {
// api target 1
this.mboundView1.setOnClickListener(mCallback1);
this.mboundView5.setOnClickListener(mCallback2);
}
if ((dirtyFlags & 0x23L) != 0) {
// api target 1
androidx.databinding.adapters.TextViewBindingAdapter.setText(this.mboundView2, dataTitle);
}
if ((dirtyFlags & 0x29L) != 0) {
// api target 1
androidx.databinding.adapters.CompoundButtonBindingAdapter.setChecked(this.mboundView4, dataServiceStarted);
hanson.xyz.vpnhotspotmod.util.UtilsKt.setVisibility(this.mboundView5, dataServiceStartedWifiP2pManagerHelperGetStartWpsJavaLangObjectNullBooleanFalse);
}
if ((dirtyFlags & 0x31L) != 0) {
// api target 1
this.mboundView4.setEnabled(dataSwitchEnabled);
}
}
// Listener Stub Implementations
// callback impls
public final void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0) {
switch(sourceId) {
case 1: {
// localize variables for thread safety
// data != null
boolean dataJavaLangObjectNull = false;
// data
hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data data = mData;
dataJavaLangObjectNull = (data) != (null);
if (dataJavaLangObjectNull) {
data.toggle();
}
break;
}
case 2: {
// localize variables for thread safety
// data != null
boolean dataJavaLangObjectNull = false;
// data
hanson.xyz.vpnhotspotmod.manage.RepeaterManager.Data data = mData;
dataJavaLangObjectNull = (data) != (null);
if (dataJavaLangObjectNull) {
data.wps();
}
break;
}
}
}
// dirty flag
private long mDirtyFlags = 0xffffffffffffffffL;
/* flag mapping
flag 0 (0x1L): data
flag 1 (0x2L): data.title
flag 2 (0x3L): data.addresses
flag 3 (0x4L): data.serviceStarted
flag 4 (0x5L): data.switchEnabled
flag 5 (0x6L): null
flag 6 (0x7L): data.serviceStarted ? WifiP2pManagerHelper.getStartWps() != null : false
flag 7 (0x8L): data.serviceStarted ? WifiP2pManagerHelper.getStartWps() != null : false
flag mapping end*/
//end
}

View File

@@ -0,0 +1,16 @@
package hanson.xyz.vpnhotspotmod.generated.callback;
public final class OnClickListener implements android.view.View.OnClickListener {
final Listener mListener;
final int mSourceId;
public OnClickListener(Listener listener, int sourceId) {
mListener = listener;
mSourceId = sourceId;
}
@Override
public void onClick(android.view.View callbackArg_0) {
mListener._internalCallbackOnClick(mSourceId , callbackArg_0);
}
public interface Listener {
void _internalCallbackOnClick(int sourceId , android.view.View callbackArg_0);
}
}

View File

@@ -0,0 +1,227 @@
package hanson.xyz.vpnhotspotmod.room;
import androidx.annotation.NonNull;
import androidx.room.DatabaseConfiguration;
import androidx.room.InvalidationTracker;
import androidx.room.RoomDatabase;
import androidx.room.RoomOpenHelper;
import androidx.room.migration.AutoMigrationSpec;
import androidx.room.migration.Migration;
import androidx.room.util.DBUtil;
import androidx.room.util.TableInfo;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import java.lang.Class;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.processing.Generated;
@Generated("androidx.room.RoomProcessor")
@SuppressWarnings({"unchecked", "deprecation"})
public final class AppDatabase_Impl extends AppDatabase {
private volatile ClientRecord.Dao _clientRecord;
private volatile TrafficRecord.Dao _trafficRecord;
@Override
@NonNull
protected SupportSQLiteOpenHelper createOpenHelper(@NonNull final DatabaseConfiguration config) {
final SupportSQLiteOpenHelper.Callback _openCallback = new RoomOpenHelper(config, new RoomOpenHelper.Delegate(2) {
@Override
public void createAllTables(@NonNull final SupportSQLiteDatabase db) {
db.execSQL("CREATE TABLE IF NOT EXISTS `ClientRecord` (`mac` INTEGER NOT NULL, `nickname` BLOB NOT NULL, `blocked` INTEGER NOT NULL, `macLookupPending` INTEGER NOT NULL, PRIMARY KEY(`mac`))");
db.execSQL("CREATE TABLE IF NOT EXISTS `TrafficRecord` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `timestamp` INTEGER NOT NULL, `mac` INTEGER NOT NULL, `ip` BLOB NOT NULL, `upstream` TEXT, `downstream` TEXT NOT NULL, `sentPackets` INTEGER NOT NULL, `sentBytes` INTEGER NOT NULL, `receivedPackets` INTEGER NOT NULL, `receivedBytes` INTEGER NOT NULL, `previousId` INTEGER, FOREIGN KEY(`previousId`) REFERENCES `TrafficRecord`(`id`) ON UPDATE RESTRICT ON DELETE CASCADE )");
db.execSQL("CREATE UNIQUE INDEX IF NOT EXISTS `index_TrafficRecord_previousId` ON `TrafficRecord` (`previousId`)");
db.execSQL("CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)");
db.execSQL("INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '92a6c0406ed7265dbd98eb3c24095651')");
}
@Override
public void dropAllTables(@NonNull final SupportSQLiteDatabase db) {
db.execSQL("DROP TABLE IF EXISTS `ClientRecord`");
db.execSQL("DROP TABLE IF EXISTS `TrafficRecord`");
final List<? extends RoomDatabase.Callback> _callbacks = mCallbacks;
if (_callbacks != null) {
for (RoomDatabase.Callback _callback : _callbacks) {
_callback.onDestructiveMigration(db);
}
}
}
@Override
public void onCreate(@NonNull final SupportSQLiteDatabase db) {
final List<? extends RoomDatabase.Callback> _callbacks = mCallbacks;
if (_callbacks != null) {
for (RoomDatabase.Callback _callback : _callbacks) {
_callback.onCreate(db);
}
}
}
@Override
public void onOpen(@NonNull final SupportSQLiteDatabase db) {
mDatabase = db;
db.execSQL("PRAGMA foreign_keys = ON");
internalInitInvalidationTracker(db);
final List<? extends RoomDatabase.Callback> _callbacks = mCallbacks;
if (_callbacks != null) {
for (RoomDatabase.Callback _callback : _callbacks) {
_callback.onOpen(db);
}
}
}
@Override
public void onPreMigrate(@NonNull final SupportSQLiteDatabase db) {
DBUtil.dropFtsSyncTriggers(db);
}
@Override
public void onPostMigrate(@NonNull final SupportSQLiteDatabase db) {
}
@Override
@NonNull
public RoomOpenHelper.ValidationResult onValidateSchema(
@NonNull final SupportSQLiteDatabase db) {
final HashMap<String, TableInfo.Column> _columnsClientRecord = new HashMap<String, TableInfo.Column>(4);
_columnsClientRecord.put("mac", new TableInfo.Column("mac", "INTEGER", true, 1, null, TableInfo.CREATED_FROM_ENTITY));
_columnsClientRecord.put("nickname", new TableInfo.Column("nickname", "BLOB", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
_columnsClientRecord.put("blocked", new TableInfo.Column("blocked", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
_columnsClientRecord.put("macLookupPending", new TableInfo.Column("macLookupPending", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
final HashSet<TableInfo.ForeignKey> _foreignKeysClientRecord = new HashSet<TableInfo.ForeignKey>(0);
final HashSet<TableInfo.Index> _indicesClientRecord = new HashSet<TableInfo.Index>(0);
final TableInfo _infoClientRecord = new TableInfo("ClientRecord", _columnsClientRecord, _foreignKeysClientRecord, _indicesClientRecord);
final TableInfo _existingClientRecord = TableInfo.read(db, "ClientRecord");
if (!_infoClientRecord.equals(_existingClientRecord)) {
return new RoomOpenHelper.ValidationResult(false, "ClientRecord(hanson.xyz.vpnhotspotmod.room.ClientRecord).\n"
+ " Expected:\n" + _infoClientRecord + "\n"
+ " Found:\n" + _existingClientRecord);
}
final HashMap<String, TableInfo.Column> _columnsTrafficRecord = new HashMap<String, TableInfo.Column>(11);
_columnsTrafficRecord.put("id", new TableInfo.Column("id", "INTEGER", false, 1, null, TableInfo.CREATED_FROM_ENTITY));
_columnsTrafficRecord.put("timestamp", new TableInfo.Column("timestamp", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
_columnsTrafficRecord.put("mac", new TableInfo.Column("mac", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
_columnsTrafficRecord.put("ip", new TableInfo.Column("ip", "BLOB", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
_columnsTrafficRecord.put("upstream", new TableInfo.Column("upstream", "TEXT", false, 0, null, TableInfo.CREATED_FROM_ENTITY));
_columnsTrafficRecord.put("downstream", new TableInfo.Column("downstream", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
_columnsTrafficRecord.put("sentPackets", new TableInfo.Column("sentPackets", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
_columnsTrafficRecord.put("sentBytes", new TableInfo.Column("sentBytes", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
_columnsTrafficRecord.put("receivedPackets", new TableInfo.Column("receivedPackets", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
_columnsTrafficRecord.put("receivedBytes", new TableInfo.Column("receivedBytes", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY));
_columnsTrafficRecord.put("previousId", new TableInfo.Column("previousId", "INTEGER", false, 0, null, TableInfo.CREATED_FROM_ENTITY));
final HashSet<TableInfo.ForeignKey> _foreignKeysTrafficRecord = new HashSet<TableInfo.ForeignKey>(1);
_foreignKeysTrafficRecord.add(new TableInfo.ForeignKey("TrafficRecord", "CASCADE", "RESTRICT", Arrays.asList("previousId"), Arrays.asList("id")));
final HashSet<TableInfo.Index> _indicesTrafficRecord = new HashSet<TableInfo.Index>(1);
_indicesTrafficRecord.add(new TableInfo.Index("index_TrafficRecord_previousId", true, Arrays.asList("previousId"), Arrays.asList("ASC")));
final TableInfo _infoTrafficRecord = new TableInfo("TrafficRecord", _columnsTrafficRecord, _foreignKeysTrafficRecord, _indicesTrafficRecord);
final TableInfo _existingTrafficRecord = TableInfo.read(db, "TrafficRecord");
if (!_infoTrafficRecord.equals(_existingTrafficRecord)) {
return new RoomOpenHelper.ValidationResult(false, "TrafficRecord(hanson.xyz.vpnhotspotmod.room.TrafficRecord).\n"
+ " Expected:\n" + _infoTrafficRecord + "\n"
+ " Found:\n" + _existingTrafficRecord);
}
return new RoomOpenHelper.ValidationResult(true, null);
}
}, "92a6c0406ed7265dbd98eb3c24095651", "1f08a76d9f7ed5013d3879caeddd243c");
final SupportSQLiteOpenHelper.Configuration _sqliteConfig = SupportSQLiteOpenHelper.Configuration.builder(config.context).name(config.name).callback(_openCallback).build();
final SupportSQLiteOpenHelper _helper = config.sqliteOpenHelperFactory.create(_sqliteConfig);
return _helper;
}
@Override
@NonNull
protected InvalidationTracker createInvalidationTracker() {
final HashMap<String, String> _shadowTablesMap = new HashMap<String, String>(0);
final HashMap<String, Set<String>> _viewTables = new HashMap<String, Set<String>>(0);
return new InvalidationTracker(this, _shadowTablesMap, _viewTables, "ClientRecord","TrafficRecord");
}
@Override
public void clearAllTables() {
super.assertNotMainThread();
final SupportSQLiteDatabase _db = super.getOpenHelper().getWritableDatabase();
final boolean _supportsDeferForeignKeys = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP;
try {
if (!_supportsDeferForeignKeys) {
_db.execSQL("PRAGMA foreign_keys = FALSE");
}
super.beginTransaction();
if (_supportsDeferForeignKeys) {
_db.execSQL("PRAGMA defer_foreign_keys = TRUE");
}
_db.execSQL("DELETE FROM `ClientRecord`");
_db.execSQL("DELETE FROM `TrafficRecord`");
super.setTransactionSuccessful();
} finally {
super.endTransaction();
if (!_supportsDeferForeignKeys) {
_db.execSQL("PRAGMA foreign_keys = TRUE");
}
_db.query("PRAGMA wal_checkpoint(FULL)").close();
if (!_db.inTransaction()) {
_db.execSQL("VACUUM");
}
}
}
@Override
@NonNull
protected Map<Class<?>, List<Class<?>>> getRequiredTypeConverters() {
final HashMap<Class<?>, List<Class<?>>> _typeConvertersMap = new HashMap<Class<?>, List<Class<?>>>();
_typeConvertersMap.put(ClientRecord.Dao.class, ClientRecord_Dao_Impl.getRequiredConverters());
_typeConvertersMap.put(TrafficRecord.Dao.class, TrafficRecord_Dao_Impl.getRequiredConverters());
return _typeConvertersMap;
}
@Override
@NonNull
public Set<Class<? extends AutoMigrationSpec>> getRequiredAutoMigrationSpecs() {
final HashSet<Class<? extends AutoMigrationSpec>> _autoMigrationSpecsSet = new HashSet<Class<? extends AutoMigrationSpec>>();
return _autoMigrationSpecsSet;
}
@Override
@NonNull
public List<Migration> getAutoMigrations(
@NonNull final Map<Class<? extends AutoMigrationSpec>, AutoMigrationSpec> autoMigrationSpecs) {
final List<Migration> _autoMigrations = new ArrayList<Migration>();
return _autoMigrations;
}
@Override
public ClientRecord.Dao getClientRecordDao() {
if (_clientRecord != null) {
return _clientRecord;
} else {
synchronized(this) {
if(_clientRecord == null) {
_clientRecord = new ClientRecord_Dao_Impl(this);
}
return _clientRecord;
}
}
}
@Override
public TrafficRecord.Dao getTrafficRecordDao() {
if (_trafficRecord != null) {
return _trafficRecord;
} else {
synchronized(this) {
if(_trafficRecord == null) {
_trafficRecord = new TrafficRecord_Dao_Impl(this);
}
return _trafficRecord;
}
}
}
}

View File

@@ -0,0 +1,255 @@
package hanson.xyz.vpnhotspotmod.room;
import android.database.Cursor;
import android.net.MacAddress;
import android.os.CancellationSignal;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.LiveData;
import androidx.room.CoroutinesRoom;
import androidx.room.EntityInsertionAdapter;
import androidx.room.RoomDatabase;
import androidx.room.RoomDatabaseKt;
import androidx.room.RoomSQLiteQuery;
import androidx.room.util.CursorUtil;
import androidx.room.util.DBUtil;
import androidx.sqlite.db.SupportSQLiteStatement;
import java.lang.CharSequence;
import java.lang.Class;
import java.lang.Exception;
import java.lang.Long;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import javax.annotation.processing.Generated;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function2;
@Generated("androidx.room.RoomProcessor")
@SuppressWarnings({"unchecked", "deprecation"})
public final class ClientRecord_Dao_Impl extends ClientRecord.Dao {
private final RoomDatabase __db;
private final EntityInsertionAdapter<ClientRecord> __insertionAdapterOfClientRecord;
public ClientRecord_Dao_Impl(@NonNull final RoomDatabase __db) {
this.__db = __db;
this.__insertionAdapterOfClientRecord = new EntityInsertionAdapter<ClientRecord>(__db) {
@Override
@NonNull
protected String createQuery() {
return "INSERT OR REPLACE INTO `ClientRecord` (`mac`,`nickname`,`blocked`,`macLookupPending`) VALUES (?,?,?,?)";
}
@Override
protected void bind(@NonNull final SupportSQLiteStatement statement,
@NonNull final ClientRecord entity) {
final long _tmp = Converters.INSTANCE.persistMacAddress(entity.getMac());
statement.bindLong(1, _tmp);
final byte[] _tmp_1 = Converters.INSTANCE.persistCharSequence(entity.getNickname());
if (_tmp_1 == null) {
statement.bindNull(2);
} else {
statement.bindBlob(2, _tmp_1);
}
final int _tmp_2 = entity.getBlocked() ? 1 : 0;
statement.bindLong(3, _tmp_2);
final int _tmp_3 = entity.getMacLookupPending() ? 1 : 0;
statement.bindLong(4, _tmp_3);
}
};
}
@Override
protected Object updateInternal(final ClientRecord value,
final Continuation<? super Long> $completion) {
return CoroutinesRoom.execute(__db, true, new Callable<Long>() {
@Override
@NonNull
public Long call() throws Exception {
__db.beginTransaction();
try {
final Long _result = __insertionAdapterOfClientRecord.insertAndReturnId(value);
__db.setTransactionSuccessful();
return _result;
} finally {
__db.endTransaction();
}
}
}, $completion);
}
@Override
public Object upsert(final MacAddress mac,
final Function2<? super ClientRecord, ? super Continuation<? super Unit>, ?> operation,
final Continuation<? super ClientRecord> $completion) {
return RoomDatabaseKt.withTransaction(__db, (__cont) -> ClientRecord_Dao_Impl.super.upsert(mac, operation, __cont), $completion);
}
@Override
protected ClientRecord lookupBlocking(final MacAddress mac) {
final String _sql = "SELECT * FROM `ClientRecord` WHERE `mac` = ?";
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
int _argIndex = 1;
final long _tmp = Converters.INSTANCE.persistMacAddress(mac);
_statement.bindLong(_argIndex, _tmp);
__db.assertNotSuspendingTransaction();
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
try {
final int _cursorIndexOfMac = CursorUtil.getColumnIndexOrThrow(_cursor, "mac");
final int _cursorIndexOfNickname = CursorUtil.getColumnIndexOrThrow(_cursor, "nickname");
final int _cursorIndexOfBlocked = CursorUtil.getColumnIndexOrThrow(_cursor, "blocked");
final int _cursorIndexOfMacLookupPending = CursorUtil.getColumnIndexOrThrow(_cursor, "macLookupPending");
final ClientRecord _result;
if (_cursor.moveToFirst()) {
final MacAddress _tmpMac;
final long _tmp_1;
_tmp_1 = _cursor.getLong(_cursorIndexOfMac);
_tmpMac = Converters.INSTANCE.unpersistMacAddress(_tmp_1);
final CharSequence _tmpNickname;
final byte[] _tmp_2;
if (_cursor.isNull(_cursorIndexOfNickname)) {
_tmp_2 = null;
} else {
_tmp_2 = _cursor.getBlob(_cursorIndexOfNickname);
}
_tmpNickname = Converters.INSTANCE.unpersistCharSequence(_tmp_2);
final boolean _tmpBlocked;
final int _tmp_3;
_tmp_3 = _cursor.getInt(_cursorIndexOfBlocked);
_tmpBlocked = _tmp_3 != 0;
final boolean _tmpMacLookupPending;
final int _tmp_4;
_tmp_4 = _cursor.getInt(_cursorIndexOfMacLookupPending);
_tmpMacLookupPending = _tmp_4 != 0;
_result = new ClientRecord(_tmpMac,_tmpNickname,_tmpBlocked,_tmpMacLookupPending);
} else {
_result = null;
}
return _result;
} finally {
_cursor.close();
_statement.release();
}
}
@Override
protected Object lookup(final MacAddress mac,
final Continuation<? super ClientRecord> $completion) {
final String _sql = "SELECT * FROM `ClientRecord` WHERE `mac` = ?";
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
int _argIndex = 1;
final long _tmp = Converters.INSTANCE.persistMacAddress(mac);
_statement.bindLong(_argIndex, _tmp);
final CancellationSignal _cancellationSignal = DBUtil.createCancellationSignal();
return CoroutinesRoom.execute(__db, false, _cancellationSignal, new Callable<ClientRecord>() {
@Override
@Nullable
public ClientRecord call() throws Exception {
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
try {
final int _cursorIndexOfMac = CursorUtil.getColumnIndexOrThrow(_cursor, "mac");
final int _cursorIndexOfNickname = CursorUtil.getColumnIndexOrThrow(_cursor, "nickname");
final int _cursorIndexOfBlocked = CursorUtil.getColumnIndexOrThrow(_cursor, "blocked");
final int _cursorIndexOfMacLookupPending = CursorUtil.getColumnIndexOrThrow(_cursor, "macLookupPending");
final ClientRecord _result;
if (_cursor.moveToFirst()) {
final MacAddress _tmpMac;
final long _tmp_1;
_tmp_1 = _cursor.getLong(_cursorIndexOfMac);
_tmpMac = Converters.INSTANCE.unpersistMacAddress(_tmp_1);
final CharSequence _tmpNickname;
final byte[] _tmp_2;
if (_cursor.isNull(_cursorIndexOfNickname)) {
_tmp_2 = null;
} else {
_tmp_2 = _cursor.getBlob(_cursorIndexOfNickname);
}
_tmpNickname = Converters.INSTANCE.unpersistCharSequence(_tmp_2);
final boolean _tmpBlocked;
final int _tmp_3;
_tmp_3 = _cursor.getInt(_cursorIndexOfBlocked);
_tmpBlocked = _tmp_3 != 0;
final boolean _tmpMacLookupPending;
final int _tmp_4;
_tmp_4 = _cursor.getInt(_cursorIndexOfMacLookupPending);
_tmpMacLookupPending = _tmp_4 != 0;
_result = new ClientRecord(_tmpMac,_tmpNickname,_tmpBlocked,_tmpMacLookupPending);
} else {
_result = null;
}
return _result;
} finally {
_cursor.close();
_statement.release();
}
}
}, $completion);
}
@Override
protected LiveData<ClientRecord> lookupSync(final MacAddress mac) {
final String _sql = "SELECT * FROM `ClientRecord` WHERE `mac` = ?";
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
int _argIndex = 1;
final long _tmp = Converters.INSTANCE.persistMacAddress(mac);
_statement.bindLong(_argIndex, _tmp);
return __db.getInvalidationTracker().createLiveData(new String[] {"ClientRecord"}, false, new Callable<ClientRecord>() {
@Override
@Nullable
public ClientRecord call() throws Exception {
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
try {
final int _cursorIndexOfMac = CursorUtil.getColumnIndexOrThrow(_cursor, "mac");
final int _cursorIndexOfNickname = CursorUtil.getColumnIndexOrThrow(_cursor, "nickname");
final int _cursorIndexOfBlocked = CursorUtil.getColumnIndexOrThrow(_cursor, "blocked");
final int _cursorIndexOfMacLookupPending = CursorUtil.getColumnIndexOrThrow(_cursor, "macLookupPending");
final ClientRecord _result;
if (_cursor.moveToFirst()) {
final MacAddress _tmpMac;
final long _tmp_1;
_tmp_1 = _cursor.getLong(_cursorIndexOfMac);
_tmpMac = Converters.INSTANCE.unpersistMacAddress(_tmp_1);
final CharSequence _tmpNickname;
final byte[] _tmp_2;
if (_cursor.isNull(_cursorIndexOfNickname)) {
_tmp_2 = null;
} else {
_tmp_2 = _cursor.getBlob(_cursorIndexOfNickname);
}
_tmpNickname = Converters.INSTANCE.unpersistCharSequence(_tmp_2);
final boolean _tmpBlocked;
final int _tmp_3;
_tmp_3 = _cursor.getInt(_cursorIndexOfBlocked);
_tmpBlocked = _tmp_3 != 0;
final boolean _tmpMacLookupPending;
final int _tmp_4;
_tmp_4 = _cursor.getInt(_cursorIndexOfMacLookupPending);
_tmpMacLookupPending = _tmp_4 != 0;
_result = new ClientRecord(_tmpMac,_tmpNickname,_tmpBlocked,_tmpMacLookupPending);
} else {
_result = null;
}
return _result;
} finally {
_cursor.close();
}
}
@Override
protected void finalize() {
_statement.release();
}
});
}
@NonNull
public static List<Class<?>> getRequiredConverters() {
return Collections.emptyList();
}
}

View File

@@ -0,0 +1,156 @@
package hanson.xyz.vpnhotspotmod.room;
import android.database.Cursor;
import android.net.MacAddress;
import android.os.CancellationSignal;
import androidx.annotation.NonNull;
import androidx.room.CoroutinesRoom;
import androidx.room.EntityInsertionAdapter;
import androidx.room.RoomDatabase;
import androidx.room.RoomSQLiteQuery;
import androidx.room.util.DBUtil;
import androidx.sqlite.db.SupportSQLiteStatement;
import java.lang.Class;
import java.lang.Exception;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import javax.annotation.processing.Generated;
import kotlin.coroutines.Continuation;
@Generated("androidx.room.RoomProcessor")
@SuppressWarnings({"unchecked", "deprecation"})
public final class TrafficRecord_Dao_Impl extends TrafficRecord.Dao {
private final RoomDatabase __db;
private final EntityInsertionAdapter<TrafficRecord> __insertionAdapterOfTrafficRecord;
public TrafficRecord_Dao_Impl(@NonNull final RoomDatabase __db) {
this.__db = __db;
this.__insertionAdapterOfTrafficRecord = new EntityInsertionAdapter<TrafficRecord>(__db) {
@Override
@NonNull
protected String createQuery() {
return "INSERT OR ABORT INTO `TrafficRecord` (`id`,`timestamp`,`mac`,`ip`,`upstream`,`downstream`,`sentPackets`,`sentBytes`,`receivedPackets`,`receivedBytes`,`previousId`) VALUES (?,?,?,?,?,?,?,?,?,?,?)";
}
@Override
protected void bind(@NonNull final SupportSQLiteStatement statement,
@NonNull final TrafficRecord entity) {
if (entity.getId() == null) {
statement.bindNull(1);
} else {
statement.bindLong(1, entity.getId());
}
statement.bindLong(2, entity.getTimestamp());
final long _tmp = Converters.INSTANCE.persistMacAddress(entity.getMac());
statement.bindLong(3, _tmp);
final byte[] _tmp_1 = Converters.INSTANCE.persistInetAddress(entity.getIp());
if (_tmp_1 == null) {
statement.bindNull(4);
} else {
statement.bindBlob(4, _tmp_1);
}
if (entity.getUpstream() == null) {
statement.bindNull(5);
} else {
statement.bindString(5, entity.getUpstream());
}
if (entity.getDownstream() == null) {
statement.bindNull(6);
} else {
statement.bindString(6, entity.getDownstream());
}
statement.bindLong(7, entity.getSentPackets());
statement.bindLong(8, entity.getSentBytes());
statement.bindLong(9, entity.getReceivedPackets());
statement.bindLong(10, entity.getReceivedBytes());
if (entity.getPreviousId() == null) {
statement.bindNull(11);
} else {
statement.bindLong(11, entity.getPreviousId());
}
}
};
}
@Override
protected long insertInternal(final TrafficRecord value) {
__db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
final long _result = __insertionAdapterOfTrafficRecord.insertAndReturnId(value);
__db.setTransactionSuccessful();
return _result;
} finally {
__db.endTransaction();
}
}
@Override
public Object queryStats(final MacAddress mac,
final Continuation<? super ClientStats> $completion) {
final String _sql = "\n"
+ " SELECT MIN(TrafficRecord.timestamp) AS timestamp,\n"
+ " COUNT(TrafficRecord.id) AS count,\n"
+ " SUM(TrafficRecord.sentPackets) AS sentPackets,\n"
+ " SUM(TrafficRecord.sentBytes) AS sentBytes,\n"
+ " SUM(TrafficRecord.receivedPackets) AS receivedPackets,\n"
+ " SUM(TrafficRecord.receivedBytes) AS receivedBytes\n"
+ " FROM TrafficRecord LEFT JOIN TrafficRecord AS Next ON TrafficRecord.id = Next.previousId\n"
+ " /* We only want to find the last record for each chain so that we don't double count */\n"
+ " WHERE TrafficRecord.mac = ? AND Next.id IS NULL\n"
+ " ";
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
int _argIndex = 1;
final long _tmp = Converters.INSTANCE.persistMacAddress(mac);
_statement.bindLong(_argIndex, _tmp);
final CancellationSignal _cancellationSignal = DBUtil.createCancellationSignal();
return CoroutinesRoom.execute(__db, false, _cancellationSignal, new Callable<ClientStats>() {
@Override
@NonNull
public ClientStats call() throws Exception {
final Cursor _cursor = DBUtil.query(__db, _statement, false, null);
try {
final int _cursorIndexOfTimestamp = 0;
final int _cursorIndexOfCount = 1;
final int _cursorIndexOfSentPackets = 2;
final int _cursorIndexOfSentBytes = 3;
final int _cursorIndexOfReceivedPackets = 4;
final int _cursorIndexOfReceivedBytes = 5;
final ClientStats _result;
if (_cursor.moveToFirst()) {
final long _tmpTimestamp;
_tmpTimestamp = _cursor.getLong(_cursorIndexOfTimestamp);
final long _tmpCount;
_tmpCount = _cursor.getLong(_cursorIndexOfCount);
final long _tmpSentPackets;
_tmpSentPackets = _cursor.getLong(_cursorIndexOfSentPackets);
final long _tmpSentBytes;
_tmpSentBytes = _cursor.getLong(_cursorIndexOfSentBytes);
final long _tmpReceivedPackets;
_tmpReceivedPackets = _cursor.getLong(_cursorIndexOfReceivedPackets);
final long _tmpReceivedBytes;
_tmpReceivedBytes = _cursor.getLong(_cursorIndexOfReceivedBytes);
_result = new ClientStats(_tmpTimestamp,_tmpCount,_tmpSentPackets,_tmpSentBytes,_tmpReceivedPackets,_tmpReceivedBytes);
} else {
_result = null;
}
return _result;
} finally {
_cursor.close();
_statement.release();
}
}
}, $completion);
}
@NonNull
public static List<Class<?>> getRequiredConverters() {
return Collections.emptyList();
}
}