Bug Fixes

Bug Fixes
master
Abdul Mannan Saeed 2023-01-07 02:15:05 +05:00
parent c29266bd1f
commit 90751096cc
93 changed files with 355 additions and 234 deletions

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="deploymentTargetDropDown"> <component name="deploymentTargetDropDown">
<runningDeviceTargetSelectedWithDropDown> <targetSelectedWithDropDown>
<Target> <Target>
<type value="RUNNING_DEVICE_TARGET" /> <type value="QUICK_BOOT_TARGET" />
<deviceKey> <deviceKey>
<Key> <Key>
<type value="VIRTUAL_DEVICE_PATH" /> <type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\msman\.android\avd\Pixel_2_API_25.avd" /> <value value="C:\Users\msman\.android\avd\Pixel_2_API_25_1.avd" />
</Key> </Key>
</deviceKey> </deviceKey>
</Target> </Target>
</runningDeviceTargetSelectedWithDropDown> </targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-01-04T08:35:13.346382100Z" /> <timeTargetWasSelectedWithDropDown value="2023-01-05T21:09:25.014921200Z" />
</component> </component>
</project> </project>

View File

@ -11,6 +11,7 @@
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/Application" /> <option value="$PROJECT_DIR$/Application" />
<option value="$PROJECT_DIR$/OrbotLib" />
<option value="$PROJECT_DIR$/afservice" /> <option value="$PROJECT_DIR$/afservice" />
<option value="$PROJECT_DIR$/android-database-sqlcipher" /> <option value="$PROJECT_DIR$/android-database-sqlcipher" />
<option value="$PROJECT_DIR$/app" /> <option value="$PROJECT_DIR$/app" />
@ -26,6 +27,7 @@
<option value="$PROJECT_DIR$/orbotservicemanagers" /> <option value="$PROJECT_DIR$/orbotservicemanagers" />
<option value="$PROJECT_DIR$/service-telemetry" /> <option value="$PROJECT_DIR$/service-telemetry" />
<option value="$PROJECT_DIR$/shutterbug" /> <option value="$PROJECT_DIR$/shutterbug" />
<option value="$PROJECT_DIR$/tor-android" />
</set> </set>
</option> </option>
</GradleProjectSettings> </GradleProjectSettings>

View File

@ -1,3 +1,3 @@
#Wed Jan 04 13:50:34 PKT 2023 #Sat Jan 07 01:54:37 PKT 2023
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000= \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
json=1038193561 json=-1619911513

View File

@ -1,5 +1,5 @@
# #
#Wed Jan 04 13:50:34 PKT 2023 #Sat Jan 07 02:11:23 PKT 2023
\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000= \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000=
sdk_analysis_plugin_version=4.8.2 sdk_analysis_plugin_version=4.8.2
set_multidex=true set_multidex=true

BIN
OrbotLib/OrbotLib.aar Normal file

Binary file not shown.

2
OrbotLib/build.gradle Normal file
View File

@ -0,0 +1,2 @@
configurations.maybeCreate("default")
artifacts.add("default",file('OrbotLib.aar'))

View File

@ -0,0 +1 @@
o/jetified-OrbotLib-runtime.jar

View File

@ -0,0 +1 @@
o/jetified-OrbotLib.aar

View File

@ -0,0 +1 @@
o/go.IPtProxy.gojni

View File

@ -0,0 +1 @@
o/jetified-OrbotLib-runtime

View File

@ -0,0 +1 @@
i/AndroidManifest.xml

View File

@ -0,0 +1 @@
o/go.IPtProxy.gojni-r.txt

View File

@ -0,0 +1 @@
i/jars/classes.jar

View File

@ -0,0 +1 @@
o/jetified-OrbotLib

View File

@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="go.IPtProxy.gojni">
<uses-sdk android:minSdkVersion="16"/></manifest>

View File

@ -0,0 +1,2 @@
-keep class go.** { *; }
-keep class IPtProxy.** { *; }

View File

@ -0,0 +1 @@
o/jetified-OrbotLib-runtime

View File

@ -0,0 +1 @@
o/jetified-OrbotLib-api.jar

View File

@ -92,11 +92,12 @@ dependencies {
/* Firefox ABI Splits */ /* Firefox ABI Splits */
implementation "org.mozilla.components:browser-engine-gecko:100.0.20220327143103" implementation "org.mozilla.components:browser-engine-gecko:108.2.0"
implementation "org.mozilla.components:browser-icons:100.0.20220327143103" implementation "org.mozilla.components:browser-icons:108.2.0"
implementation "org.mozilla.components:concept-fetch:100.0.20220327143103" implementation "org.mozilla.components:concept-fetch:108.2.0"
implementation "org.mozilla.components:concept-base:100.0.20220327143103" implementation "org.mozilla.components:concept-base:108.2.0"
implementation "org.mozilla.components:support-utils:100.0.20220327143103" implementation "org.mozilla.components:support-utils:108.2.0"
/* Analytics */ /* Analytics */

View File

@ -10,6 +10,7 @@ prefs:
# network.proxy.socks_port: 9050 # network.proxy.socks_port: 9050
network.proxy.socks_version: 5 network.proxy.socks_version: 5
network.proxy.socks_remote_dns: true network.proxy.socks_remote_dns: true
permissions.webRequestBlocking: 1
permissions.default.image: 2 permissions.default.image: 2
browser.display.show_image_placeholders: true browser.display.show_image_placeholders: true
browser.cache.disk.enable: false browser.cache.disk.enable: false

View File

@ -11,6 +11,7 @@ prefs:
network.proxy.socks_version: 5 network.proxy.socks_version: 5
network.proxy.socks_remote_dns: true network.proxy.socks_remote_dns: true
permissions.default.image: 1 permissions.default.image: 1
permissions.webRequestBlocking: 1
browser.display.show_image_placeholders: true browser.display.show_image_placeholders: true
browser.cache.disk.enable: false browser.cache.disk.enable: false
browser.cache.memory.enable: true browser.cache.memory.enable: true

View File

@ -40,6 +40,7 @@ import android.view.DisplayCutout;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.Surface; import android.view.Surface;
import android.view.SurfaceControl;
import android.view.SurfaceView; import android.view.SurfaceView;
import android.view.TextureView; import android.view.TextureView;
import android.view.View; import android.view.View;
@ -99,8 +100,8 @@ public class extendedGeckoView extends GeckoView {
onGlobalLayout(); onGlobalLayout();
if (extendedGeckoView.this.mSurfaceWrapper != null) { if (extendedGeckoView.this.mSurfaceWrapper != null) {
final SurfaceViewWrapper wrapper = extendedGeckoView.this.mSurfaceWrapper; final SurfaceViewWrapper wrapper = extendedGeckoView.this.mSurfaceWrapper;
mDisplay.surfaceChanged(wrapper.getSurface(),
wrapper.getWidth(), wrapper.getHeight()); mDisplay.surfaceChanged(new GeckoDisplay.SurfaceInfo.Builder(wrapper.getSurface()).build());
mDisplay.setDynamicToolbarMaxHeight(mDynamicToolbarMaxHeight); mDisplay.setDynamicToolbarMaxHeight(mDynamicToolbarMaxHeight);
extendedGeckoView.this.setActive(true); extendedGeckoView.this.setActive(true);
} }
@ -119,17 +120,18 @@ public class extendedGeckoView extends GeckoView {
return display; return display;
} }
@Override // SurfaceListener
public void onSurfaceChanged(final Surface surface, @Override
final int width, final int height) { public void onSurfaceChanged(Surface surface, SurfaceControl surfaceControl, int width, int height) {
if (mDisplay != null) { if (mDisplay != null) {
mDisplay.surfaceChanged(surface, width, height); mDisplay.surfaceChanged(new GeckoDisplay.SurfaceInfo.Builder(surface).build());
mDisplay.setDynamicToolbarMaxHeight(mDynamicToolbarMaxHeight); mDisplay.setDynamicToolbarMaxHeight(mDynamicToolbarMaxHeight);
if (!mValid) { if (!mValid) {
extendedGeckoView.this.setActive(true); extendedGeckoView.this.setActive(true);
} }
} }
mValid = true; mValid = true;
} }
@Override // SurfaceListener @Override // SurfaceListener
@ -731,7 +733,7 @@ public class extendedGeckoView extends GeckoView {
strValues.put(values.keyAt(i), value.getTextValue()); strValues.put(values.keyAt(i), value.getTextValue());
} }
} }
mSession.autofill(strValues); mSession.getAutofillSession().autofill(strValues);
} }
/** /**
@ -797,43 +799,35 @@ public class extendedGeckoView extends GeckoView {
} }
@Override @Override
public void onAutofill(@NonNull final GeckoSession session, public void onNodeUpdate(
final int notification, @NonNull final GeckoSession session,
final Autofill.Node node) { @NonNull final Autofill.Node node,
ThreadUtils.assertOnUiThread(); @NonNull final Autofill.NodeData data) {
if (Build.VERSION.SDK_INT < 26) {
return;
}
final AutofillManager manager = final AutofillManager manager;
extendedGeckoView.this.getContext().getSystemService(AutofillManager.class); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
manager = extendedGeckoView.this.getContext().getSystemService(AutofillManager.class);
if (manager == null) { if (manager == null) {
return; return;
} }
manager.notifyViewEntered(extendedGeckoView.this, data.getId(),displayRectForId(session, node));
}
switch (notification) { }
case Autofill.Notify.SESSION_STARTED:
// This line seems necessary for auto-fill to work on the initial page. @Override
case Autofill.Notify.SESSION_CANCELED: public void onNodeFocus(
manager.cancel(); @NonNull final GeckoSession session,
break; @NonNull final Autofill.Node node,
case Autofill.Notify.SESSION_COMMITTED: @NonNull final Autofill.NodeData data) {
manager.commit();
break; final AutofillManager manager;
case Autofill.Notify.NODE_FOCUSED: if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
manager.notifyViewEntered( manager = extendedGeckoView.this.getContext().getSystemService(AutofillManager.class);
extendedGeckoView.this, node.getId(), if (manager == null) {
displayRectForId(session, node)); return;
break; }
case Autofill.Notify.NODE_BLURRED: manager.notifyViewEntered(extendedGeckoView.this, data.getId(),displayRectForId(session, node));
manager.notifyViewExited(extendedGeckoView.this, node.getId());
break;
case Autofill.Notify.NODE_UPDATED:
manager.notifyValueChanged(
extendedGeckoView.this,
node.getId(),
AutofillValue.forText(node.getValue()));
break;
} }
} }
} }

View File

@ -1,10 +1,16 @@
package com.hiddenservices.onionservices.appManager.homeManager.geckoManager; package com.hiddenservices.onionservices.appManager.homeManager.geckoManager;
import static android.content.Context.ACTIVITY_SERVICE;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Debug;
import android.os.Environment;
import android.os.Handler; import android.os.Handler;
import android.os.StatFs;
import android.util.Log; import android.util.Log;
import android.widget.ImageView; import android.widget.ImageView;
@ -21,10 +27,16 @@ import com.hiddenservices.onionservices.dataManager.dataEnums;
import com.hiddenservices.onionservices.eventObserver; import com.hiddenservices.onionservices.eventObserver;
import com.hiddenservices.onionservices.helperManager.helperMethod; import com.hiddenservices.onionservices.helperManager.helperMethod;
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -46,12 +58,14 @@ import static org.mozilla.geckoview.StorageController.ClearFlags.SITE_SETTINGS;
import org.json.JSONObject; import org.json.JSONObject;
import org.mozilla.gecko.EventDispatcher; import org.mozilla.gecko.EventDispatcher;
import org.mozilla.gecko.util.DebugConfig;
import org.mozilla.gecko.util.GeckoBundle; import org.mozilla.gecko.util.GeckoBundle;
import org.mozilla.geckoview.ContentBlocking; import org.mozilla.geckoview.ContentBlocking;
import org.mozilla.geckoview.GeckoResult; import org.mozilla.geckoview.GeckoResult;
import org.mozilla.geckoview.GeckoRuntime; import org.mozilla.geckoview.GeckoRuntime;
import org.mozilla.geckoview.GeckoRuntimeSettings; import org.mozilla.geckoview.GeckoRuntimeSettings;
import org.mozilla.geckoview.GeckoView; import org.mozilla.geckoview.GeckoView;
import org.mozilla.geckoview.RuntimeSettings;
import org.mozilla.geckoview.WebExtension; import org.mozilla.geckoview.WebExtension;
import org.mozilla.geckoview.WebResponse; import org.mozilla.geckoview.WebResponse;
import org.torproject.android.service.wrapper.orbotLocalConstants; import org.torproject.android.service.wrapper.orbotLocalConstants;
@ -178,7 +192,9 @@ public class geckoClients {
public String getAssetsCacheFile(Context context, String fileName) { public String getAssetsCacheFile(Context context, String fileName) {
File cacheFile = new File(context.getCacheDir(), fileName);
File cacheFile = null;
cacheFile = new File(context.getExternalCacheDir(), fileName + helperMethod.createRandomID());
try { try {
try (InputStream inputStream = context.getAssets().open(fileName)) { try (InputStream inputStream = context.getAssets().open(fileName)) {
try (FileOutputStream outputStream = new FileOutputStream(cacheFile)) { try (FileOutputStream outputStream = new FileOutputStream(cacheFile)) {
@ -194,6 +210,7 @@ public class geckoClients {
} }
String mYAML = helperMethod.readFromFile(cacheFile.getPath()); String mYAML = helperMethod.readFromFile(cacheFile.getPath());
try {
if (status.sTorBrowsing) { if (status.sTorBrowsing) {
mYAML = mYAML.replace("# network.proxy.socks: \"127.0.0.1\"", "network.proxy.socks: \"127.0.0.1\""); mYAML = mYAML.replace("# network.proxy.socks: \"127.0.0.1\"", "network.proxy.socks: \"127.0.0.1\"");
mYAML = mYAML.replace("# network.proxy.socks_port: 9050", "network.proxy.socks_port: 9050"); mYAML = mYAML.replace("# network.proxy.socks_port: 9050", "network.proxy.socks_port: 9050");
@ -208,6 +225,9 @@ public class geckoClients {
mYAML = mYAML.replace("browser.cache.memory.enable: true", "browser.cache.memory.enable: false"); mYAML = mYAML.replace("browser.cache.memory.enable: true", "browser.cache.memory.enable: false");
helperMethod.writeToFile(cacheFile.getPath(), mYAML); helperMethod.writeToFile(cacheFile.getPath(), mYAML);
} }
}catch (Exception ex){
Log.i("ads","dsadas");
}
return cacheFile.getAbsolutePath(); return cacheFile.getAbsolutePath();
} }
@ -333,8 +353,37 @@ public class geckoClients {
} }
} }
public String getFileContent( FileInputStream fis ) throws IOException {
StringBuilder sb = new StringBuilder();
Reader r = new InputStreamReader(fis, "UTF-8"); //or whatever encoding
int ch = r.read();
while(ch >= 0) {
sb.append(ch);
ch = r.read();
}
return sb.toString();
}
public void getAvailableSpaceInBytes(AppCompatActivity context) {
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) context.getSystemService(ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long availableMegs = mi.availMem / 1048576L;
try {
//File cacheFile = new File(context.getDataDir(), "lib/x86/libxul.so");
//final FileInputStream fileInputStream = new FileInputStream(cacheFile);
//getFileContent(fileInputStream);
} catch (Exception ex) {
Log.i("","");
}
}
@SuppressLint("WrongConstant") @SuppressLint("WrongConstant")
public void initRuntimeSettings(AppCompatActivity context) { public void initRuntimeSettings(AppCompatActivity context) {
if (mRuntime == null) { if (mRuntime == null) {
GeckoRuntimeSettings.Builder mSettings = new GeckoRuntimeSettings.Builder(); GeckoRuntimeSettings.Builder mSettings = new GeckoRuntimeSettings.Builder();
if (status.sShowImages == 2) { if (status.sShowImages == 2) {
@ -342,9 +391,9 @@ public class geckoClients {
} else { } else {
mSettings.configFilePath(getAssetsCacheFile(context, "geckoview-config.yaml")); mSettings.configFilePath(getAssetsCacheFile(context, "geckoview-config.yaml"));
} }
mSettings.build(); getAvailableSpaceInBytes(context);
GeckoRuntimeSettings xx = mSettings.build();
mRuntime = GeckoRuntime.create(context, mSettings.build()); mRuntime = GeckoRuntime.create(context, xx);
mRuntime.getSettings().setRemoteDebuggingEnabled(true); mRuntime.getSettings().setRemoteDebuggingEnabled(true);
mCreated = true; mCreated = true;

View File

@ -413,47 +413,39 @@ geckoSession extends GeckoSession implements MediaSession.Delegate, GeckoSession
} }
@Override @Override
public void onAutofill(@NonNull final GeckoSession session, public void onNodeUpdate(
final int notification, @NonNull final GeckoSession session,
final Autofill.Node node) { @NonNull final Autofill.Node node,
ThreadUtils.assertOnUiThread(); @NonNull final Autofill.NodeData data) {
if (Build.VERSION.SDK_INT < 26) {
return;
}
final AutofillManager manager = final AutofillManager manager;
mContext.get().getApplicationContext().getSystemService(AutofillManager.class); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
manager = mGeckoView.getContext().getSystemService(AutofillManager.class);
if (manager == null) { if (manager == null) {
return; return;
} }
manager.notifyViewEntered(mGeckoView, data.getId(),displayRectForId(session, node));
}
switch (notification) { }
case Autofill.Notify.SESSION_STARTED:
case Autofill.Notify.SESSION_CANCELED: @Override
manager.cancel(); public void onNodeFocus(
break; @NonNull final GeckoSession session,
case Autofill.Notify.SESSION_COMMITTED: @NonNull final Autofill.Node node,
manager.commit(); @NonNull final Autofill.NodeData data) {
break;
case Autofill.Notify.NODE_FOCUSED: final AutofillManager manager;
manager.notifyViewEntered( if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
mGeckoView, node.getId(), manager = mGeckoView.getContext().getSystemService(AutofillManager.class);
displayRectForId(session, node)); if (manager == null) {
break; return;
case Autofill.Notify.NODE_BLURRED: }
manager.notifyViewExited(mGeckoView, node.getId()); manager.notifyViewEntered(mGeckoView, data.getId(),displayRectForId(session, node));
break;
case Autofill.Notify.NODE_UPDATED:
manager.notifyValueChanged(
mGeckoView,
node.getId(),
AutofillValue.forText(node.getValue()));
break;
case Autofill.Notify.NODE_ADDED:
case Autofill.Notify.NODE_REMOVED:
break;
} }
} }
} }
/*Progress Delegate*/ /*Progress Delegate*/

View File

@ -108,6 +108,9 @@ import org.torproject.android.service.util.Prefs;
import org.torproject.android.service.wrapper.LocaleHelper; import org.torproject.android.service.wrapper.LocaleHelper;
import org.torproject.android.service.wrapper.orbotLocalConstants; import org.torproject.android.service.wrapper.orbotLocalConstants;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
@ -235,7 +238,6 @@ public class homeController extends AppCompatActivity implements ComponentCallba
onInitBooleans(); onInitBooleans();
orbotLocalConstants.mHomeIntent = getIntent(); orbotLocalConstants.mHomeIntent = getIntent();
getWindow().getDecorView().setBackgroundColor(Color.WHITE); getWindow().getDecorView().setBackgroundColor(Color.WHITE);
pluginController.getInstance().preInitialize(this); pluginController.getInstance().preInitialize(this);
dataController.getInstance().initialize(this); dataController.getInstance().initialize(this);
@ -910,11 +912,11 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if (SDK_INT >= Build.VERSION_CODES.O) if (SDK_INT >= Build.VERSION_CODES.O)
{ {
//String channelId = "default_home_notification"; String channelId = "default_home_notification";
//NotificationChannel channel = new NotificationChannel(channelId, "default_home_notification", NotificationManager.IMPORTANCE_DEFAULT); NotificationChannel channel = new NotificationChannel(channelId, "default_home_notification", NotificationManager.IMPORTANCE_DEFAULT);
//channel.setSound(null, null); channel.setSound(null, null);
//manager.createNotificationChannel(channel); manager.createNotificationChannel(channel);
//builder.setChannelId(channelId); builder.setChannelId(channelId);
} }
Intent intentActionOpen = new Intent(context,homeController.class); Intent intentActionOpen = new Intent(context,homeController.class);
@ -2016,15 +2018,18 @@ public class homeController extends AppCompatActivity implements ComponentCallba
if (!status.sTorBrowsing) { if (!status.sTorBrowsing) {
mDelay = 0; mDelay = 0;
} }
new Handler().postDelayed(() ->
{
pluginController.getInstance().onOrbotInvoke(Arrays.asList(status.sBridgeCustomBridge, status.sBridgeGatewayManual, status.sBridgeCustomType, status.sBridgeStatus, status.sShowImages, status.sClearOnExit, dataController.getInstance().invokeBridges(dataEnums.eBridgeWebsiteCommands.M_FETCH, null)), pluginEnums.eOrbotManager.M_START_ORBOT); pluginController.getInstance().onOrbotInvoke(Arrays.asList(status.sBridgeCustomBridge, status.sBridgeGatewayManual, status.sBridgeCustomType, status.sBridgeStatus, status.sShowImages, status.sClearOnExit, dataController.getInstance().invokeBridges(dataEnums.eBridgeWebsiteCommands.M_FETCH, null)), pluginEnums.eOrbotManager.M_START_ORBOT);
onInvokeProxyLoading(); onInvokeProxyLoading();
onShowDefaultNotification(); onShowDefaultNotification();
}, mDelay); //new Handler().postDelayed(() ->
//{
//}, mDelay);
} }
public void onStartApplication(View view) { public void onStartApplication(View view) {
mGeckoClient.initRuntimeSettings(this);
onStartBrowser(); onStartBrowser();
int notificationStatus = status.sBridgeNotificationManual; int notificationStatus = status.sBridgeNotificationManual;
if (notificationStatus == 0) { if (notificationStatus == 0) {
@ -2041,6 +2046,7 @@ public class homeController extends AppCompatActivity implements ComponentCallba
public void onStartApplicationNoTor(View view) { public void onStartApplicationNoTor(View view) {
status.sTorBrowsing = false; status.sTorBrowsing = false;
status.sNoTorTriggered = true; status.sNoTorTriggered = true;
mGeckoClient.initRuntimeSettings(this);
if(status.sSettingDefaultSearchEngine.equals(constants.CONST_BACKEND_GENESIS_URL)){ if(status.sSettingDefaultSearchEngine.equals(constants.CONST_BACKEND_GENESIS_URL)){
status.sSettingDefaultSearchEngine = constants.CONST_BACKEND_DUCK_DUCK_GO_URL; status.sSettingDefaultSearchEngine = constants.CONST_BACKEND_DUCK_DUCK_GO_URL;
} }

View File

@ -168,7 +168,6 @@ class homeViewController {
this.mPanicButton = pPanicButton; this.mPanicButton = pPanicButton;
this.mGenesisLogo = pGenesisLogo; this.mGenesisLogo = pGenesisLogo;
this.mPanicButtonLandscape = pPanicButtonLandscape; this.mPanicButtonLandscape = pPanicButtonLandscape;
this.mLogHandler = new LogHandler();
this.mTorDisabled = pTorDisabled; this.mTorDisabled = pTorDisabled;
initSplashScreen(); initSplashScreen();
@ -633,11 +632,9 @@ class homeViewController {
} }
} }
private LogHandler mLogHandler; public void LogHandler() {
new Thread(){
@SuppressLint("StaticFieldLeak") public void run(){
class LogHandler extends AsyncTask<Void, Integer, Void> {
protected Void doInBackground(Void... arg0) {
AppCompatActivity temp_context = mContext; AppCompatActivity temp_context = mContext;
int mCounter = 0; int mCounter = 0;
while (status.sTorBrowsing && (orbotLocalConstants.mSOCKSPort == -1 || !orbotLocalConstants.mIsTorInitialized || !orbotLocalConstants.mNetworkState)) { while (status.sTorBrowsing && (orbotLocalConstants.mSOCKSPort == -1 || !orbotLocalConstants.mIsTorInitialized || !orbotLocalConstants.mNetworkState)) {
@ -650,7 +647,7 @@ class homeViewController {
mEvent.invokeObserver(Collections.singletonList(status.sSettingDefaultSearchEngine), enums.etype.recheck_orbot); mEvent.invokeObserver(Collections.singletonList(status.sSettingDefaultSearchEngine), enums.etype.recheck_orbot);
startPostTask(messages.MESSAGE_UPDATE_LOADING_TEXT); startPostTask(messages.MESSAGE_UPDATE_LOADING_TEXT);
if (orbotLocalConstants.mSOCKSPort != -1) { if (orbotLocalConstants.mSOCKSPort != -1) {
break; //break;
} }
} else { } else {
orbotLocalConstants.mTorLogsStatus = "No internet connection"; orbotLocalConstants.mTorLogsStatus = "No internet connection";
@ -658,7 +655,6 @@ class homeViewController {
} }
} }
sleep(500);
if (mCounter > 20 && orbotLocalConstants.mSOCKSPort != -1) { if (mCounter > 20 && orbotLocalConstants.mSOCKSPort != -1) {
break; break;
} else if (orbotLocalConstants.mNetworkState && status.sBridgeStatus) { } else if (orbotLocalConstants.mNetworkState && status.sBridgeStatus) {
@ -670,31 +666,29 @@ class homeViewController {
mEvent.invokeObserver(Collections.singletonList(status.sSettingDefaultSearchEngine), enums.etype.recheck_orbot); mEvent.invokeObserver(Collections.singletonList(status.sSettingDefaultSearchEngine), enums.etype.recheck_orbot);
if (temp_context.isDestroyed()) { if (temp_context.isDestroyed()) {
return null; return;
} }
startPostTask(messages.MESSAGE_UPDATE_LOADING_TEXT); startPostTask(messages.MESSAGE_UPDATE_LOADING_TEXT);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
mContext.runOnUiThread(() -> {
mEvent.invokeObserver(null, enums.etype.M_INIT_RUNTIME_SETTINGS);
});
if (!status.sSettingIsAppStarted) { if (!status.sSettingIsAppStarted) {
mContext.runOnUiThread(() -> { mContext.runOnUiThread(() -> {
onDisableSplashScreen(); onDisableSplashScreen();
}); mEvent.invokeObserver(null, enums.etype.M_INIT_RUNTIME_SETTINGS);
startPostTask(messages.MESSAGE_ON_URL_LOAD); startPostTask(messages.MESSAGE_ON_URL_LOAD);
});
} else { } else {
mContext.runOnUiThread(() -> { mContext.runOnUiThread(() -> {
mEvent.invokeObserver(null, enums.etype.M_INIT_RUNTIME_SETTINGS);
mEvent.invokeObserver(null, enums.etype.ON_LOAD_TAB_ON_RESUME); mEvent.invokeObserver(null, enums.etype.ON_LOAD_TAB_ON_RESUME);
}); });
} }
return null;
} }
}.start();
} }
boolean mLogServiceExecuted = false; boolean mLogServiceExecuted = false;
void initProxyLoading(Callable<String> logs) { void initProxyLoading(Callable<String> logs) {
@ -703,9 +697,7 @@ class homeViewController {
if (mSplashScreen.getVisibility() == View.VISIBLE) { if (mSplashScreen.getVisibility() == View.VISIBLE) {
if (!mLogServiceExecuted) { if (!mLogServiceExecuted) {
mLogServiceExecuted = true; mLogServiceExecuted = true;
if (this.mLogHandler.getStatus() != AsyncTask.Status.RUNNING) { LogHandler();
this.mLogHandler.execute();
}
} }
} }
} }
@ -1082,7 +1074,6 @@ class homeViewController {
url = CONST_GENESIS_DOMAIN_URL; url = CONST_GENESIS_DOMAIN_URL;
} }
Log.i("FUCK::5", url);
if (!mSearchbar.hasFocus() || pClearText || pBypassFocus) { if (!mSearchbar.hasFocus() || pClearText || pBypassFocus) {
if (mSearchEngineBar.getVisibility() == View.GONE || pBypassFocus) { if (mSearchEngineBar.getVisibility() == View.GONE || pBypassFocus) {
int delay = 0; int delay = 0;

View File

@ -29,6 +29,7 @@ import android.graphics.drawable.TransitionDrawable;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.os.StatFs;
import android.os.Vibrator; import android.os.Vibrator;
import android.text.SpannableString; import android.text.SpannableString;
import android.text.Spanned; import android.text.Spanned;
@ -261,6 +262,7 @@ public class helperMethod {
writer.write(content); writer.write(content);
writer.close(); writer.close();
} catch (Exception ex) { } catch (Exception ex) {
Log.i("","");
} }
} }
@ -308,6 +310,11 @@ public class helperMethod {
return false; return false;
} }
public static int getFreeSpace(String pPath, Context pContext) {
StatFs stat = new StatFs(pPath);
return (int) stat.getAvailableBlocksLong();
}
public static String completeURL(String pURL) { public static String completeURL(String pURL) {
if (pURL.equals("about:blank") || pURL.equals("about:config") || pURL.startsWith("resource://")) { if (pURL.equals("about:blank") || pURL.equals("about:config") || pURL.startsWith("resource://")) {
return pURL; return pURL;

View File

@ -1,9 +1,6 @@
package com.hiddenservices.onionservices.pluginManager.adPluginManager; package com.hiddenservices.onionservices.pluginManager.adPluginManager;
import static android.content.Intent.FLAG_ACTIVITY_NO_ANIMATION;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.os.Handler; import android.os.Handler;
import android.util.Log; import android.util.Log;
import com.applovin.mediation.MaxAd; import com.applovin.mediation.MaxAd;
@ -11,20 +8,12 @@ import com.applovin.mediation.MaxAdViewAdListener;
import com.applovin.mediation.MaxError; import com.applovin.mediation.MaxError;
import com.applovin.mediation.ads.MaxAdView; import com.applovin.mediation.ads.MaxAdView;
import com.applovin.sdk.AppLovinSdk; import com.applovin.sdk.AppLovinSdk;
import com.applovin.sdk.AppLovinSdkConfiguration;
import com.example.myapplication.R;
import com.facebook.ads.AdSettings;
import com.hiddenservices.onionservices.appManager.activityContextManager;
import com.hiddenservices.onionservices.appManager.advertManager.advertController;
import com.hiddenservices.onionservices.constants.keys;
import com.hiddenservices.onionservices.constants.status; import com.hiddenservices.onionservices.constants.status;
import com.hiddenservices.onionservices.eventObserver; import com.hiddenservices.onionservices.eventObserver;
import com.hiddenservices.onionservices.pluginManager.pluginEnums; import com.hiddenservices.onionservices.pluginManager.pluginEnums;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eAdManagerCallbacks.M_ON_AD_LOAD; import static com.hiddenservices.onionservices.pluginManager.pluginEnums.eAdManagerCallbacks.M_ON_AD_LOAD;
import androidx.appcompat.app.AppCompatActivity;
public class appLovinManager implements MaxAdViewAdListener { public class appLovinManager implements MaxAdViewAdListener {
/*Private Variables */ /*Private Variables */
@ -47,7 +36,7 @@ public class appLovinManager implements MaxAdViewAdListener {
private void initializeBannerAds(Context pContext) { private void initializeBannerAds(Context pContext) {
AppLovinSdk.getInstance(pContext).setMediationProvider("max"); AppLovinSdk.getInstance(pContext).setMediationProvider("max");
AppLovinSdk.initializeSdk(pContext,(AppLovinSdk.SdkInitializationListener) configuration -> { AppLovinSdk.initializeSdk(pContext, configuration -> {
mBannerAds.get().loadAd(); mBannerAds.get().loadAd();
}); });
} }

View File

@ -822,6 +822,11 @@ public class messageManager implements View.OnClickListener, DialogInterface.OnD
onUpdateBridges(); onUpdateBridges();
break; break;
case M_LOW_MEMORY:
/*VERIFIED*/
onShowToast(R.layout.popup_toast_generic, R.xml.ax_background_important, 5000, "Low memory, some settings might not work", mContext.getString(R.string.ALERT_DISMISS), null);
break;
case M_NEW_IDENTITY: case M_NEW_IDENTITY:
/*VERIFIED*/ /*VERIFIED*/
onShowToast(R.layout.popup_toast_generic, R.xml.ax_background_important, 2000, mContext.getString(R.string.TOAST_ALERT_NEW_CIRCUIT_CREATED), mContext.getString(R.string.ALERT_DISMISS), null); onShowToast(R.layout.popup_toast_generic, R.xml.ax_background_important, 2000, mContext.getString(R.string.TOAST_ALERT_NEW_CIRCUIT_CREATED), mContext.getString(R.string.ALERT_DISMISS), null);

View File

@ -1,5 +1,6 @@
package com.hiddenservices.onionservices.pluginManager.orbotPluginManager; package com.hiddenservices.onionservices.pluginManager.orbotPluginManager;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
@ -7,6 +8,7 @@ import androidx.appcompat.app.AppCompatActivity;
import org.torproject.android.service.OrbotService; import org.torproject.android.service.OrbotService;
import org.torproject.android.service.util.Prefs; import org.torproject.android.service.util.Prefs;
import org.torproject.android.service.util.Utils;
import org.torproject.android.service.wrapper.orbotLocalConstants; import org.torproject.android.service.wrapper.orbotLocalConstants;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
@ -14,6 +16,7 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import com.hiddenservices.onionservices.constants.constants; import com.hiddenservices.onionservices.constants.constants;
import com.hiddenservices.onionservices.constants.enums;
import com.hiddenservices.onionservices.constants.keys; import com.hiddenservices.onionservices.constants.keys;
import com.hiddenservices.onionservices.constants.status; import com.hiddenservices.onionservices.constants.status;
import com.hiddenservices.onionservices.eventObserver; import com.hiddenservices.onionservices.eventObserver;
@ -47,14 +50,11 @@ public class orbotManager {
this.mLogManger = new orbotLogManager(); this.mLogManger = new orbotLogManager();
orbotLocalConstants.mNotificationStatus = pNotificationStatus; orbotLocalConstants.mNotificationStatus = pNotificationStatus;
orbotLocalConstants.mSOCKSPort = checkPortOrAutoManual(mAppContext.get());
} }
private void onInitlizeOrbot(String pBridgeCustomBridge, boolean pBridgeGatewayManual, String pBridgeCustomType, boolean pBridgeStatus, String pBridgesDefault) { private void onInitlizeOrbot(String pBridgeCustomBridge, boolean pBridgeGatewayManual, String pBridgeCustomType, boolean pBridgeStatus, String pBridgesDefault) {
if (helperMethod.availablePort(9050)) {
orbotLocalConstants.mSOCKSPort = 9050;
}
orbotLocalConstants.mBridges = pBridgeCustomBridge; orbotLocalConstants.mBridges = pBridgeCustomBridge;
orbotLocalConstants.mIsManualBridge = pBridgeGatewayManual; orbotLocalConstants.mIsManualBridge = pBridgeGatewayManual;
orbotLocalConstants.mManualBridgeType = pBridgeCustomType; orbotLocalConstants.mManualBridgeType = pBridgeCustomType;
@ -64,14 +64,42 @@ public class orbotManager {
onInitailizeService(); onInitailizeService();
} }
public int checkPortOrAutoManual(Context context) {
SharedPreferences prefs = Prefs.getSharedPrefs(context.getApplicationContext());
String portString = prefs.getString("pref_transport", 9050 + "");
if (!portString.equalsIgnoreCase("auto")) {
boolean isPortUsed = true;
int port = Integer.parseInt(portString);
while (isPortUsed) {
isPortUsed = Utils.isPortOpen("127.0.0.1", port, 500);
if (isPortUsed) //the specified port is not available, so let Tor find one instead
port++;
}
return port;
}
return 9050;
}
private void onInitailizeService() { private void onInitailizeService() {
if (status.sTorBrowsing) { if (status.sTorBrowsing) {
orbotLocalConstants.mIsTorInitialized = true;
new Thread(){
public void run(){
mAppContext.get().runOnUiThread(() -> {
Intent startTorIntent = new Intent(mAppContext.get(), OrbotService.class); Intent startTorIntent = new Intent(mAppContext.get(), OrbotService.class);
startTorIntent.setAction(ACTION_START); startTorIntent.setAction(ACTION_START);
if (mAppContext.get().getPackageName() != null) { if (mAppContext.get().getPackageName() != null) {
startTorIntent.putExtra(OrbotService.EXTRA_PACKAGE_NAME, mAppContext.get().getPackageName()); startTorIntent.putExtra(OrbotService.EXTRA_PACKAGE_NAME, mAppContext.get().getPackageName());
} }
mAppContext.get().startService(startTorIntent); mAppContext.get().startService(startTorIntent);
});
}
}.start();
SharedPreferences settings = mAppContext.get().getSharedPreferences("se", MODE_PRIVATE); SharedPreferences settings = mAppContext.get().getSharedPreferences("se", MODE_PRIVATE);
SharedPreferences.Editor editor = settings.edit(); SharedPreferences.Editor editor = settings.edit();
@ -82,7 +110,7 @@ public class orbotManager {
editor.putBoolean(keys.PROXY_SOCKS_REMOTE_DNS, constants.CONST_PROXY_SOCKS_REMOTE_DNS); editor.putBoolean(keys.PROXY_SOCKS_REMOTE_DNS, constants.CONST_PROXY_SOCKS_REMOTE_DNS);
editor.apply(); editor.apply();
} else { } else {
orbotLocalConstants.mIsTorInitialized = true; //orbotLocalConstants.mIsTorInitialized = true;
} }
} }

View File

@ -26,7 +26,7 @@ public class pluginEnums {
/*Message Manager*/ /*Message Manager*/
public enum eMessageManager { public enum eMessageManager {
M_RESET, M_DATA_CLEARED, M_COPY, M_APPLICATION_CRASH, M_DELETE_BOOKMARK, M_UPDATE_BOOKMARK, M_IMAGE_UPDATE, M_OPEN_ACTIVITY_FAILED, M_OPEN_CICADA, M_TOR_SWITCH, M_SECURE_CONNECTION, M_SECURITY_INFO, M_POPUP_BLOCKED, M_PANIC, M_MAX_TAB_REACHED, M_ORBOT_LOADING, M_GENESIS_SEARCH_DISABLED, M_LOAD_NEW_TAB, M_UNDO, M_DOWNLOAD_SINGLE, M_UPDATE_BRIDGES, M_NEW_IDENTITY, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FAILURE, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_PANIC_RESET, M_DEFAULT_BROWSER, M_TOR_SWITCH_RESTART, M_RATE_SUCCESS, M_RATE_FAILURE, M_CLOSE, M_LANGUAGE_SUPPORT_FAILURE, M_WELCOME M_RESET, M_DATA_CLEARED, M_COPY, M_APPLICATION_CRASH, M_DELETE_BOOKMARK, M_UPDATE_BOOKMARK, M_IMAGE_UPDATE, M_OPEN_ACTIVITY_FAILED, M_OPEN_CICADA, M_TOR_SWITCH, M_SECURE_CONNECTION, M_SECURITY_INFO, M_POPUP_BLOCKED, M_PANIC, M_MAX_TAB_REACHED, M_ORBOT_LOADING, M_GENESIS_SEARCH_DISABLED, M_LOAD_NEW_TAB, M_UNDO, M_DOWNLOAD_SINGLE, M_UPDATE_BRIDGES, M_LOW_MEMORY, M_NEW_IDENTITY, M_NOT_SUPPORTED, M_BRIDGE_MAIL, M_LONG_PRESS_WITH_LINK, M_LONG_PRESS_URL, M_LONG_PRESS_DOWNLOAD, M_START_ORBOT, M_DOWNLOAD_FAILURE, M_DOWNLOAD_FILE, M_RATE_APP, M_REPORT_URL, M_CLEAR_BOOKMARK, M_CLEAR_HISTORY, M_BOOKMARK, M_PANIC_RESET, M_DEFAULT_BROWSER, M_TOR_SWITCH_RESTART, M_RATE_SUCCESS, M_RATE_FAILURE, M_CLOSE, M_LANGUAGE_SUPPORT_FAILURE, M_WELCOME
} }
public enum eMessageManagerCallbacks { public enum eMessageManagerCallbacks {

View File

@ -30,9 +30,9 @@ project.ext.splitEnabled = true
/* Application Preferences */ /* Application Preferences */
project.ext.compile_sdk_version = 33 project.ext.compile_sdk_version = 33
project.ext.min_sdk_version = 21 project.ext.min_sdk_version = 21
project.ext.target_sdk_version = 31 project.ext.target_sdk_version = 33
project.ext.build_tool_version = '33' project.ext.build_tool_version = '33'
project.ext.ndk_version = '21.4.7075529' project.ext.ndk_version = '25.1.8937393'
project.ext.application_id = "com.hiddenservices.onionservices" project.ext.application_id = "com.hiddenservices.onionservices"
project.ext.debugSymbolLevel = 'FULL' project.ext.debugSymbolLevel = 'FULL'

6
libs/build-geoip-jar.sh Normal file
View File

@ -0,0 +1,6 @@
# assumes tor-android is in a directory next to orbot
mkdir assets
cp -a ../../tor-android/external/tor/src/config/geoip assets/
cp -a ../../tor-android/external/tor/src/config/geoip6 assets/
zip -o geoip.jar assets/geoip assets/geoip6
rm -rf assets

BIN
libs/geoip.jar Normal file

Binary file not shown.

View File

@ -3,7 +3,7 @@ apply from: "../commons.gradle"
apply from : '../dependencies.gradle' apply from : '../dependencies.gradle'
android { android {
ndkVersion '21.3.6528147' ndkVersion '25.1.8937393'
sourceSets { sourceSets {
main { main {
@ -12,8 +12,8 @@ android {
} }
defaultConfig { defaultConfig {
minSdkVersion 21 minSdkVersion 16
targetSdkVersion 32 targetSdkVersion 33
} }
buildTypes { buildTypes {
@ -24,7 +24,7 @@ android {
} }
packagingOptions { packagingOptions {
resources { resources {
excludes += ['META-INF/AL2.0'] excludes += ['META-INF/androidx.localbroadcastmanager_localbroadcastmanager.version']
} }
} }
@ -42,25 +42,19 @@ android {
} }
dependencies { dependencies {
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
implementation 'com.gitlab.guardianproject:jsocksandroid:1.0.4'
implementation 'com.jaredrummler:android-shell:1.0.0'
implementation 'androidx.core:core:1.9.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
testImplementation 'junit:junit:4.13.2'
implementation 'com.offbynull.portmapper:portmapper:2.0.5'
implementation 'info.guardianproject:geoip:20191217'
api 'info.guardianproject:jtorctl:0.4.5.7'
implementation 'info.guardianproject:tor-android:0.4.6.10'
implementation 'androidx.work:work-runtime-ktx:2.8.0-rc01'
api libs.guardian_jtorctl api libs.guardian_jtorctl
implementation( api project(':OrbotLib')
libs.ipt_proxy, api project(':tor-android')
)
// api libs.tor_android
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
implementation 'androidx.core:core:1.9.0'
implementation 'com.gitlab.guardianproject:jsocksandroid:1.0.4'
implementation 'com.offbynull.portmapper:portmapper:2.0.5'
implementation 'androidx.work:work-runtime-ktx:2.8.0-rc01'
implementation files('../libs/geoip.jar')
} }

View File

@ -760,7 +760,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
return null; return null;
} }
private String checkPortOrAuto(String portString) { public String checkPortOrAuto(String portString) {
if (!portString.equalsIgnoreCase("auto")) { if (!portString.equalsIgnoreCase("auto")) {
var isPortUsed = true; var isPortUsed = true;
var port = Integer.parseInt(portString); var port = Integer.parseInt(portString);
@ -949,6 +949,7 @@ public class OrbotService extends VpnService implements OrbotConstants {
initControlConnection(); initControlConnection();
orbotLocalConstants.mIsTorInitialized = true;
} }
}catch (Exception ex){} }catch (Exception ex){}
} }
@ -1029,7 +1030,6 @@ public class OrbotService extends VpnService implements OrbotConstants {
} }
sendCallbackPorts(mPortSOCKS, mPortHTTP, mPortDns, mPortTrans); sendCallbackPorts(mPortSOCKS, mPortHTTP, mPortDns, mPortTrans);
orbotLocalConstants.mIsTorInitialized = true;
} catch (IOException e) { } catch (IOException e) {
Log.i("sad","asd"); Log.i("sad","asd");
@ -1091,7 +1091,6 @@ public class OrbotService extends VpnService implements OrbotConstants {
mPrevLogs = logMessage; mPrevLogs = logMessage;
} }
if(logMessage.contains("Bootstrapped 100%")){ if(logMessage.contains("Bootstrapped 100%")){
orbotLocalConstants.mIsTorInitialized = true;
} }
mHandler.post(() -> { mHandler.post(() -> {
Intent intent = new Intent(LOCAL_ACTION_LOG); Intent intent = new Intent(LOCAL_ACTION_LOG);

View File

@ -14,3 +14,5 @@ include ':shutterbug'
include ':orbotmanager' include ':orbotmanager'
include ':android-database-sqlcipher' include ':android-database-sqlcipher'
include ':service-telemetry' include ':service-telemetry'
include ':OrbotLib'
include ':tor-android'

2
tor-android/build.gradle Normal file
View File

@ -0,0 +1,2 @@
configurations.maybeCreate("default")
artifacts.add("default",file('tor-android.aar'))

View File

@ -0,0 +1 @@
o/jetified-tor-android-runtime

View File

@ -0,0 +1 @@
o/jetified-tor-android-runtime.jar

View File

@ -0,0 +1 @@
o/jetified-tor-android-api.jar

View File

@ -0,0 +1 @@
o/org.torproject.jni

View File

@ -0,0 +1 @@
o/org.torproject.jni-r.txt

View File

@ -0,0 +1 @@
o/jetified-tor-android-runtime

View File

@ -0,0 +1 @@
o/jetified-tor-android

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.torproject.jni" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="33" />
<uses-permission android:name="android.permission.INTERNET" />
<application>
<service android:name="org.torproject.jni.TorService" />
</application>
</manifest>

View File

@ -0,0 +1,4 @@
aarFormatVersion=1.0
aarMetadataVersion=1.0
minCompileSdk=1
minAndroidGradlePluginVersion=1.0.0

View File

@ -0,0 +1 @@
o/jetified-tor-android.aar

View File

@ -0,0 +1 @@
i/AndroidManifest.xml

View File

@ -0,0 +1 @@
i/jars/classes.jar

View File

@ -0,0 +1 @@
i/META-INF/com/android/build/gradle/aar-metadata.properties

BIN
tor-android/tor-android.aar Normal file

Binary file not shown.