unable to find main.dart and lib folder from imported flutter project - android-studio

hi there!
i backed up my flutter project folder due to some issues with my drive,
i fixed the issues
only for me to try importing the project and continuing my work
and it turns out i can't find my main.dart file along with my entire lib folder
the only recognizable thing left in the project seems to be the assets folder
help me, please
this has really pushed me way behind schedule
also I would be much grateful if i could get an app that decompiles flutter apks
as my code is still in debug mode and i have the apk file.
thanks
enter image description here

To get source code of your apk file(debug) :-
Step 1- download strings for Windows (in your case)
https://learn.microsoft.com/en-us/sysinternals/downloads/strings
Step 2-
Since kernel_blob.bin has all your app's source code,
Run this command,
strings /path/to/extracted/apk/assets/flutter_assets/kernel_blob.bin > extracted_code.dart
Here, replace, "path to extracted" to your own path.
Step 3
You’ll need to clean the extract_code file, and strings like “dart”, “import”, “void” and other keywords in ‘extracted_code.dart’, will help you find the code itself.(search for them to get your code)

Related

Phaser 3 - Images not showing

After searching for a bit and finding others having somewhat of the same problem, but no solution for me, I figured it was my turn to seek help.
I have npm along with parceljs setup for webserving (I'm new to these but I'm quite confident it's working as you can see some output in the image I've posted)
I have the typical problem of images not displaying.
Status code of the image is returning 304 OK, and is it normal to not see the the image listed in the directory under the 'Sources' tab in Developer tools?...
The issue is with the way you are loading the image urls as hard-coded strings, for example, you wrote this:
this.load.image('sz','./src/assets/gfx/sz0001.png`)
The way this is written, parcel doesn't know that this string is actually a reference to an image file, so it doesn't know to copy over the image into your output folder and ensure that the path ends up matching the actual output location.
The way parcel works, if you want to include an asset (like an image) into your bundle and reference it by URL in some other javascript context (like the this.load.image function), you should use an import statement or a URL constructor (see docs).
So you would instead write:
import myImageUrl from './src/assets/gfx/sz0001.png`;
// 'myImageUrl' will be a string that points to the location of the image
// This will also tell parcel that sz0001.png is a dependency of this project
// so that it can take care of copying it over to the dist output.
this.load.image('sz',myImageUrl)
Another tip is that the template you referenced uses parcel-bundler which the old, unmaintained 1.x version of parcel. I'd recommend upgrading your project to parcel 2, which on npm is simply parcel (see migration guide).
The green box, is shown if the asset is not found, or some other error.
Since I'm not 100% sure how parcel works and I don't know your parcel configuration and which parcel plugins you are using (I'm assuming parcel can be configured).
You could solve the problem by: manually copying the assets folder from src/ to dist/, than it should work. (atleast this work for me, when using this parcel template, to test the issue)
Maybe a parcel - plugin like parcel-plugin-static-files-copy, could also solve the problem, and/or be useful to keep the static files up-to-date.

Gradle build failed with new import rules

I met an error after I updated android studio to version 3.6. When I tried to import Scenceform asset, it shows a warning in the picture below, whatever I click, it will return
java.lang.RuntimeException: java.lang.NoSuchMethodError: com.android.tools.idea.templates.recipe.RecipeExecutor.append(Ljava/io/File;Ljava/io/File;)
How can I fix this?
-- Update June 2020 --
Sceneform 1.15 has been replaced by the open source Sceneform 1.16. This appears to have also changed the model build approach, no longer using the SceneForm plugin and .sfa/.sfb workflow and instead including direct support for .gltf format model.
More information is available on the GitHub page, although the respoitory has now been archived which makes it hard to understand the future direction for Sceneform at this time (June 2020):
(https://github.com/google-ar/sceneform-android-sdk)
-- Workaround to the original problem if you are using Sceneform 1.15 --
To workaround the issue is you are using the Sceneform Plugin - see below:
This appears to be an issue with Android Studio 3.6 at the time of writing - see the issue here:
https://github.com/google-ar/sceneform-android-sdk/issues/912
One workaround appears to be to revert to Android Studio 3.5.
Alternatively adding the asset manually appears to work - taking the example in the online documentation for ARCore (https://developers.google.com/ar/develop/java/sceneform):
Follow these steps to import a new 3D asset:
Verify that your project's app folder contains a sampledata folder.
To create the folder, right-click on the app folder in the Project window, then select New > Sample Data Directory.
The sampledata folder is part of your Android Studio project, but its contents will not be included in your APK.
Copy your 3D model source asset file (*.obj, *.fbx, or .gltf), and all of its dependencies (.mtl, *.bin, *.png, *.jpg, etc.) into the sampledata folder.
Do not copy these source files into your project's assets or res folder, as this will cause them to be included in your APK unnecessarily.
Now instead of right clicking and using import, as the instructions at the link above go on to say, add the following lines to the bottom of your build.gradle(app) file manually:
apply plugin: 'com.google.ar.sceneform.plugin'
sceneform.asset('sampledata/andy.obj', // 'Source Asset Path' specified during import.
'default', // 'Material Path' specified during import.
'sampledata/andy.sfa', // '.sfa Output Path' specified during import.
'src/main/res/raw/andy') // '.sfb Output Path' specified during import.
Rebuild your project and the renderable should be imported correctly - check that andy.sfb has appeared in the 'res/raw' folder to be sure.
#harsha make sure the .obj file is referring to the right material.
mtllib chroma_key_video.mtl
g default
v -0.000000 2.244259 0.431967
v ...

Adding Bigdata.jar or Sinbad.jar to sublime.

I need to add bigjar to sublime so that I could use import big.data.*;
Which could be found here: https://github.com/berry-cs/big-data-cse
This link directs me to download sinbad, which I did. I now have this jar file and I don't know what to do with it.
I tried opening it. I tried going to package control but I think those are pre-downloadedable packages. I tried checking the package folder, where I am then presented with a user folder which embeds a package.Control.cache folder and other package bundles file, and dragging the sinbad.jar file in there.
I am terribly confused and just want to start my homework. If you could help or just push me in the rigth direction. I due apologize if this might be copy of another question.
AuctionSystem.java:5: error: package big.data does not exist
import big.data.*;
^
1 error

All letters R in construcnions R.id.name became red

After connection FireBase all letters R in constructions R.id.name became red. Task clean project doesnt help. Deleting directories build/ doesnt help also.
in log is written error: attribute 'e.android.myapp:adSize' not found.
Please, advice me, how can i solve this problem.
R is the main Resource.java which keeps a map of all allocations whichever you make in your app. It is deleted by its own if something is wrong in any of you .xml files, whether it is drawable, or layout, or any other res files.
the attribute adSize is not allowed in whichever layout tag you are trying to add. if its prefix is android:adSize try changing it to app:adSize and auto import app namespace. Rebuild your project, and it will regenerate your R.java file.
Happy coding...

Build is producing a .momd in the bundle that is missing the .mom file

I have an app that has been running fine on the iPhone simulator for some time. Recently, I decided I wanted to re-use the data model and related classes in another project - so I dragged them from this project window to the other then told Xcode not to copy, just to make references. At first this didn't work so I jumped through a number of hoops to try to fix it (I may be asking more about that in another post). After all this, I re-compiled and tried to run the original app -- and it's not working any more. On further investigation, I discovered that when I re-compile the original app, I end up with a bundle that contains a .momd package but it contains only a Versioninfo.plist file - no .mom file, no .omo file like I'm expecting to see. I don't recall making any changes to the original app. I don't get any warnings. I just get an incomplete .momd package (and, not surprisingly, my app now crashes).
What's going on here?
BTW, the app now crashes with this message:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
Which I get when executing this line of code:
self.productRegistry = [[UIManagedDocument alloc] initWithFileURL:self.productRegistryURL];
I figured this out by looking more closely at the file locations in the project directory using Finder. In the Xcode window, everything looks normal but in the actual project directory I found that the .datamodeld package had ended up at the top level of the project directory -- at the same level as the project package itself. Xcode apparently did not like this but unfortunately it did not complain -- it just created a partial build output. Once I moved the .datamodeld package into the same folder as the rest of the project's code, everything worked just fine.
This would appear to be just a quirk. I would expect that Xcode would either see that all is well and build correctly OR it would see that things weren't quite as they should be and fail. In this case, it did not build correctly but was silent about it.
Hope this answer helps someone else someday.

Resources