-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Your example app not loading the extension. #4
Comments
you should push the extension to /data/local/tmp/ |
sir i have copied the extension but it still i have extension in my assets folder and i copy the folder into /data/local/tmp/ublock/ here is my code that copy the folder.
|
you should modify the code to modify to load extension
'/data/local/tmp/ublock/'
…On Wed, 23 Aug 2023 at 23:48, iamz ***@***.***> wrote:
you should push the extension to /data/local/tmp/
sir i have copied the extension but it still
E/chromium: [ERROR:shell_extension_loader.cc(33)] Extension directory not
found: /data/local/tmp/ublock/
i have extension in my assets folder and i copy the folder into
/data/local/tmp/ublock/
here is my code that copy the data.
`public static void copyFolder(Context context, String folderName) {
// Get the asset manager
AssetManager assetManager = context.getAssets();
// Get the list of files and folders in the assets folder
String[] files = null;
try {
files = assetManager.list(folderName);
} catch (IOException e) {
Log.e("CopyAssetsFolder", "Failed to get asset file list.", e);
}
// Create the target folder
File targetFolder = new File(Environment.getExternalStorageDirectory() + "/data/local/tmp/" + folderName);
if (!targetFolder.exists()) {
targetFolder.mkdirs();
}
// Copy the files and folders to the target folder
for (String filename : files) {
InputStream in = null;
OutputStream out = null;
try {
String fullPath = folderName + "/" + filename;
if (assetManager.list(fullPath).length > 0) {
// It's a subfolder, so recursively call copyFolder
copyFolder(context, fullPath);
} else {
// It's a file, so copy it
in = assetManager.open(fullPath);
out = new FileOutputStream(targetFolder + "/" + filename);
// Copy the file
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = in.read(buffer)) != -1) {
out.write(buffer, 0, bytesRead);
}
}
} catch (IOException e) {
Log.e("CopyAssetsFolder", "Failed to copy file.", e);
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
// Ignore
}
}
if (out != null) {
try {
out.close();
} catch (IOException e) {
// Ignore
}
}
}
}
}`
—
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAITL57MB2C2EVDGBXU26VLXWYQ3BANCNFSM6AAAAAA3V62LDU>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Thanks
PGP Fingerprint: F7BA D6CE 6592 77C7 0D2E 3BD5 5479 A15E B305 B8FE
|
i have same issue
|
Please let me know if you have fixed the issue. could you plese provide your code.
|
i did the same but not working |
I will focus on this issue asap |
thank you so much sir. |
I successfully loaded uBlock Origin in crwebview. The problem lies in not fully copying the extension's contents, as folders starting with an underscore (_) are not included. Adding the following code to build.gradle addresses this issue:
However, uBlock Origin is still not functioning properly and is not blocking ads. |
Your example app not loading the extension.
Please create an example app that load an extension because you example extension that is skyblue is also not loading.
i have change only the path
mBrowserContext.loadExtension(getObbDir().getAbsolutePath());
I/.mask.crwebvie: Late-enabling -Xcheck:jni E/.mask.crwebvie: Unknown bits set in runtime_flags: 0x8000 I/Perf: Connecting to perf service. I/FeatureParser: can't find beryllium.xml in assets/device_features/,it may be in /system/etc/device_features W/.mask.crwebview: type=1400 audit(0.0:8976875): avc: denied { read } for name="u:object_r:vendor_displayfeature_prop:s0" dev="tmpfs" ino=14058 scontext=u:r:untrusted_app:s0:c175,c260,c512,c768 tcontext=u:object_r:vendor_displayfeature_prop:s0 tclass=file permissive=0 E/libc: Access denied finding property "ro.vendor.df.effect.conflict" W/Looper: Slow Looper main: Long Msg: seq=2 plan=01:33:47.261 late=2ms wall=1617ms running=1512ms runnable=19ms h=android.app.ActivityThread$H w=110 E/Perf: Fail to get file list io.mask.crwebview E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array D/ForceDarkHelper: updateByCheckExcludeList: pkg: io.mask.crwebview activity: io.mask.crwebview.AwShellActivity@1ebb27a I/chatty: uid=11199(io.mask.crwebview) identical 4 lines D/ForceDarkHelper: updateByCheckExcludeList: pkg: io.mask.crwebview activity: io.mask.crwebview.AwShellActivity@1ebb27a D/cr_BrowserStartup: [BrowserStartupControllerImpl.java:435] Initializing chromium process, singleProcess=true I/cr_LibraryLoader: Successfully loaded native library I/cr_CachingUmaRecorder: Flushed 4 samples from 4 histograms. W/chromium: [WARNING:resource_bundle_android.cc(77)] failed to load locale.pak W/chromium: [WARNING:aw_resource_bundle.cc(30)] Failed to load locale .pak from apk. E/chromium: [ERROR:rtl.cc(147)] Failed to set the ICU default locale to . Falling back to en-US. V/cr_ClankAccessibility: [BrowserAccessibilityState.java:249] Enabled accessibility services list updated. I/chromium: [INFO:shell_extension_system.cc(38)] ShellExtensionSystem ShellExtensionSystem /data/user/0/io.mask.crwebview/app_webview/Default E/chromium: [ERROR:simple_file_enumerator.cc(21)] opendir /data/user/0/io.mask.crwebview/cache/WebView/Default/HTTP Cache/Code Cache/js: No such file or directory (2) E/chromium: [ERROR:simple_index_file.cc(614)] Could not reconstruct index from disk I/chromium: [INFO:aw_browser_context.cc(551)] AwBrowserContext InitExtensionSystem extension_system_ 0x7a000366c0 D/ForceDarkHelper: updateByCheckExcludeList: pkg: io.mask.crwebview activity: io.mask.crwebview.AwShellActivity@1ebb27a I/chatty: uid=11199(io.mask.crwebview) identical 1 line D/ForceDarkHelper: updateByCheckExcludeList: pkg: io.mask.crwebview activity: io.mask.crwebview.AwShellActivity@1ebb27a W/chromium: [WARNING:shell_extension_loader.cc(51)] Warnings loading extension at /storage/emulated/0/Android/obb/io.mask.crwebview: W/chromium: [WARNING:shell_extension_loader.cc(54)] Unrecognized manifest key 'author'. W/chromium: [WARNING:shell_extension_loader.cc(54)] Unrecognized manifest key 'browser_action'. W/chromium: [WARNING:shell_extension_loader.cc(54)] Unrecognized manifest key 'commands'. W/chromium: [WARNING:shell_extension_loader.cc(54)] Unrecognized manifest key 'minimum_chrome_version'. W/chromium: [WARNING:shell_extension_loader.cc(54)] Unrecognized manifest key 'short_name'. W/chromium: [WARNING:shell_extension_loader.cc(54)] Unrecognized manifest key 'storage'. W/chromium: [WARNING:shell_extension_loader.cc(54)] Manifest version 2 is deprecated, and support will be removed in 2023. See https://developer.chrome.com/blog/mv2-transition/ for more details. W/chromium: [WARNING:shell_extension_loader.cc(54)] Permission 'contextMenus' is unknown or URL pattern is malformed. W/chromium: [WARNING:shell_extension_loader.cc(54)] Permission 'privacy' is unknown or URL pattern is malformed. W/chromium: [WARNING:shell_extension_loader.cc(54)] Permission 'tabs' is unknown or URL pattern is malformed. W/chromium: [WARNING:shell_extension_loader.cc(54)] Permission 'webNavigation' is unknown or URL pattern is malformed. I/chromium: [INFO:aw_content_browser_client.cc(351)] AwContentBrowserClient OnWebContentsCreated 0x7a001a0000 I/chromium: [INFO:shell_extension_host_delegate.cc(19)] ShellExtensionHostDelegate OnExtensionHostCreated I/chromium: [INFO:shell_extension_system.cc(175)] ExtensionService content_verifier return nullptr I/chromium: [INFO:aw_browser_context.cc(577)] AwBrowserContext LoadExtension /storage/emulated/0/Android/obb/io.mask.crwebview ID:pkdpohcofjjegcaecmjgacbcmjdlilfe I/chromium: [INFO:aw_content_browser_client.cc(351)] AwContentBrowserClient OnWebContentsCreated 0x7a001a0c00 W/chromium: [WARNING:resource_bundle.cc(1154)] locale resources are not loaded W/chromium: [WARNING:resource_bundle.cc(1154)] locale resources are not loaded
The text was updated successfully, but these errors were encountered: